Skip to content

Commit 1d53e4d

Browse files
committed
Add scaladoc docs
1 parent 85a5601 commit 1d53e4d

File tree

10 files changed

+83
-0
lines changed

10 files changed

+83
-0
lines changed

_config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ highlighter: rouge
134134
permalink: /:categories/:title.html:output_ext
135135
baseurl:
136136
scala3ref: "https://dotty.epfl.ch/docs/reference"
137+
scaladocUsage: "https://dotty.epfl.ch/docs/usage/scaladoc"
137138
exclude: ["vendor"]
138139
plugins:
139140
- jekyll-redirect-from

index.md

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ scala3-sections:
2222
description: "An online book introducing the main language features."
2323
icon: "fa fa-book"
2424
link: /scala3/book/introduction.html
25+
- title: "Scaladoc new features"
26+
description: "Highlights of new features for Scaladoc"
27+
icon: "fa fa-star"
28+
link: /scala3/scaladoc.html
2529
- title: "More detailed information"
2630
links:
2731
- title: "Migration Guide"
213 KB
Loading
971 KB
Loading
Loading
Loading
Loading
Loading

scala3/index.md

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ sections:
2222
description: "An online book introducing the main language features."
2323
icon: "fa fa-book"
2424
link: /scala3/book/introduction.html
25+
- title: "Scaladoc new features"
26+
description: "Highlights of new features for Scaladoc"
27+
icon: "fa fa-star"
28+
link: /scala3/scaladoc.html
2529
- title: "More Detailed Information"
2630
links:
2731
- title: "Migration Guide"

scala3/scaladoc.md

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
layout: singlepage-overview
3+
title: New features for Scaladoc
4+
---
5+
6+
New Scala version brings us completely new Scaladoc rewritten from scratch.
7+
In this article you can find highlights of new features that are or will be introduced to Scaladoc.
8+
For general reference, visit [Scaladoc manual](https://dotty.epfl.ch/docs/usage/scaladoc/)
9+
10+
# New features
11+
12+
## Markdown syntax
13+
14+
The biggest change introduced in new Scaladoc is change of default language for styling docstring. So far it has been Wikidoc syntax.
15+
New Scaladoc can parse legacy `Wikidoc` syntax, however Markdown has been chosen for primary language for formatting comments.
16+
To switch back to `Wikidoc` one can pass global flag before running `doc` task or can define it for specific comment via `@syntax wiki` directive.
17+
18+
For more information how to use full power of docstings, check out [Scaladoc docstrings][scaladoc-docstrings]
19+
20+
21+
## Static site
22+
23+
Scaladoc brings easy way for creating static sites for both documentation and blog posts in the similar way as Jekyll does.
24+
Thanks to that feature you can store your documentation along-side with Scaladoc API docs output in a very convenient way.
25+
26+
For more info about how to configure static site documentation check out [Static documentation][static-documentation] chapter
27+
28+
![](../resources/images/scala3/scaladoc/static-site.png)
29+
30+
## Blog posts
31+
32+
Blog posts are a specific type of static site. To find more information about them look at the dedicated page for [Built-in blog][built-in-blog]
33+
34+
![](../resources/images/scala3/scaladoc/blog-post.png)
35+
36+
## Social links
37+
38+
Scaladoc provides an easy way to configure your social media links e. g. twitter or gitter. For more information look at the subsection of
39+
[Scaladoc settings][social-links] chapter.
40+
41+
![](../resources/images/scala3/scaladoc/social-links.png){: style="width: 180px"}
42+
43+
# Experimental features
44+
45+
These features are not stable to be released with scaladoc, however we are happy to hear your feedback. Each feature has its own thread at scala-lang contributors site, where you can share your opinions.
46+
47+
## Snippets compiler
48+
49+
One of the experimental features of Scaladoc will be snippets compiler. This tool will allow you to compile snippets that you attach to your docstring
50+
to check that they actually behave as intended, e. g. compile or throw some exception. The feature is very similar to `tut` or `mdoc` tools,
51+
but will be shipped with Scaladoc out of the box for easy setup. Making snippets interactive, e. g. user could edit them and compile in the browser is taken into account, though it is not in scope yet.
52+
53+
For more information you can follow this [thread](https://contributors.scala-lang.org/t/snippet-validation-in-scaladoc-for-scala-3/4976)
54+
55+
![](../resources/images/scala3/scaladoc/snippet-compiler2.gif)
56+
![](../resources/images/scala3/scaladoc/snippet-compiler1.gif)
57+
58+
## Type-signature browsing
59+
60+
Haskell programmers are probably familiar with Hoogle - documentation search engine that allows you browse the docs by signatures rather than symbolic
61+
names. Since many Scala developers are also functional programming fans, we decided to add similar functionality for the Scaladoc. The whole tool is based on [Inkuire](https://github.com/VirtusLab/Inkuire) which works with Kotlin and is being currently adapted to fit Scala3 type system.
62+
63+
![](../resources/images/scala3/scaladoc/inkuire.gif)
64+
65+
To be up-to-date with this feature you can follow this [thread](https://contributors.scala-lang.org/t/pre-sip-scaladoc-search-by-type-signature/1604/15).
66+
Note that this is very basic demo of this feature. We still don't support type lambdas, higher-kinded types and many more scala features.
67+
68+
69+
70+
71+
[scaladoc-docstrings]: {{ site.scaladocUsage }}/scaladocDocstrings.html
72+
[static-documentation]: {{ site.scaladocUsage }}/staticSite.html
73+
[built-in-blog]: {{ site.scaladocUsage }}/blog.html
74+
[social-links]: {{ site.scaladocUsage }}/settings.html#-social-links

0 commit comments

Comments
 (0)