mdoc
mdoc copied to clipboard
Feature Request: Compiled inline code (single backtick)
Goal: If I have this in my markdown file
```scala mdoc
def badlyNamedFunction() = ???
```
Users should call `scala mdoc badlyNamedFunction`, then blah blah...
And later I rename badlyNamedFunction
to perfectlyNamedFunction
, then mdoc would error out and alert me that the function/val/class/etc was not found.
Since showing output would be impractical in all but the simplest cases, the default behavior would be mdoc:compile-only
.
It will protect our in-line code from the most egregious breakages, and not confuse paragraphs by trying to cram output in them. If you want to see output, use a stand-alone fence.
I think the most valuable modifiers are simply fail
and warn
.
Open Questions
- How do we smoothly handle "a pure expression does nothing" warnings? I expect they will be very common running the standard compiler against these fragments.
- Is the current
scala mdoc
prefix too verbose for this context? We could shorten it to justmdoc
for example, since we don't need to provide the standard language header like we do in fences.