Skip to content
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

Scaladoc: add Wiki code blocks to Md syntax #11833

Merged
merged 1 commit into from
Mar 23, 2021

Conversation

abgruszecki
Copy link
Contributor

The idea here is that in the wild, the parts of Wiki syntax that are the most
used are lists, code blocks, monospace text, and links. With this PR we now
more-or-less support all of them in Markdown syntax, which means that one will
be able to use it for old doc comments and get acceptable-looking output.

The idea here is that in the wild, the parts of Wiki syntax that are the most
used are lists, code blocks, monospace text, and links. With this PR we now
more-or-less support all of them in Markdown syntax, which means that one will
be able to use it for old doc comments and get acceptable-looking output.
@abgruszecki
Copy link
Contributor Author

@romanowski this was an idea suggested by @smarter. I think it's a bit of a hack, but I looked through a bunch of docs of community projects and it really seems like with this PR, we can parse them reasonably even with the default syntax set to Markdown.

See #11728 (comment) and below for discussion about the idea.
See https://scala3doc.virtuslab.com/pr-wiki-code-for-md/testcases/api/tests.html for the rendered version of the test docstring.

@abgruszecki abgruszecki marked this pull request as ready for review March 21, 2021 18:32
@abgruszecki abgruszecki requested a review from romanowski March 21, 2021 18:32
@abgruszecki
Copy link
Contributor Author

For clarity: the changes to Scaladoc code are minimal. The parser for Wiki code blocks was adapted from Flexmark code: https://github.com/vsch/flexmark-java/blob/master/flexmark/src/main/java/com/vladsch/flexmark/parser/core/FencedCodeBlockParser.java#L23.

@romanowski romanowski merged commit ecceb15 into scala:master Mar 23, 2021
@romanowski romanowski deleted the scaladoc/wiki-code-for-md branch March 23, 2021 19:23
odersky pushed a commit to dotty-staging/dotty that referenced this pull request Mar 24, 2021
…for-md

Scaladoc: add Wiki code blocks to Md syntax
@BarkingBad BarkingBad mentioned this pull request May 11, 2021
2 tasks
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants