question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The Scaladoc {{{...}}} code block syntax isn’t working

See original GitHub issue

Compiler 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:closed
  • Created 3 years ago
  • Comments:17 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
smartercommented, Mar 15, 2021

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)

1reaction
abgruszeckicommented, Mar 17, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found