You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/usage/scaladoc/settings.md
+35-2Lines changed: 35 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,12 @@ If you want to know what is current state of compatibility with scaladoc old fla
13
13
14
14
## Providing settings
15
15
16
-
Supply scaladoc settings as command-line arguments, e.g., `scaladoc -d output -project my-project target/scala-3.0.0-RC2/classes`. If called from sbt,
17
-
update the value of `Compile / doc / scalacOptions`, e. g. `Compile / doc / scalacOptions ++= Seq("-d", "output", "-project", "my-project")`
16
+
Supply scaladoc settings as command-line arguments, e.g., `scaladoc -d output -project my-project target/scala-3.0.0-RC2/classes`. If called from sbt, update the value of `Compile / doc / scalacOptions` and `Compile / doc / target` respectively, e. g.
Copy file name to clipboardExpand all lines: docs/docs/usage/scaladoc/staticSite.md
+60-13Lines changed: 60 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,13 @@ documentation.
40
40
In Scaladoc, all templates can contain YAML front-matter. The front-matter
41
41
is parsed and put into the `page` variable available in templates via Liquid.
42
42
43
+
Example front-matter
44
+
```
45
+
---
46
+
title: My custom title
47
+
---
48
+
```
49
+
43
50
Scaladoc uses some predefined properties to controls some aspect of page.
44
51
45
52
Predefined properties:
@@ -99,23 +106,44 @@ Scaladoc by default uses layout of files in `docs` directory to create table of
99
106
```yaml
100
107
sidebar:
101
108
- title: Blog
102
-
- title: Docs
103
-
url: docs/index.html
104
-
- title: Usage
109
+
- title: My title
110
+
page: my-page1.md
111
+
- page: my-page2.md
112
+
- page: my-page3/subsection
113
+
- title: Reference
105
114
subsection:
106
-
- title: Dottydoc
107
-
url: docs/usage/dottydoc.html
108
-
- title: sbt-projects
109
-
url: docs/usage/sbt-projects.html
115
+
- page: my-page3.md
116
+
- index: my-page4/index.md
117
+
subsection:
118
+
- page: my-page4/my-page4.md
119
+
- title: My subsection
120
+
index: my-page5/index.md
121
+
subsection:
122
+
- page: my-page5/my-page5.md
123
+
- index: my-page6/index.md
124
+
subsection:
125
+
- index: my-page6/my-page6/index.md
126
+
subsection:
127
+
- page: my-page6/my-page6/my-page6.md
110
128
```
111
129
112
-
The `sidebar` key is mandatory, as well as `title` for each element. The
113
-
default table of contents allows you to have subsections - albeit the current
114
-
depth limit is 2 however it accepts both files and directories and latter can be used to provide deeper structures.
130
+
The `sidebar` key is mandatory.
131
+
On each level you can have three different types of entries: `page`, `blog` or `subsection`.
132
+
133
+
`Page` is a leaf of the structure and accepts following attributes:
134
+
- `title`\[optional\] - title of the page
135
+
- `page`\[mandatory\] - path to the file that will represent the page, it can be either html of markdown file to be rendered, there is also possibility to pass the `directory` path. If so, the scaladoc will render the directory and all its content as if there were no `sidebar.yml` basing of its tree structure and index files.
136
+
137
+
The `page` property
115
138
116
-
The items must provide either `subsection` or `url` but not both at once!
117
-
The only exception is `Blog` which is only a `title` and behaves differently.
118
-
You can read more about blog [here](blog.md).
139
+
`Subsection` accepts nested nodes, these can be either pages or subsection, which allow you to create tree-like navigation. The attributes are:
140
+
- `title`\[optional\] - title of the page
141
+
- `index`\[optional\] - path to the file that will represent the index file of the subsection, it can be either html of markdown file to be rendered
142
+
- `subsection`\[mandatory\] - nested nodes, can be either pages or subsections
143
+
144
+
The `Subsection` can omit `title` or `index`, however not specifying any of these properties disables you from giving the title of the section.
145
+
146
+
The `Blog` is a special node represented by simple entry `- title: Blog` with no other attirbutes. All your blogposts will be automatically linked under this section. You can read more about blog [here](blog.md).
119
147
120
148
```
121
149
├── blog
@@ -126,6 +154,25 @@ You can read more about blog [here](blog.md).
126
154
└── sidebar.yml
127
155
```
128
156
157
+
## Hierarchy of title
158
+
159
+
There is a possibility to give custom title using `sidebar.yml`. The default strategy when choosing title for:
160
+
161
+
#### Page
162
+
163
+
1. `title` from the `front-matter` of the markdown/html file
164
+
2. `title` property from the `sidebar.yml` property
165
+
3. filename
166
+
167
+
#### Subsection
168
+
169
+
1. `title` from the `front-matter` of the markdown/html index file
170
+
2. `title` property from the `sidebar.yml` property
171
+
3. filename
172
+
173
+
Note that if you skip `index` file in your tree structure of you don't specify the `title` in the frontmatter, there will be given generic name `index`. The same applies when using `sidebar.yml` but not specifying `title` nor `index`, just a subsection. Again, generic `index` name will appear.
174
+
175
+
129
176
## Static resources
130
177
131
178
You can attach static resources (pdf, images) to your documentation by using two dedicated directories:
0 commit comments