Skip to content

Migrate scala3doc codebase into dotty #10073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 237 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
237 commits
Select commit Hold shift + click to select a range
b4cad72
Initial commit with basic setup
romanowski Jul 15, 2020
7f34b54
Fake docs works!
romanowski Jul 18, 2020
b9a3854
Play with dokka
romanowski Jul 20, 2020
ada35b9
pg2
romanowski Jul 20, 2020
cdcbec1
Add scope of PoC
romanowski Jul 20, 2020
6043b1a
wip-split
romanowski Jul 20, 2020
d1c48c9
Generate Documentables directly from TASTY
romanowski Jul 20, 2020
c3bbbe2
Do not require to run gradle
romanowski Jul 21, 2020
c3596ae
Fix a typo in compiler option name
abgruszecki Jul 21, 2020
cfcfb95
Merge pull request #2 from AleksanderBG/master
abgruszecki Jul 21, 2020
8960935
Setup CI and publicaiton
romanowski Jul 21, 2020
ddf6067
Add caching
romanowski Jul 21, 2020
f70e439
Merge pull request #3 from romanowski/setup-ci
romanowski Jul 21, 2020
ffaaca1
Basic support for methods, generics does not work.
romanowski Jul 21, 2020
fe7ae5c
Merge pull request #4 from romanowski/basic-methods
romanowski Jul 22, 2020
7b24b9e
Create Scala signature provider that redeners methods
romanowski Jul 22, 2020
3215fd8
Update README.md
romanowski Jul 22, 2020
d28da30
Use test code from dottydoc and exclude tool code from documentation …
romanowski Jul 22, 2020
31956e2
Add proper rendering got classes and methods
romanowski Jul 22, 2020
be16cc0
Merge pull request #6 from romanowski/basic-methods
abgruszecki Jul 23, 2020
2a26e75
Added simple testing framework for dotty and signature tests
pikinier20 Jul 23, 2020
27a1038
Fix type rendering
romanowski Jul 23, 2020
71dfa0a
Added preprocessor which replaces logo in docs. Provided basic Scala …
pikinier20 Jul 24, 2020
207429a
Merge pull request #8 from romanowski/fix-tests
abgruszecki Jul 24, 2020
2ad01dc
Merge pull request #9 from pikinier20/new-logo
abgruszecki Jul 24, 2020
8a3da50
Changed logo installer to resource installer, added preprocessor whic…
pikinier20 Jul 24, 2020
d00f187
Merge pull request #10 from romanowski/resource-installing
romanowski Jul 27, 2020
1dd067b
Added parsing PackageClauses from TASTy, added documentation for pack…
pikinier20 Jul 29, 2020
ab89f60
Merge pull request #16 from romanowski/package-documentation
romanowski Jul 30, 2020
78c7b95
Further signature tests
pikinier20 Jul 24, 2020
a251a9e
Added support for visibility modifiers and OOP modifiers(final, seale…
pikinier20 Jul 27, 2020
62aa5fa
Added extra modifiers to classlikes and functions
pikinier20 Jul 27, 2020
b580713
Add missing bits in signatures
romanowski Jul 29, 2020
abc5318
Add basic support got types, vals and vars
romanowski Jul 29, 2020
aa53cdd
Merge pull request #17 from romanowski/types
romanowski Jul 30, 2020
d63fac3
Render nested classes/types/traits correctly
romanowski Jul 30, 2020
0a5f5de
Add support for match types
romanowski Jul 30, 2020
0cda682
Merge pull request #28 from romanowski/nested-classes
romanowski Jul 31, 2020
c1146d6
Clean up TODOs
romanowski Jul 30, 2020
8e20de0
Merge pull request #27 from romanowski/todos-cleanup
romanowski Jul 31, 2020
c1ba2a4
Merge pull request #30 from romanowski/match-types
romanowski Jul 31, 2020
e12c359
Update dottyc to 0.26.0-RC1
abgruszecki Jul 31, 2020
44ff308
Support for companion objects
pikinier20 Jul 30, 2020
be4f36b
Merge pull request #29 from romanowski/companion-objects
romanowski Jul 31, 2020
083d1cb
Update Scala versions in code
abgruszecki Jul 31, 2020
f359a7a
Merge pull request #36 from romanowski/update-scalac
romanowski Jul 31, 2020
eda1a43
Initial working version of Markdown parsing
abgruszecki Jul 23, 2020
2e0e4ba
Clean up most of the comment parsing
abgruszecki Jul 21, 2020
9b932da
Convert most of Markdown into Dokka doc model
abgruszecki Jul 22, 2020
bed26f8
Add Uncyclo syntax support
abgruszecki Jul 24, 2020
1aafa3d
Merge pull request #5 from romanowski/comment-parsing
romanowski Jul 31, 2020
b32c70b
Support for package functions and properties
pikinier20 Jul 31, 2020
1db554c
Fix @throws section handling.
abgruszecki Jul 31, 2020
a642f84
Added multiple file tests. Added test for package merging
pikinier20 Jul 31, 2020
afde24e
Merge pull request #38 from romanowski/fix-throws-section
romanowski Jul 31, 2020
434e44b
Merge pull request #37 from romanowski/package-symbols
romanowski Jul 31, 2020
6f95531
Basic version of link resolution
abgruszecki Aug 4, 2020
57806f2
Added basic support for extension methods
pikinier20 Aug 4, 2020
f9973de
Improve link resolution
abgruszecki Aug 5, 2020
b6a8437
Fix debug println-s
abgruszecki Aug 5, 2020
2a30cef
Cleanup MemberLookup
abgruszecki Aug 5, 2020
3a25cd6
Cleanup Uncyclo parser
abgruszecki Aug 5, 2020
7c38c25
Support for right-associative extension methods. Extension methods ch…
pikinier20 Aug 6, 2020
97d0e1d
Add support for documentation briefs/summaries
abgruszecki Aug 6, 2020
850852d
Implement static page generator plugin for dokka
romanowski Aug 6, 2020
7eae771
Include sample static page for CI and testing
romanowski Aug 6, 2020
47b370c
Add command line api
romanowski Aug 6, 2020
02d4134
Merge pull request #48 from romanowski/extension-methods
romanowski Aug 6, 2020
94fdc59
Merge pull request #47 from romanowski/link-resolution
romanowski Aug 6, 2020
4da54da
Merge pull request #50 from romanowski/comment-summary
romanowski Aug 6, 2020
fd077ae
Merge pull request #45 from romanowski/static-site
romanowski Aug 6, 2020
757e893
Fix for bug with non-excluding modifiers
pikinier20 Aug 10, 2020
aa45416
Merge pull request #96 from VirtusLab/modifiers-bug
abgruszecki Aug 10, 2020
0411d35
Added grouping block. Extension grouping by extended symbol. Content …
pikinier20 Aug 7, 2020
d64138f
Companion rendering refactor
pikinier20 Aug 10, 2020
5593428
Merge pull request #95 from VirtusLab/extension-methods
romanowski Aug 10, 2020
a9a5750
Move match type case to sythetic support
romanowski Aug 7, 2020
5c89624
Prepare dotty-dokka to document itelf
romanowski Aug 8, 2020
a222530
Merge pull request #97 from VirtusLab/dogfood
romanowski Aug 10, 2020
404ee7b
Merge pull request #99 from VirtusLab/match-case
romanowski Aug 10, 2020
28077d4
Change _root_ to 'all packages'
romanowski Aug 10, 2020
6eb75ee
Basic enum support
pikinier20 Aug 11, 2020
bfd7667
Support for parameters in enum entries, 'extends' clause
pikinier20 Aug 11, 2020
3676f0f
Remove Tastydoc from dependencies
abgruszecki Aug 11, 2020
d3eb068
Merge pull request #104 from VirtusLab/remove-tastydoc
romanowski Aug 11, 2020
6d2e7e4
Merge pull request #100 from VirtusLab/dogfood
abgruszecki Aug 11, 2020
b56a0d7
Fix for & operator in enum types
pikinier20 Aug 12, 2020
86aecfe
Hotfix for generating pages for extension methods
pikinier20 Aug 12, 2020
4d71b52
Merge pull request #107 from VirtusLab/extension-hotfix
romanowski Aug 13, 2020
c5ddef4
CRs + refactor of documentable generation
pikinier20 Aug 13, 2020
39373e6
Merge pull request #103 from VirtusLab/enums-support
romanowski Aug 13, 2020
0926be3
Support for structural types
pikinier20 Aug 18, 2020
e154e13
Bugfixes in rendering refined types
pikinier20 Aug 18, 2020
7a0a4ae
Add transformer which creates package hierarchy
pikinier20 Aug 13, 2020
f0e1f15
Merge pull request #118 from VirtusLab/structural-types
pikinier20 Aug 19, 2020
de8fd27
Support for opaque types
pikinier20 Aug 18, 2020
9a76722
Merge pull request #108 from VirtusLab/navigation-fix
romanowski Aug 19, 2020
6e05c68
Merge pull request #114 from VirtusLab/opaque-types
abgruszecki Aug 19, 2020
5128929
Added inherited methods to method tab
pikinier20 Aug 19, 2020
c343dac
Update README and our site
abgruszecki Aug 19, 2020
3bf9551
Update s3 location
romanowski Aug 19, 2020
e380394
Merge pull request #123 from lampepfl/new-s3-bucket
romanowski Aug 19, 2020
1d48b49
Update AWS links
abgruszecki Aug 19, 2020
f1657dc
Merge pull request #122 from lampepfl/update-readme
abgruszecki Aug 19, 2020
8d3b92e
Add very basic API docs
abgruszecki Aug 19, 2020
089e974
Add a CLI option for selecting default doc syntax
abgruszecki Aug 19, 2020
0bd5240
Merge pull request #132 from lampepfl/basic-self-docs
abgruszecki Aug 20, 2020
15cf282
Add new arg to tests
abgruszecki Aug 20, 2020
0043d6e
Merge pull request #133 from lampepfl/comment-syntax-option
romanowski Aug 20, 2020
b9db874
Merge pull request #126 from lampepfl/inherited-methods
romanowski Aug 20, 2020
d682623
Added support for given symbols. There are classes documented that sh…
pikinier20 Aug 17, 2020
35d3990
Added --name parameter to allow setting the name of documented module
pikinier20 Aug 12, 2020
1ec9cb0
Merge pull request #110 from lampepfl/givens-support
pikinier20 Aug 21, 2020
bf7002c
Merge pull request #106 from lampepfl/name-parameter
pikinier20 Aug 21, 2020
802cfb7
Add Uncyclo link support to Markdown
abgruszecki Aug 24, 2020
bd1c319
Recreated ContentBuilder in Scala to make PageCreator more readable
pikinier20 Aug 20, 2020
dd38fbc
Merge pull request #140 from lampepfl/content-builder
pikinier20 Aug 25, 2020
9d97241
Merge pull request #146 from lampepfl/md-wiki-links
abgruszecki Aug 25, 2020
da883ff
Fix the Gradle wrapper
TheElectronWill Aug 25, 2020
363acdd
Upgrade Dokka to 1.4.0-rc
TheElectronWill Aug 25, 2020
6687e0c
Add buildDokkaApi as a dependency of compile
TheElectronWill Aug 25, 2020
e75c91f
Remove dokkaJavaApi jar from the repo
TheElectronWill Aug 25, 2020
5f65ab2
Gitignore libs/
TheElectronWill Aug 25, 2020
b0ae733
Merge pull request #153 from TheElectronWill/master
pikinier20 Aug 26, 2020
e10020c
Added tabs for know subtypes and linear supertypes
pikinier20 Aug 26, 2020
1e8e031
Merge pull request #154 from lampepfl/type-hierarchy
abgruszecki Sep 1, 2020
a3aef18
Added transformer that appends links to source files
pikinier20 Aug 25, 2020
e904857
Merge pull request #152 from lampepfl/source-links
pikinier20 Sep 1, 2020
d736bc6
Support for type lambdas
pikinier20 Aug 24, 2020
afeeff1
Support for term refs. Improved support for givens
pikinier20 Aug 24, 2020
54a77e3
Improved refinement parsing
pikinier20 Aug 24, 2020
94a3510
Merge pull request #148 from lampepfl/more-types-support
pikinier20 Sep 1, 2020
25425b3
Replace Dokka default CSS by a new theme
TheElectronWill Aug 25, 2020
0d0f950
Update links in index.md
TheElectronWill Aug 27, 2020
800bc66
Tweak the UI and make the left bar usable on small screens
TheElectronWill Aug 27, 2020
fbcce6f
Implement syntax highlighting
TheElectronWill Aug 31, 2020
7ad4500
Use relative url in the navbar
TheElectronWill Aug 31, 2020
e7bbdb5
Handle soft keywords preceding regular keywords
TheElectronWill Sep 2, 2020
a4b9c58
Merge pull request #156 from lampepfl/new-ui
pikinier20 Sep 3, 2020
884a1ba
Refactor model classes
pikinier20 Sep 2, 2020
dea4fe6
Refactor signature provider to use ScalaPageContentBuilder
pikinier20 Sep 2, 2020
3a63e62
Implement annotation parsing and building, add annotations to symbols
pikinier20 Sep 2, 2020
04d8ce2
Merge pull request #161 from lampepfl/annotations
abgruszecki Sep 8, 2020
428c17f
Support missing signature modifiers (open + private/protected with sc…
prolativ Sep 9, 2020
59c5f8d
Merge pull request #163 from lampepfl/missing-signature-modifiers
romanowski Sep 10, 2020
e31d0af
Migrate to dokka-site and dokka 1.4.0
romanowski Sep 9, 2020
a9650e5
Hide Object and Any supertypes and inherited methods
TheElectronWill Sep 20, 2020
81f39f6
Some formatting
TheElectronWill Sep 20, 2020
82b6dc8
Use relative links for the icons font (small PR)
TheElectronWill Sep 20, 2020
5c15b25
Merge pull request #169 from lampepfl/ui-relative-links
TheElectronWill Sep 21, 2020
f06988e
Merge pull request #164 from lampepfl/dokka1.4
romanowski Sep 21, 2020
d58478a
Merge pull request #168 from lampepfl/ignore-object-any
abgruszecki Sep 21, 2020
ba9f4a7
Update Dotty version to 0.27.0-RC1
abgruszecki Sep 23, 2020
76f496a
Update references to classfile output location
abgruszecki Sep 23, 2020
2047533
Merge pull request #170 from lampepfl/dotty-0.27-RC1
romanowski Sep 24, 2020
91bc522
Rewrite page creator
pikinier20 Sep 16, 2020
d41bec5
Extend html renderer and handle comments in page creator
pikinier20 Sep 17, 2020
f9fd37c
Add frontent support for inline html
pikinier20 Sep 3, 2020
b1b9941
Merge pull request #167 from lampepfl/page-creator-rewrite
pikinier20 Sep 24, 2020
200b5a1
Add example SBT sub-project
abgruszecki Sep 3, 2020
3415d1e
Add SBT plugin, configure the sub-project
abgruszecki Sep 3, 2020
c416882
Add test SBT project to CI
abgruszecki Sep 3, 2020
63c30b6
Add a small comment on how SBT calls us
abgruszecki Sep 3, 2020
55daf7a
Update back to the newest version of SBT
abgruszecki Sep 23, 2020
b76f414
Merge pull request #162 from lampepfl/sbt-protoplugin
abgruszecki Sep 28, 2020
3839f6e
Support for function, tuple and polyfunction literals
pikinier20 Sep 28, 2020
7ecdb68
Support for type operators
pikinier20 Sep 28, 2020
38a33c0
Do not get start/end of not-existing pos
abgruszecki Sep 28, 2020
707eef9
Merge pull request #177 from lampepfl/fix-valid-pos
abgruszecki Sep 28, 2020
c46d7d7
Cleanup comment code
abgruszecki Sep 11, 2020
a6c5094
Add comment parsing tests
abgruszecki Sep 11, 2020
87f34f3
Fix whitespace issue in code blocks
abgruszecki Sep 11, 2020
75f94da
Fix Uncyclo list test
abgruszecki Sep 11, 2020
41fba61
Merge pull request #165 from lampepfl/comment-parser-tests
abgruszecki Sep 28, 2020
85fd4a9
Filter super bridge methods and helpers for methods with default params
pikinier20 Sep 29, 2020
76b3ea0
Fix for showing empty sections and tabs
pikinier20 Sep 29, 2020
dcf0ded
Improve appearance of unresolved links
pikinier20 Sep 29, 2020
b0a80a8
Make all Scala snippets highlighted
abgruszecki Sep 29, 2020
1f63365
Add support for inferred links
abgruszecki Sep 28, 2020
ddbab8b
Fix spacing between Uncyclo-based paragraphs
abgruszecki Sep 29, 2020
1ce3198
Merge pull request #178 from lampepfl/filter-methods
abgruszecki Sep 29, 2020
58d193f
Merge pull request #173 from lampepfl/type-literals
abgruszecki Sep 29, 2020
69bced4
Merge pull request #179 from lampepfl/fix-scala-highlight
abgruszecki Sep 30, 2020
ac9dfca
Refactor doc link support
abgruszecki Sep 14, 2020
ec466c1
Remove commented-out code
abgruszecki Sep 17, 2020
8d66d31
Make only Uncyclo-style links supported in Md syntax
abgruszecki Sep 21, 2020
3851fb4
Add tests for Uncyclo link splitting
abgruszecki Sep 23, 2020
c81ede9
Remove leftover variable
abgruszecki Sep 30, 2020
9f167ac
Fix HTML layout
TheElectronWill Oct 1, 2020
b17439a
Fix warning in Main.scala
TheElectronWill Oct 1, 2020
901965a
Delete project/metals.sbt
TheElectronWill Oct 1, 2020
62f9120
Minor formatting/cleanup
TheElectronWill Oct 1, 2020
6dc0f21
Uncomment type literal testing
pikinier20 Oct 1, 2020
7b8288c
Merge pull request #183 from lampepfl/constant-type-test
pikinier20 Oct 1, 2020
9646d0b
Prettify a lambda
abgruszecki Oct 1, 2020
bb031e5
Merge pull request #180 from lampepfl/fix-wiki-par-spacing
abgruszecki Oct 1, 2020
7ef69dd
Merge pull request #182 from lampepfl/fix-html-ui
abgruszecki Oct 1, 2020
f0f0d52
"Fix" nested list rendering
abgruszecki Oct 1, 2020
84b0022
Merge pull request #166 from lampepfl/scaladoc-link-compat
abgruszecki Oct 1, 2020
8b12402
Merge pull request #185 from lampepfl/fix-nested-lists
TheElectronWill Oct 2, 2020
56c698b
Add support for common "at-sections" of Scaladoc
abgruszecki Oct 3, 2020
0eeedc6
Add CSS for params doc
abgruszecki Oct 3, 2020
b727366
Nest appropriate at-sections
abgruszecki Oct 4, 2020
5724289
Add an explanatory comment to potentially unsafe code
abgruszecki Oct 5, 2020
c832f1d
Merge pull request #172 from lampepfl/autolinks
abgruszecki Oct 5, 2020
16364a4
Define custom TagWrappers by inheriting from sealed Kotlin class
abgruszecki Oct 6, 2020
263b82c
Remove givens from inherited methods section
pikinier20 Oct 6, 2020
25639a3
Merge pull request #196 from lampepfl/minor-bugfixes
abgruszecki Oct 7, 2020
47b367f
Merge pull request #184 from lampepfl/at-tags
romanowski Oct 7, 2020
8fc6dc6
Adjust companion link
abgruszecki Oct 2, 2020
d5c9543
Extend pages with inherited members (only methods before)
pikinier20 Oct 8, 2020
3cc19f8
Add members from implicit conversions and extensions. Extend packages…
pikinier20 Sep 28, 2020
48f81c8
Fix constructor checks
abgruszecki Oct 9, 2020
d371373
Merge pull request #199 from lampepfl/inherited-members
abgruszecki Oct 9, 2020
03ae7a1
Merge pull request #194 from lampepfl/implicit-members
abgruszecki Oct 9, 2020
cdb3856
Remove hack for checking if method is an extension
pikinier20 Oct 12, 2020
a2c6775
Merge pull request #192 from lampepfl/adjust-companion-link
abgruszecki Oct 12, 2020
1a15594
Fully interactive hierarchy diagram
BarkingBad Oct 6, 2020
453ad30
Add colouring
BarkingBad Oct 13, 2020
dee0efd
Merge pull request #201 from lampepfl/extension-method-hack
abgruszecki Oct 15, 2020
950de42
Fix wrong rendering of diagram
pikinier20 Oct 15, 2020
b047e11
Merge pull request #207 from lampepfl/type-hierarchy
BarkingBad Oct 15, 2020
45e4fbc
Refactor documentable model in dokka
romanowski Oct 15, 2020
aa977b1
Implement frontend part of FilterView
zgrybus Oct 15, 2020
af893e9
Fix introduced problems
romanowski Oct 15, 2020
e9b5f95
Address review feedback and fix bugs
romanowski Oct 16, 2020
7a05a7c
Merge pull request #198 from lampepfl/filter-view
romanowski Oct 19, 2020
49067e6
Hide redundant type hierarchy diagram when there are no super and sub…
BarkingBad Oct 16, 2020
37b47b6
Merge pull request #209 from lampepfl/hide-redundant-diagrams
romanowski Oct 20, 2020
f0efc46
Permutate definitions to make Tasty happy
abgruszecki Oct 22, 2020
3a458e1
Merge pull request #214 from lampepfl/fix-tasty-exception
romanowski Oct 22, 2020
762f644
Update dokka to 1.4.10.2 and dokka site to 0.1.9
romanowski Oct 21, 2020
c883fe3
Migrate prject info single dir
romanowski Oct 22, 2020
09d63dd
Merge branch 'scala3doc' into scala3doc-migration
romanowski Oct 22, 2020
2ab2911
Modify gh actions for to adapt for scala3doc needs
romanowski Oct 22, 2020
cda7625
Tweak Scala3doc CI
abgruszecki Oct 23, 2020
3a28a7e
Tweak Scala3doc CI again
abgruszecki Oct 23, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ name: Dotty CI

on:
push:
paths-ignore:
- 'scala3doc/**' # Do not run everything on changes only in docs
pull_request:
paths-ignore:
- 'scala3doc/**' # Do not run everything on changes only in docs
schedule:
- cron: '0 3 * * *' # Every day at 3 AM

Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/scala3doc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: scala3doc CI
on:
push:
branches:
- master
pull_request:
jobs:

build:
runs-on: [self-hosted, Linux]
container: lampepfl/dotty:2020-04-24

# timeout-minutes: 20 We need much more for first run

steps:
- name: Set JDK 11 as default
run: echo "/usr/lib/jvm/java-11-openjdk-amd64/bin" >> $GITHUB_PATH

- uses: actions/checkout@v2
- run: git fetch --prune --unshallow --tags

- name: Cache Coursier
uses: actions/cache@v1
with:
path: ~/.cache/coursier
key: sbt-coursier-cache

- name: Cache SBT
uses: actions/cache@v1
with:
path: ~/.sbt
key: sbt-${{ hashFiles('**/build.sbt') }}

- name: Compile and test
run: cd scala3doc && sbt test

- name: Locally publish self
run: cd scala3doc && sbt publishLocal

- name: Generate test documentation
run: cd scala3doc && sbt generateSelfDocumentation

- name: Generate documentation with SBT plugin
run: cd scala3doc && sbt example-project/doc
40 changes: 40 additions & 0 deletions scala3doc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
*.class
*.log
libs/

# sbt specific
.cache
.history
.lib/
dist/*
target/
lib_managed/
src_managed/
project/boot/
project/plugins/project/

# Scala-IDE specific
.scala_dependencies
.worksheet
.bsp

# Intellij
.idea

#integration tests dir
/test-ws

# to test deploy
private-*
repo

.metals
metals.sbt
.bloop
.dotty-ide*

# custom things
output

.vscode

1 change: 1 addition & 0 deletions scala3doc/.scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = "2.6.3"
164 changes: 164 additions & 0 deletions scala3doc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# Scala3doc

Scala3doc (name subject to change) is the documentation tool for
[Dotty](https://github.com/lampepfl/dotty), which is scheduled to become
Scala 3. It's based on [Dokka](https://github.com/Kotlin/dokka), the
documentation tool for Kotlin. It uses Tasty-Reflect to access definitions,
which is an officially supported way to access Dotty's perspective of a
codebase.

We're aiming to support all the features Scaladoc did, plus new and exciting ones such as:

- Markdown syntax!
- displaying project and API documentation together on one site!
- and more!

## Running the project

Use the following commands to generate documentation for this project and for Dotty, respectively:

```
sbt generateSelfDocumentation
sbt generateDottyLibDocumentation
```

To actually view the documentation, the easiest way is to run the following in project root:

```
cd output
python3 -m http.server 8080
```

And afterwards point your browser to `http://localhost:8080/self` or
`http://localhost:8080/stdLib` for this project and for Dotty documentation
respectively.

It's not strictly necessary to go through an HTTP server, but because of CORS
the documentation won't work completely if you don't.

## Developing

At least two of our contributors use [Metals](https://scalameta.org/metals/) to
work on the project.

For every PR, we build documentation for Scala3doc and Dotty. For example, for
PR 123 you can find them at:

+ https://scala3doc.s3.eu-central-1.amazonaws.com/pr-123/self/main/index.html
+ https://scala3doc.s3.eu-central-1.amazonaws.com/pr-123/stdLib/main/index.html

Note that these correspond to the contents of `output` directory - that's
precisely what they are.

You can also find the result of building the same sites for latest `master` at:

+ https://scala3doc.s3.eu-central-1.amazonaws.com/pr-master/self/main/index.html
+ https://scala3doc.s3.eu-central-1.amazonaws.com/pr-master/stdLib/main/index.html

### Testing

Most tests rely on comparing signatures (of classes, methods, objects etc.) extracted from the generated documentation
to signatures found in source files. Such tests are defined using [MultipleFileTest](src/test/scala/dotty/dokka/MultipleFileTest.scala) class
and its subtypes (such as [SingleFileTest](src/test/scala/dotty/dokka/SingleFileTest.scala))

WARNING: As the classes mentioned above are likely to evolve, the description below might easily get out of date.
In case of any discrepancies rely on the source files instead.

`MultipleFileTest` requires that you specify the names of the files used to extract signatures,
the names of directories containing corresponding TASTY files
and the kinds of signatures from source files (corresponding to keywords used to declare them like `def`, `class`, `object` etc.)
whose presence in the generated documentation will be checked (other signatures, when missing, will be ignored).
The mentioned source files should be located directly inside `src/main/scala/tests` directory
but the file names passed as parameters should contain neither this path prefix nor `.scala` suffix.
The TASTY folders are expected to be located in `target/${dottyVersion}/classes/tests` (after successful compilation of the project)
and similarly only their names relative to this path should be provided as tests' parameters.
For `SingleFileTest` the name of the source file and the TASTY folder are expected to be the same.

By default it's expected that all signatures from the source files will be present in the documentation
but not vice versa (because the documentation can contain also inherited signatures).
To validate that a signature present in the source does not exist in the documentation
(because they should be hidden from users) add `//unexpected` comment after the signature in the same line.
This will cause an error if a signature with the same name appears in the documentation
(even if some elements of the signature are slightly different - to avoid accidentally passing tests).
If the signature in the documentation is expected to slightly differ from how it's defined in the source code
you can add a `//expected: ` comment (also in the same line and followed by a space) followed by the expected signature.
Alternatively you can use `/*<-*/` and `/*->*/` as opening and closing parentheses for parts of a signature present in the source but undesired in the documentation (at least at the current stage of development), e.g.

```
def foo/*<-*/()/*->*/: Int
```

will make the expected signature be

```
def foo: Int
```

instead of

```
def foo(): Int
```


Because of the way how signatures in source are parsed, they're expected to span until the end of a line (including comments except those special ones mentioned above, which change the behaviour of tests) so if a definition contains an implementation, it should be placed in a separate line, e.g.

```
def foo: Int
= 1

class Bar
{
//...
}
```

Otherwise the implementation would be treated as a part of the signature.

## Roadmap

1. Publish an initial version of the tool together with an SBT plugin
1. Replace Dottydoc as the dedicated tool for documenting Dotty code

This includes:
+ supporting Dotty's doc pages
+ releasing together with Dotty as the dedicated documentation tool

1. Support all kinds of Dotty definition and generate documentation for the
standard library
1. Reach feature parity with Scaladoc

## Contributing

We're happy that you'd like to help us!

We have two issue labels you should take a look at: `good first issue` and
`self-contained`. First is easy pickings: you'll be able to contribute without
needing to dive too deep into the project. Second is reverse: it's an issue
that's you may find interesting, complex and self-contained enough that you can
continue chipping away at it without needing to worry too much about merge
conflicts.

To contribute to the project with your code, fork this repo and create a pull request from a fresh branch from there.
To keep the history of commits clean, make sure your commits are squashed into one
and all your changes are applied on top of the latest master branch (if not - rebase on it instead of merging it).
Make sure all the tests pass (simply run `sbt test` to verify that).

## FAQ

### Why depend on Dokka?

We have two primary reasons for depending on Dokka. One of them is division of
labour - Dokka already has a team of maintainers, and it supports an excellent
API which already allowed us to quite easily generate documentation with it. By
depending on Dokka, we will be able to share a large portion of the maintenance
burden. The second reason is very pragmatic - on our own, it'd be difficult for
us to reach even feature parity with Scaladoc, simply because of workforce
constraints. Meanwhile, Dokka maintainers from VirtusLab reached out to us with
an offer of help, which we were happy to take.

### Why use TASTy?

A documentation tool needs to access compiler information about the project - it
needs to list all definitions, resolve them by name, and query their members.
Tasty Reflect is the dedicated way in Scala 3 of accessing this information.
75 changes: 75 additions & 0 deletions scala3doc/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// re-expose subproject settings
val `example-project` = ExampleProject.`example-project`

val dottyVersion = "0.27.0-RC1"
val dokkaVersion = "1.4.10.2"
val flexmarkVersion = "0.42.12"
val jacksonVersion = "2.9.8"
val scalaTagsVersion = "0.9.1"
val dokkaSiteVersion = "0.1.9"

libraryDependencies ++= Seq(
"org.jetbrains.dokka" % "dokka-test-api" % dokkaVersion % "test", // TODO move testing utils to dokka-site
"com.virtuslab.dokka" % "dokka-site" % dokkaSiteVersion,

"ch.epfl.lamp" %% "dotty-tasty-inspector" % dottyVersion,
"ch.epfl.lamp" %% "dotty-compiler" % dottyVersion,
"ch.epfl.lamp" %% "dotty-library" % dottyVersion,
"org.scala-sbt" % "io_2.13" % "1.3.4",

"com.vladsch.flexmark" % "flexmark-all" % flexmarkVersion,
"com.lihaoyi" % "scalatags_2.13" % scalaTagsVersion,
"nl.big-o" % "liqp" % "0.6.7",
"args4j" % "args4j" % "2.33",
"com.novocode" % "junit-interface" % "0.11" % "test",
)

resolvers += Resolver.jcenterRepo
resolvers += Resolver.bintrayRepo("kotlin", "kotlin-dev")
resolvers += Resolver.bintrayRepo("virtuslab", "dokka")
resolvers += Resolver.mavenLocal

lazy val root = project
.in(file("."))
.settings(
name := "scala3doc",
version := "0.1.1-SNAPSHOT",
scalaVersion := dottyVersion
)

val generateSelfDocumentation = inputKey[Unit]("Generate example documentation")
generateSelfDocumentation := {
run.in(Compile).fullInput(" -o output/self -t target/scala-0.27/classes -d documentation -n scala3doc -s src/main/scala=https://github.com/lampepfl/scala3doc/tree/master/src/main/scala#L").evaluated // TODO #35 proper sbt integration
}

// Uncomment to debug dokka processing (require to run debug in listen mode on 5005 port)
// javaOptions.in(run) += "-agentlib:jdwp=transport=dt_socket,server=n,address=localhost:5005,suspend=y"

fork.in(run) := true
// There is a bug in dokka that prevents parallel tests withing the same jvm
fork.in(test) := true
Test / parallelExecution := false

scalacOptions in Compile += "-language:implicitConversions"

Compile / mainClass := Some("dotty.dokka.Main")

// hack, we cannot build documentation so we need this to publish locally
publishArtifact in (Compile, packageDoc) := false

// TODO #35 proper sbt integration
val generateDottyLibDocumentation = taskKey[Unit]("Generate documentation for dotty lib")
generateDottyLibDocumentation := Def.taskDyn {
val dotttyLib = fullClasspath.in(Compile).value.find{ a =>
val info = a.get(moduleID.key)
info.nonEmpty &&
info.get.organization == "ch.epfl.lamp" &&
info.get.name.startsWith("dotty-library")
}
if (dotttyLib.isEmpty) Def.task {
streams.value.log.error("Dotty lib wasn't found")
} else Def.task {
run.in(Compile).toTask(s" -o output/stdLib -t ${dotttyLib.get.data} -d dotty-docs/docs -n dotty-lib -s library/src=https://github.com/lampepfl/dotty/tree/master/library/src#L").value
}
}.value

1 change: 1 addition & 0 deletions scala3doc/documentation/docs/index.md
27 changes: 27 additions & 0 deletions scala3doc/documentation/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Scala3doc

**Documentation tool for Scala 3**

We are using [TASTy](https://github.com/lampepfl/dotty/blob/master/tasty/src/dotty/tools/tasty/TastyFormat.scala) to generate documentation. We aim to has all known and loved feature from scaladoc as well as new feature such as :

- integrated documentation and API
- has option for basic pluggablity
- and much more

**Yes, this page was generated using scala3doc**

You can learn more from out [documentation](scala3doc/index.html).

## Getting started

For now the recommended way to try out our project would be:
- Clone our [repository](https://github.com/lampepfl/scala3doc)
- Run `sbt main -n <name> -o <output> -t <tasty-files> -cp <classpath> -s { <sources> } ` where
- `<name>`: name of module in generated documentation
- `<output>`: location where documentation should be created
- `<tasty-files>`: is list of dirs or jars that contains tasty files that should be documented
- `<classpath>`: classpath that was used to generate tasty files
- `<sources>`: links to source files of module that are used to link symbols on pages to their source file. They need to be supplied in form:
local_dir=remote_dir#line_suffix e.g. src/main/scala=https://github.com/lampepfl/scala3doc/tree/master/src/main/scala#L

We also support `-d <documentation>` argument to provide static documentation. You can find more about that feature [here](static-page.html).
6 changes: 6 additions & 0 deletions scala3doc/dotty-docs/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Jekyll specific ignores
vendor/
.bundle/
Gemfile.lock
_site/
.sass-cache/
Loading