The Scaladoc {{{...}}} code block syntax isn’t working
See original GitHub issueCompiler version
3.0.0-RC1, as well as the latest nightly build
Minimized code
/**
* Specify the `name`, `age`, and `weight` when creating a new `Person`,
* then access the fields like this:
*
* {{{
* val p = Person("Al", 42, 200.0)
* p.name
* p.age
* p.weight
* }}}
*
class Person (var name: String, var age: Int, var weight: Double)
Output
The {{{...}}}
text shows up in the Scaladoc, like this:
... the fields like this: {{{ val p = Person("Al", 42, 200.0) p.name p.age p.weight }}}
Expectation
I expected the code in the {{{...}}}
block to be displayed as multiple lines of PRE/CODE text in the resulting Scaladoc, like this:
val p = Person("Al", 42, 200.0)
p.name
p.age
p.weight
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (15 by maintainers)
Top Results From Across the Web
Scaladoc | Style Guide | Scala Documentation
Make code examples consistent with this guide. Use the wiki-style syntax instead of HTML wherever possible. Examples should use either full code listings...
Read more >lampepfl/dotty - scala - Gitter
code block syntax isn't working with the nightly build, so I'll report that as a bug. But everything else that I'm using looks...
Read more >Multiple line code example in Javadoc comment
While omitting the @code block (or using a <code> tag) will result in HTML like this: Set s; System.out.println(s);. For reference, a full...
Read more >On Scala 3's Optional Braces - Alexandru Nedelcu
But you can have code linters, or the compiler, to force that {} when ... My own website isn't able to correctly do...
Read more >Control Structures - Scala Cookbook, 2nd Edition [Book]
In Scala 3 the preferred syntax has changed, and now looks like this: ... multiple lines of code, perform the work in a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Would it be possible to support the old code blocks by default just like the wiki link syntax is supported by default? (cf https://dotty.epfl.ch/docs/usage/scaladoc/docComments.html, and related discussion in https://github.com/lampepfl/dotty/pull/11612)
Funnily enough, I think if we enable hybrid by default, we may actually fix some preexisting documentation. The docs for cats here have a list that is correct Markdown, but not correct Wiki; I’ve seen Markdown
_underscore_
syntax used in docs for Zio as well.