Update readme to include final html example

Adding an example of a finished html file for those that might be less experienced in html (such as myself). Also added link to  HTMLOutputFormat and SPM declaration snippet for convenience. Thanks for the great library!
This commit is contained in:
Luke Street 2019-01-07 22:39:47 -06:00 committed by GitHub
parent 41f04573a4
commit f1796eb99b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,23 @@ You'll get the following output back:
To be as flexible as possible, Splash doesn't hardcode any colors or other CSS attributes in the HTML it generates. Instead it simply assigns a CSS class to each token. For an example of a CSS file that can be used to style Splash-generated HTML, see [Examples/sundellsColors.css](https://github.com/JohnSundell/Splash/blob/master/Examples/sundellsColors.css). To be as flexible as possible, Splash doesn't hardcode any colors or other CSS attributes in the HTML it generates. Instead it simply assigns a CSS class to each token. For an example of a CSS file that can be used to style Splash-generated HTML, see [Examples/sundellsColors.css](https://github.com/JohnSundell/Splash/blob/master/Examples/sundellsColors.css).
For more information about HTML generation with Splash and how to customize it, see `HTMLOutputFormat`. When rendering your outputted html, make sure to wrap your output code in the `<pre>` and `<code> ` tags and properly link to your `.css` file. Like this:
```html
<!DOCTYPE html>
<head>
<title>Hello World</title>
<link rel="stylesheet" href="sundellsColors.css">
</head>
<pre>
<code>
<span class="keyword">func</span> hello(world: <span class="type">String</span>) -> <span class="type">Int</span>
</code>
</pre>
```
For more information about HTML generation with Splash and how to customize it, see `HTMLOutputFormat` [here](https://github.com/JohnSundell/Splash/blob/master/Sources/Splash/Output/HTMLOutputFormat.swift).
#### SplashImageGen #### SplashImageGen
@ -115,6 +131,10 @@ Splash supports both macOS and Linux.
To install Splash for use in a Swift Package Manager-powered tool or server-side application, add Splash as a dependency to your `Package.swift` file. For more information, please see the [Swift Package Manager documentation](https://github.com/apple/swift-package-manager/tree/master/Documentation). To install Splash for use in a Swift Package Manager-powered tool or server-side application, add Splash as a dependency to your `Package.swift` file. For more information, please see the [Swift Package Manager documentation](https://github.com/apple/swift-package-manager/tree/master/Documentation).
```
.package(url: "https://github.com/JohnSundell/Splash", from: "0.1.4")
```
### 🏃‍♂️ As a Marathon dependency ### 🏃‍♂️ As a Marathon dependency
If you want to use Splash in a [Marathon](https://github.com/johnsundell/marathon) script, either add it to your `Marathonfile` (see the Marathon repo for instructions on how to do that), or point Marathon to Splash using the inline dependency syntax: If you want to use Splash in a [Marathon](https://github.com/johnsundell/marathon) script, either add it to your `Marathonfile` (see the Marathon repo for instructions on how to do that), or point Marathon to Splash using the inline dependency syntax: