Skip to content

Commit 6722416

Browse files
committed
Clarify scaladoc documentation, fix typos, fix conflicts
1 parent 83c5a7d commit 6722416

File tree

5 files changed

+45
-33
lines changed

5 files changed

+45
-33
lines changed

docs/docs/usage/scaladoc/blog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ All your blogposts must be put under `blog/_posts` directory.
2222
│ └── index.html
2323
```
2424

25-
If you are using sidebar don't forget to place
25+
If you are using yaml [sidebar](./staticSite.html#sidebar) don't forget to place
2626

2727
```
2828
sidebar:
2929
- title: Blog
3030
```
3131

32-
somewhere inside the tree. Scaladoc will attach under that section all of your blogposts.
32+
somewhere inside the `yaml` tree representing the sidebar sections. Scaladoc will attach under that section all of your blogposts.
3333

3434
## Naming convention
3535

docs/docs/usage/scaladoc/scaladocDocstrings.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Scaladoc docstrings - specific Tags and Features
44

55
# {{page.title}}
66

7-
This chapater describes how to write correctly docstrings and how to use all available features of scaladoc.
7+
This chapter describes how to correctly write docstrings and how to use all the available features of scaladoc.
88
Since many things are the same as in the old scaladoc, some parts are reused from this [article](https://docs.scala-lang.org/overviews/scaladoc/for-library-authors.html)
99

1010

@@ -13,7 +13,7 @@ to API definitions. This can be used from within static documentation and blog
1313
posts to provide blend-in content.
1414

1515

16-
## Where to put scaladoc
16+
## Where to put docstrings
1717

1818
Scaladoc comments go before the items they pertain to in a special comment block that starts with a /** and ends with a */, like this:
1919

@@ -29,8 +29,12 @@ Scaladoc comments go before the items they pertain to in a special comment block
2929
* left margin is on the same column on the
3030
* first line and on subsequent ones.
3131
*
32-
* The closing Scaladoc tag goes on its own,
33-
* separate line. E.g.
32+
* Close the comment with *\/
33+
*
34+
* If you use Scaladoc tags (@param, @group, etc.),
35+
* remember to put them at separate lines with nothing preceding.
36+
*
37+
* For example:
3438
*
3539
* Calculate the square of the given number
3640
*
@@ -69,7 +73,7 @@ Scaladoc uses `@<tagname>` tags to provide specific detail fields in the comment
6973
- `@see` reference other sources of information like external document links or related entities in the documentation.
7074
- `@note` add a note for pre or post conditions, or any other notable restrictions or expectations.
7175
- `@example` for providing example code or related example documentation.
72-
- `@usecase` provide a simplified method definition for when the full method definition is too complex or noisy. An example is (in the collections API), providing documentation for methods that omit the implicit canBuildFrom.
76+
7377
7478
### Member grouping tags
7579
@@ -78,11 +82,11 @@ These tags are well-suited to larger types or packages, with many members. They
7882
These tags are not enabled by default! You must pass the -groups flag to Scaladoc in order to turn them on. Typically the sbt for this will look something like:
7983
8084
```scala
81-
scalacOptions in (Compile, doc) ++= Seq(
85+
Compile / doc / scalacOptions ++= Seq(
8286
"-groups"
8387
)
8488
```
85-
Each section should have a single-word identifier that is used in all of these tags, shown as <group> below. By default, that identifier is shown as the title of that documentation section, but you can use @groupname to provide a longer title.
89+
Each section should have a single-word identifier that is used in all of these tags, shown as `group` below. By default, that identifier is shown as the title of that documentation section, but you can use @groupname to provide a longer title.
8690
8791
Typically, you should put @groupprio (and optionally @groupname and @groupdesc) in the Scaladoc for the package/trait/class/object itself, describing what all the groups are, and their order. Then put @group in the Scaladoc for each member, saying which group it is in.
8892
@@ -108,25 +112,26 @@ Members that do not have a `@group` tag will be listed as “Ungrouped” in the
108112
If a comment is not provided for an entity at the current inheritance level, but is supplied for the overridden entity at a higher level in the inheritance hierarchy, the comment from the super-class will be used.
109113
110114
Likewise if `@param`, `@tparam`, `@return` and other entity tags are omitted but available from a superclass, those comments will be used.
111-
Explicit
112115
113-
For explicit comment inheritance, use the @inheritdoc tag.
114-
Markup
116+
### Explicit
115117
116-
It is still possible to embed HTML tags in Scaladoc (like with Javadoc), but not necessary most of the time as markup may be used instead.
118+
For explicit comment inheritance, use the @inheritdoc tag.
117119
118120
### Markup
119121
120122
Scaladoc provides two syntax parsers: `markdown` (default) or `wikidoc`.
123+
It is still possible to embed HTML tags in Scaladoc (like with Javadoc), but not necessary most of the time as markup may be used instead.
121124
122125
#### Markdown
123126
124-
Markdown uses [commonmark flavour](https://spec.commonmark.org/current/) with extension of `wikidoc` links for referencing convenience.
127+
Markdown uses [commonmark flavour](https://spec.commonmark.org/current/) with two custom extensions:
128+
- `wikidoc` links for referencing convenience
129+
- `wikidoc` codeblocks with curly braces syntax
125130
126131
127132
#### Wikidoc
128133
129-
Wikidoc is syntax used for scala2 scaladoc. It is supported because of many existing source code, however it is unrecommended to use it in new projects.
134+
Wikidoc is syntax used for scala2 scaladoc. It is supported because of many existing source code, however it is **not** recommended to use it in new projects.
130135
Wikisyntax can be toggled on with flag `-comment-syntax wiki` globally, or with `@syntax wiki` directive in docstring.
131136
132137
Some of the standard markup available:

docs/docs/usage/scaladoc/settings.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Scaladoc settings
44

55
# {{page.title}}
66

7-
You can find brief information included in this chapter while calling scaladoc with `-help` flag. However it can be a little tricky if one uses sbt `doc` task.
7+
This chapter lists the configuration options that can be used when calling scaladoc. Some of the information shown here can be found by calling scaladoc with the `-help` flag.
88

99
## Parity with scaladoc for Scala 2
1010

@@ -13,7 +13,7 @@ If you want to know what is current state of compatibility with scaladoc old fla
1313

1414
## Providing settings
1515

16-
Scaladoc accepts settings provided as a string, e. g. `scaladoc -d output -project my-project target/scala-3.0.0-RC2/classes` or, if called from sbt,
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,
1717
update the value of `Compile / doc / scalacOptions`, e. g. `Compile / doc / scalacOptions ++= Seq("-d", "output", "-project", "my-project")`
1818

1919
## Overview of all available settings
@@ -31,19 +31,25 @@ The logo of your project that appears in a top left corner. To provide compatibi
3131
The string message that appears in a footer section. To provide compatibility with Scala2 aliases with `-doc-footer`
3232

3333
##### -comment-syntax
34-
The default syntax of comments. Defaults to markdown however wikisyntax can be used.
34+
The styling language used for parsing comments.
35+
Currently we support two syntaxes: `markdown` or `wiki`
36+
If setting is not present, scaladoc defaults `markdown`
3537

3638
##### -revision
3739
Revision (branch or ref) used to build project project. Useful with sourcelinks to prevent them from pointing always to the newest master that is subject to changes.
3840

3941
##### -source-links
4042
Source links provide a mapping between file in documentation and code repository.
4143

44+
Example source links is:
45+
`-source-links:docs=github://lampepfl/dotty/master#docs`
46+
4247
Accepted formats:
48+
4349
\<sub-path>=\<source-link>
4450
\<source-link>
4551

46-
where <source-link> is one of following:
52+
where \<source-link> is one of following:
4753
- `github://<organization>/<repository>[/revision][#subpath]`
4854
will match https://github.com/$organization/$repository/\[blob|edit]/$revision\[/$subpath]/$filePath\[$lineNumber]
4955
when revision is not provided then requires revision to be specified as argument for scaladoc
@@ -52,34 +58,33 @@ where <source-link> is one of following:
5258
when revision is not provided then requires revision to be specified as argument for scaladoc
5359
- \<scaladoc-template>
5460

55-
<scaladoc-template> is a format for `doc-source-url` parameter scaladoc.
61+
\<scaladoc-template> is a format for `doc-source-url` parameter from old scaladoc.
5662
NOTE: We only supports `€{FILE_PATH_EXT}`, `€{TPL_NAME}`, `€{FILE_EXT}`,
57-
€{FILE_PATH}, and €{FILE_LINE} patterns
63+
€{FILE_PATH}, and €{FILE_LINE} patterns.
5864

5965

6066
Template can defined only by subset of sources defined by path prefix represented by `<sub-path>`.
6167
In such case paths used in templates will be relativized against `<sub-path>`
6268

63-
Example source links is:
64-
`-source-links:docs=github://lampepfl/dotty/master#docs`
6569

6670

6771
##### -external-mappings
6872

6973
Mapping between regexes matching classpath entries and external documentation.
70-
'regex::\[scaladoc|scaladoc|javadoc]::path' syntax is used
7174

7275
Example external mapping is:
7376
`-external-mappings:.*scala.*::scaladoc3::http://dotty.epfl.ch/api/,.*java.*::javadoc::https://docs.oracle.com/javase/8/docs/api/`
7477

75-
##### -social-links
78+
A mapping is of the form '\<regex>::\[scaladoc3|scaladoc|javadoc]::\<path>'. You can supply several mappings, separated by commas, as shown in the example.
7679

77-
Links to social sites. '[github|twitter|gitter|discord]::link' syntax is used. 'custom::link::white_icon_name::black_icon_name' is also allowed, in this case icons must be present in 'images/'' directory.
80+
##### -social-links
7881

79-
Example social link is:
82+
Links to social sites. For example:
8083

8184
`-social-links:github::https://github.com/lampepfl/dotty,gitter::https://gitter.im/scala/scala,twitter::https://twitter.com/scala_lang`
8285

86+
Valid values are of the form: '\[github|twitter|gitter|discord]::link'. Scaladoc also supports 'custom::link::white_icon_name::black_icon_name'. In this case icons must be present in 'images/' directory.
87+
8388
##### -skip-by-id
8489

8590
Identifiers of packages or top-level classes to skip when generating documentation.
@@ -95,6 +100,8 @@ The file from which the root package documentation should be imported.
95100
##### -author
96101

97102
Include authors.
103+
Adding authors in docstring with `@author Name Surname` by default won't be included in generated html documentation.
104+
If you would like to label classes with authors explicitly, run scaladoc with this flag.
98105

99106
##### -groups
100107

docs/docs/usage/scaladoc/staticSite.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ default table of contents allows you to have subsections - albeit the current
114114
depth limit is 2 however it accepts both files and directories and latter can be used to provide deeper structures.
115115

116116
The items must provide either `subsection` or `url` but not both at once!
117-
The only excepiton is `Blog` which is only a `title` and behaves differently.
117+
The only exception is `Blog` which is only a `title` and behaves differently.
118118
You can read more about blog [here](blog.md).
119119

120120
```
@@ -128,11 +128,11 @@ You can read more about blog [here](blog.md).
128128
129129
## Static resources
130130
131-
You can attach static resources (pdf, images) in your documentation using two dedicated directories:
131+
You can attach static resources (pdf, images) to your documentation by using two dedicated directories:
132132
`resources` and `images`. When you upload your assests under any of these directories you can reference them in markdown
133133
as if they were relatively at the same level.
134134
135-
For example let's look at this situation:
135+
For example, consider the following situation:
136136
137137
```
138138
├── blog
@@ -148,7 +148,7 @@ For example let's look at this situation:
148148

149149
```
150150
151-
You can access them directly inside any of the files using markdown links:
151+
You can refer to the assets from within any of the files using markdown links:
152152
153153
```
154154
This is my blogpost. Here is the image ![](my_image.png) and here is my [pdf](my_file.pdf)

scaladoc/documentation/docs/design.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ Scaladoc is divided into 3 modules, that are:
77

88
##### scaladoc
99

10-
This module consist core sourcecode and assets (css, js) used for building Scaladoc.
10+
This module contains the core source code and assets (css, js) used for building Scaladoc.
1111

1212
##### scaladoc-js
1313

14-
This module consist Scala sourcecode that is transpiled to JavaScript that is used by scaladoc for:
14+
This module contains Scala source code that is compiled to JavaScript. It is used by scaladoc for:
1515
- searchbar
1616
- social links
1717
- snippets processor

0 commit comments

Comments
 (0)