Skip to content

Commit

Permalink
Add scaladoc docs
Browse files Browse the repository at this point in the history
  • Loading branch information
BarkingBad committed May 11, 2021
1 parent 85a5601 commit 4e754c7
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 0 deletions.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ highlighter: rouge
permalink: /:categories/:title.html:output_ext
baseurl:
scala3ref: "https://dotty.epfl.ch/docs/reference"
scaladocUsage: "https://dotty.epfl.ch/docs/usage/scaladoc"
exclude: ["vendor"]
plugins:
- jekyll-redirect-from
Expand Down
4 changes: 4 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ scala3-sections:
description: "An online book introducing the main language features."
icon: "fa fa-book"
link: /scala3/book/introduction.html
- title: "Scaladoc new features"
description: "Highlights of new features for Scaladoc"
icon: "fa fa-star"
link: /scala3/scaladoc.html
- title: "More detailed information"
links:
- title: "Migration Guide"
Expand Down
Binary file added resources/images/scala3/scaladoc/blog-post.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/scala3/scaladoc/inkuire.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/scala3/scaladoc/social-links.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/scala3/scaladoc/static-site.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions scala3/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ sections:
description: "An online book introducing the main language features."
icon: "fa fa-book"
link: /scala3/book/introduction.html
- title: "Scaladoc new features"
description: "Highlights of new features for Scaladoc"
icon: "fa fa-star"
link: /scala3/scaladoc.html
- title: "More Detailed Information"
links:
- title: "Migration Guide"
Expand Down
68 changes: 68 additions & 0 deletions scala3/scaladoc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
layout: singlepage-overview
title: New features for Scaladoc
---

New Scala version brings us completely new Scaladoc rewritten from scratch.
In this article you can find highlights of new features that are or will be introduced to Scaladoc.
For general reference, visit [Scaladoc manual](https://dotty.epfl.ch/docs/usage/scaladoc/)

## Markdown syntax

The biggest change introduced in new Scaladoc is change of default language for styling docstring. So far it has been Wikidoc syntax.
New Scaladoc can parse legacy `Wikidoc` syntax, however Markdown has been chosen for primary language for formatting comments.
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.

For more information how to use full power of docstings, check out [Scaladoc docstrings][scaladoc-docstrings]


## Static site

Scaladoc brings easy way for creating static sites for both documentation and blog posts in the similar way as Jekyll does.
Thanks to that feature you can store your documentation along-side with Scaladoc API docs output in a very convenient way.

For more info about how to configure static site documentation check out [Static documentation][static-documentation] chapter

![](../resources/images/scala3/scaladoc/static-site.png)

## Blog posts

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]

![](../resources/images/scala3/scaladoc/blog-post.png)

## Social links

Scaladoc provides an easy way to configure your social media links e. g. twitter or gitter. For more information look at the subsection of
[Scaladoc settings][social-links] chapter.

![](../resources/images/scala3/scaladoc/social-links.png)

## Snippets compiler

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
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,
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.

For more information you can follow this [thread](https://contributors.scala-lang.org/t/snippet-validation-in-scaladoc-for-scala-3/4976)

![](../resources/images/scala3/scaladoc/snippet-compiler2.gif)
![](../resources/images/scala3/scaladoc/snippet-compiler1.gif)

## Type-signature browsing

Haskell programmers are probably familiar with Hoogle - documentation search engine that allows you browse the docs by signatures rather than symbolic
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.

![](../resources/images/scala3/scaladoc/inkuire.gif)

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).
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.




[scaladoc-docstrings]: {{ site.scaladocUsage }}/scaladocDocstrings.html
[static-documentation]: {{ site.scaladocUsage }}/staticSite.html
[built-in-blog]: {{ site.scaladocUsage }}/blog.html
[social-links]: {{ site.scaladocUsage }}/settings.html#-social-links

0 comments on commit 4e754c7

Please sign in to comment.