-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
74 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/resources/creativescala/content/configuration/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
# Configuration | ||
|
||
This theme allows some limited configuration: | ||
|
||
- [changing the links in the top navigation bar](top-nav.md); and | ||
- [adding additional CSS and JS](css-js.md) |
8 changes: 8 additions & 0 deletions
8
src/main/resources/creativescala/content/configuration/css-js.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
# CSS and Javascript | ||
|
||
You can add your own CSS and Javascript files to your site using the `addCss` and `addJs` methods on `CreativeScalaTheme`. These takes instances of `laika.ast.Path`. Here's an example in use: | ||
|
||
```scala | ||
laikaTheme := CreativeScalaTheme.empty | ||
.addJs(laika.ast.Path.Root / "main.js") | ||
.addCss(laika.ast.Path.Root / "main.css") | ||
.build | ||
``` |
26 changes: 26 additions & 0 deletions
26
src/main/resources/creativescala/content/configuration/top-nav.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,28 @@ | ||
# Top Navigation | ||
|
||
You can customize the links in the top navigation bar to link to your own community, API, and so on. To do this you call methods on an instance of `CreativeSCalaTheme`. This will usually be in your `build.sbt` where you'll have a line something like | ||
|
||
```scala | ||
laikaTheme := CreativeScalaTheme.empty | ||
.build | ||
``` | ||
|
||
The instance of `CreativeScalaTheme`, created by the code `CreativeScalaTheme.empty`, has the following methods: | ||
|
||
- `withHome`, which allows you to set the link in the center of the top bar (which is "Creative Scala Theme" above). It is supposed to link to the home page of your documentation site and defaults to the root of your documentation. | ||
- `withCommunity`, which allows you to set the link to your community (e.g. a group chat service like Discord). | ||
- `withApi`, which allows you to link to your API documentation. For most Scala projects this will be `javadoc.io`. | ||
- `withSource`, which allows you to specify the link to your source code, often on Github. | ||
|
||
All of these methods take a value of `SingleTargetLink`, which is taken from Laika's Helium theme. You'll need the import below to use it. | ||
|
||
```scala | ||
import laika.helium.config.SingleTargetLink | ||
``` | ||
|
||
This allows you specify links in a variety of formats, including images and icons. Below are examples of creating a text link to another page in your Laika documentation, and a text link to an external site. | ||
|
||
```scala | ||
TextLink.internal(Path.Root / "README.md", "Home"), | ||
TextLink.external("https://discord.gg", "Community"), | ||
``` |
5 changes: 5 additions & 0 deletions
5
src/main/resources/creativescala/content/directives/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Directives | ||
|
||
This theme comes with a number of directives you can use to add features to your documentation. | ||
|
||
*TO BE CONTINUED* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
laika.navigationOrder = [ | ||
README.md | ||
features.md | ||
configuration | ||
responsive.md | ||
directives | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Features | ||
|
||
Here is a brief overview of the features of this template: | ||
|
||
- It has some basic [responsive][responsive] features, meaning it adapts to changing screen sizes. On wide screens you'll have a table of contents for the site on the left, and on the right a table of contents for the page. On narrow screens these both disappear and are replaced by a table of contents that is accessed from the top bar. | ||
|
||
- It allows [configuration](/configuration/README.md) of the links on the top bar and adding additional Javascript and CSS files. Note that this theme is *not* designed to allow for heavy customization. If you want to change the fonts, color scheme, or make more radical changes, you'll want to fork the theme. | ||
|
||
- It provides a range of [directives](/directives/README.md) that I've found useful in documenting my projects. | ||
|
||
|
||
[responsive]: https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/CSS_layout/Responsive_Design |
This file was deleted.
Oops, something went wrong.