Skip to content
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

Feature Request: Compiled inline code (single backtick) #544

Open
swoogles opened this issue Aug 12, 2021 · 0 comments · May be fixed by #554
Open

Feature Request: Compiled inline code (single backtick) #544

swoogles opened this issue Aug 12, 2021 · 0 comments · May be fixed by #554

Comments

@swoogles
Copy link

swoogles commented Aug 12, 2021

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

  1. 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.
  2. Is the current scala mdoc prefix too verbose for this context? We could shorten it to just mdoc for example, since we don't need to provide the standard language header like we do in fences.
@swoogles swoogles linked a pull request Aug 29, 2021 that will close this issue
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 a pull request may close this issue.

1 participant