-
Notifications
You must be signed in to change notification settings - Fork 326
Blog Scaladoc tables #959
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
Blog Scaladoc tables #959
Conversation
Despite the branch name there is no part two. This is it! |
|
||
### A Simple Example | ||
|
||
The markdown for tables follows Github Markdown Flavored markdown with some restrictions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub Flavored Markdown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe include a link to https://github.github.com/gfm/ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
### GitHub Flavored Markdown Conformance | ||
|
||
Scaladoc tables support the [Github Flavored Markdown Spec Table Extension](https://github.github.com/gfm/#tables-extension-). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: GitHub
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
<img alt="Example Table 2" | ||
src="/resources/img/blog/scaladoc-tables/example-table-2.png"> | ||
|
||
Breaking content over several lines is not supported in GHFM tables. Use a `<br/>` tag or go with HTML tables if you have needs beyond the simple tables supported by GHFM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they prefer GFM for short: https://github.github.com/gfm/#what-is-github-flavored-markdown-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
### Including pipe (`|`) in content. | ||
|
||
Scala 2.12.8 supports the [escaping of the cell delimiter in cell content](https://github.com/scala/scala/pull/7247) with `\|`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added some notes.
ebd8896
to
105aa87
Compare
@Philippus All your comments have been addressed. Kindly review. |
Perhaps the post should say something, near the end, about what Scala 3 / Dotty supports or will support? |
This is how the above markdown renders, | ||
|
||
<img alt="Example Table 1" | ||
src="/resources/img/blog/scaladoc-tables/example-table-1.png"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jekyll supports an image syntax

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ashawley Thanks! Changes made to both images.
105aa87
to
fd7b2c6
Compare
@SethTisue If I can be supplied with the text I can add it now, otherwise I'll need to research it. |
This is exciting news and very good documentation, but maybe most of the material should be added to https://docs.scala-lang.org/overviews/scaladoc/for-library-authors.html The images don't render very well on this site, maybe they'll look better on docs.scala-lang.org? |
@ashawley - I'm happy to take some time and update https://docs.scala-lang.org/overviews/scaladoc/for-library-authors.html later. |
@ashawley Do you know how to turn off resizing of images? |
I looked, but couldn't figure it out. |
I don't intend to look into the |
It's a CSS issue with the new site, and not intrinsically a Jekyll issue. |
|
title: "Introducing Scaladoc Tables" | ||
--- | ||
|
||
Scala 2.12.7 adds support for markdown tables in Scaladoc comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it be added in 2.13? Library authors who cross-compile on 2.11 should avoid for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Library authors should only publish 2.12 docs or later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's been merged to 2.13.x IIRC. I feel advising not to use a feature that is only present from 2.12 onwards when cross compiling to 2.11 is overly prescriptive so I vote to not mention this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, doesn't seem like there's a reason to dissuade library authors, but maybe just mention that "library authors who use the table syntax will need to only publish from 2.12"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's been merged to 2.13.x IIRC
(it has, but after M5 was released)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ashawley I mentioned the graceful degradation forward compatibility with 2.11 in a new section.
fd7b2c6
to
364f2e4
Compare
@SethTisue I've gone dotty over dotty... |
|
||
### More Examples | ||
|
||
For a smorgasbord of examples take a look at [examples](http://janekdb.github.io/scala/PR-7247/scala/test/scaladoc/tables/code/index.html). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quite an expensive rookworst :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3942586
to
9a59e12
Compare
@SethTisue @ashawley @Philippus - All changes addressed. Last change was to fix up some wonky wording in the Scala 2.11 and dotty sections. All done. Ready for review. |
|
||
### Dotty and Scala 3 | ||
|
||
With `dotty` now boosting it's share of the development horizon it's important to place GFM into a [dottydoc](https://dotty.epfl.ch/docs/usage/dottydoc.html) and hence Scaladoc 3 context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its share
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
With `dotty` now boosting it's share of the development horizon it's important to place GFM into a [dottydoc](https://dotty.epfl.ch/docs/usage/dottydoc.html) and hence Scaladoc 3 context. | ||
|
||
In overview `dottydoc` supports the currrent Scaladoc 2.12 MediaWiki flavored markdown, but it also supports more contemporary flavors of markdown. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: currrent -> current
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
Within the realm of tables markdown `dottydoc` supports some extensions via the [flexmark-java table extension](https://github.com/vsch/flexmark-java/wiki/Tables-Extension). | ||
|
||
[flexmark-java](https://github.com/vsch/flexmark-java) allow tables to be defined using a more expressive variant of GFM table markdown. Tables you create now will have a route to being reused for `dottydoc` API documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
9a59e12
to
f26ef4b
Compare
@Philippus All requested changes made. |
|
||
### A Simple Example | ||
|
||
The markdown for tables follows [GitHub Markdown Flavored Markdown](https://github.github.com/gfm/) with some restrictions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub Flavored Markdown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix pushed
f26ef4b
to
cb245d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work! ty
@Philippus Thanks for review comments. @SethTisue - No pending review comments. |
cb245d3
to
974c65b
Compare
Pushed one more fix |
Yay! |
No description provided.