Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before I go to much further I wanted to throw this up here to make sure the direction was ok. Mainly there are a few key differences between
tutandmdocthat you'll see right away, but the main one is the following:In the above, this will compile fine with
tutwhereas even if you have two separate code blocks in a page like so:This will not compile with mdoc as the document is combined and compiled as a normal Scala program. There are a couple workarounds for this.
mdoc:nestwhich will wrap the code blocks inscala.Predef.locally{...}so the above wouldn't be an issue.mdoc:resetwhich will reset everything so again you could redefine a variable. Oftennestis recommended to still keep the imports that may have been defined earlier for further blocks.From the handful of them that I've done so far in
_baI don't really think the usage of:nestor:resetwill matter that much mostly because there isn't a lot of imports like you'd normally see in a library using this for their docs. Or, is some cases each block already includes the imports so they can stand alone. There is a chance depending on the document that I would use:nestis some places and:resetin others. If the direction of this looks fine, I'll continue on as I have been.When finished this will close #1815