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

Support footnotes in markdown text #940

Closed
tgy opened this issue Feb 29, 2024 · 11 comments · Fixed by #965
Closed

Support footnotes in markdown text #940

tgy opened this issue Feb 29, 2024 · 11 comments · Fixed by #965
Assignees
Labels
enhancement New feature or request

Comments

@tgy
Copy link

tgy commented Feb 29, 2024

Notebooks often need to omit details in the main text, but these details still need to be there somewhere. Footnotes are a perfect way to achieve this.

markdown-it does support footnotes. What's stopping us from having them in our Observable Framework notebooks? :)

Bonus point would be to have the possibility to have the footnotes on the right side of the notebook, or have them appear on mouseOver.

@tgy tgy added the enhancement New feature or request label Feb 29, 2024
@Fil
Copy link
Contributor

Fil commented Feb 29, 2024

Are you thinking about this plugin? https://github.com/markdown-it/markdown-it-footnote

@tgy
Copy link
Author

tgy commented Feb 29, 2024

@Fil yes exactly!

@Fil
Copy link
Contributor

Fil commented Feb 29, 2024

If you want to play with this, MarkdownIt is called here with one plugin (markdown-it-anchor): https://github.com/observablehq/framework/blob/main/src/markdown.ts#L424

@mbostock
Copy link
Member

Maybe we could have a way to register markdown-it plugins in the config file?

@huw
Copy link
Contributor

huw commented Mar 4, 2024

👍 to custom markdown-it plugins, that would make supporting Wikilinks a lot easier. And other non-standard but common Markdown extensions like $ for TeX blocks.

@mbostock mbostock self-assigned this Mar 4, 2024
@Fil
Copy link
Contributor

Fil commented Mar 4, 2024

After #965 you can install the markdown-it-footnote manually, and tweak the styles to make it look good. We're also reporting good results with markdown-it-container.

@Fil Fil reopened this Mar 4, 2024
@tgy
Copy link
Author

tgy commented Jun 9, 2024

Works like a charm! Thanks a lot for addressing this feature request. @Fil Why did you re-open the issue?

@Fil
Copy link
Contributor

Fil commented Jun 9, 2024

I thought maybe something was missing… the emoji arrows don't look too good, do they?

@Fil Fil closed this as completed Jun 9, 2024
@tgy
Copy link
Author

tgy commented Jun 9, 2024

Which emoji arrows? This is what I have
image

@mbostock
Copy link
Member

mbostock commented Jun 9, 2024

It looks fine in macOS Safari, but in Chrome it renders as:

Screenshot 2024-06-09 at 2 04 03 PM

One probably needs to use the VS15 variation selector to prevent emoji presentation. I assume that’s an option with the markdown-it-footnote plugin?

Edit: Looks like markdown-it-footnote already uses VS15, so it’s just Chrome that’s ignoring it. 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
4 participants