Skip to content

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

Merged
merged 1 commit into from
Oct 4, 2018

Conversation

janekdb
Copy link
Member

@janekdb janekdb commented Oct 3, 2018

No description provided.

@janekdb janekdb requested a review from SethTisue October 3, 2018 11:35
@janekdb
Copy link
Member Author

janekdb commented Oct 3, 2018

Despite the branch name there is no part two. This is it!

@janekdb janekdb mentioned this pull request Oct 3, 2018
28 tasks

### A Simple Example

The markdown for tables follows Github Markdown Flavored markdown with some restrictions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub Flavored Markdown

Copy link
Member

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/ ?

Copy link
Member Author

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-).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: GitHub

Copy link
Member Author

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

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 `\|`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will support

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@Philippus Philippus left a 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.

@janekdb janekdb force-pushed the topic/scaladoc-tables-part-one branch from ebd8896 to 105aa87 Compare October 3, 2018 15:52
@janekdb
Copy link
Member Author

janekdb commented Oct 3, 2018

@Philippus All your comments have been addressed. Kindly review.

@SethTisue
Copy link
Member

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">
Copy link
Member

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

![Example Table 1](/resources/img/blog/scaladoc-tables/example-table-1.png)

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.

@janekdb janekdb force-pushed the topic/scaladoc-tables-part-one branch from 105aa87 to fd7b2c6 Compare October 3, 2018 16:10
@janekdb
Copy link
Member Author

janekdb commented Oct 3, 2018

Perhaps the post should say something, near the end, about what Scala 3 / Dotty supports or will support?

@SethTisue If I can be supplied with the text I can add it now, otherwise I'll need to research it.

@ashawley
Copy link
Member

ashawley commented Oct 3, 2018

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?

@janekdb
Copy link
Member Author

janekdb commented Oct 3, 2018

@ashawley - I'm happy to take some time and update https://docs.scala-lang.org/overviews/scaladoc/for-library-authors.html later.

@janekdb
Copy link
Member Author

janekdb commented Oct 3, 2018

This is how the image looks using the docker command, Image scaling appears to be present which I'm guessing is controlled by jekyll. The images seem okay for the level of the communique!

image

@ashawley
Copy link
Member

ashawley commented Oct 3, 2018

The first one was the one I was more concerned with:

screen shot 2018-10-03 at 12 30 53 pm

@janekdb
Copy link
Member Author

janekdb commented Oct 3, 2018

@ashawley Do you know how to turn off resizing of images?

@ashawley
Copy link
Member

ashawley commented Oct 3, 2018

I looked, but couldn't figure it out.

@janekdb
Copy link
Member Author

janekdb commented Oct 3, 2018

I don't intend to look into the jekyll image control so reviewers please list any further changes required.

@ashawley
Copy link
Member

ashawley commented Oct 3, 2018

It's a CSS issue with the new site, and not intrinsically a Jekyll issue.

@SethTisue
Copy link
Member

If I can be supplied with the text I can add it now, otherwise I'll need to research it.

see
scala/scala#6043 (comment)

title: "Introducing Scaladoc Tables"
---

Scala 2.12.7 adds support for markdown tables in Scaladoc comments.
Copy link
Member

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?

Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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"?

Copy link
Member

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)

Copy link
Member Author

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.

@janekdb janekdb force-pushed the topic/scaladoc-tables-part-one branch from fd7b2c6 to 364f2e4 Compare October 3, 2018 18:29
@janekdb
Copy link
Member Author

janekdb commented Oct 3, 2018

@SethTisue I've gone dotty over dotty...

image


### 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).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quite an expensive rookworst :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rookworsts on me!

image

Not actually me.

@janekdb janekdb force-pushed the topic/scaladoc-tables-part-one branch 2 times, most recently from 3942586 to 9a59e12 Compare October 4, 2018 10:26
@janekdb
Copy link
Member Author

janekdb commented Oct 4, 2018

@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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its share

Copy link
Member Author

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: currrent -> current

Copy link
Member Author

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allows

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@janekdb janekdb force-pushed the topic/scaladoc-tables-part-one branch from 9a59e12 to f26ef4b Compare October 4, 2018 11:28
@janekdb
Copy link
Member Author

janekdb commented Oct 4, 2018

@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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub Flavored Markdown

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix pushed

@janekdb janekdb force-pushed the topic/scaladoc-tables-part-one branch from f26ef4b to cb245d3 Compare October 4, 2018 11:36
Copy link
Member

@Philippus Philippus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work! ty

@janekdb
Copy link
Member Author

janekdb commented Oct 4, 2018

@Philippus Thanks for review comments.

@SethTisue - No pending review comments.

@janekdb janekdb force-pushed the topic/scaladoc-tables-part-one branch from cb245d3 to 974c65b Compare October 4, 2018 11:51
@janekdb
Copy link
Member Author

janekdb commented Oct 4, 2018

Pushed one more fix
Within the realm of tables markdown -> Within the realm of table markdown

@SethTisue SethTisue merged commit dff9fb9 into scala:master Oct 4, 2018
@SethTisue
Copy link
Member

@janekdb
Copy link
Member Author

janekdb commented Oct 4, 2018

Yay!

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.

5 participants