Merge pull request #27 from ldstreet/patch-1

Update readme to include final html example
This commit is contained in:
John Sundell 2019-01-14 00:23:05 +00:00 committed by GitHub
commit 787d3ed127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 1 deletions

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).
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
@ -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).
```
.package(url: "https://github.com/JohnSundell/Splash", from: "0.1.4")
```
### 🏃‍♂️ 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: