Support Quarto callouts: collapse to details, callout-* headings out of TOC - #63
Closed
RensDimmendaal wants to merge 1 commit into
Closed
Support Quarto callouts: collapse to details, callout-* headings out of TOC#63RensDimmendaal wants to merge 1 commit into
RensDimmendaal wants to merge 1 commit into
Conversation
RensDimmendaal
commented
Sep 7, 2026
|
|
||
| ```html | ||
| <dl><dt id="def-mdhtml">MDHTML</dt><dd>HTML for Markdown-oriented documents.</dd></dl><div id="tip-box" class="callout" data-kind="tip"><h3>A fenced div</h3><p>Normal <strong>Markdown</strong> lives here.</p></div> | ||
| <dl><dt id="def-mdhtml">MDHTML</dt><dd>HTML for Markdown-oriented documents.</dd></dl><div id="card-1" class="card" data-kind="sample"><h3>A fenced div</h3><p>Normal <strong>Markdown</strong> lives here.</p></div> |
Contributor
Author
There was a problem hiding this comment.
I rewrote this example to avoid confusion with the dialect's real callouts.
RensDimmendaal
commented
Sep 7, 2026
| @@ -1,5 +1,5 @@ | |||
| /* Demo stylesheet for the attributes sample.md passes through: run | |||
| `viewmd sample.md --head sample.css --head sample.js` from examples/. | |||
| `viewmd sample-render.md --head sample.css --head sample.js` from examples/. | |||
Contributor
Author
There was a problem hiding this comment.
I believe this is the right command to see the pairs of raw codefences with their rendered examples.
Contributor
|
Reimplemented this locally with some refactoring. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds Quarto-style callouts to the dialect. They are common in nbdev docs and also supported by github flavored markdown (GFM).
Quarto's collapsible callouts (
::: {.callout-note collapse="true"}) are common in nbdev docs, but were not handled explicitly. They were directly converted into.callout-*classes. On top of that the headers inside them appeared in the table of contents, see:After this PR:
With them being an explicit part of the dialect it also becomes easier to do the GFM style export:
Note
like this:
Excluded:
title="..."as the label in the ::: block. Quarto supports this, but I think it's easier to leave out. nbdev only uses the header syntax inside the block.> [!NOTE],<details>). This will be a follow-up PR where we add a mdhtml2gfm exporter (insteadof the current md2gfm).