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

Add markdown presenter #19

Closed
bollwyvl opened this issue Oct 22, 2022 · 1 comment · Fixed by #32
Closed

Add markdown presenter #19

bollwyvl opened this issue Oct 22, 2022 · 1 comment · Fixed by #32
Labels
enhancement New feature or request

Comments

@bollwyvl
Copy link
Contributor

Elevator Pitch

Add a basic presenter for markdown slides viewed in the Markdown Preview activity.

Motivation

.md files should make fine slides.

Design Ideas

The specs for markdown and commonmark allow for several syntaxes for horizontal rules, and these are commonly used for tools such as marp and others.

Without supporting all the features, we can probably fiat hrs (written with ---) as slides. The ~ operator can be used to select stuff between multiple as-rendered hr elements.

@bollwyvl bollwyvl added the enhancement New feature or request label Oct 22, 2022
@bollwyvl
Copy link
Contributor Author

bollwyvl commented Nov 1, 2022

To expand on the above, given the id of the markdown viewer widget:

Or, once the presenter gets to work

body[data-jp-deck-mode="presenting"] :not(.lm-mod-hidden) .jp-MarkdownViewer > * {
  display: none;  // or equivalent
}
body[data-jp-deck-mode="presenting"] :not(.lm-mod-hidden) .jp-MarkdownViewer hr:nth-of-type(1) ~ :not(hr:nth-of-type(2) ~ *):not(hr)') {
  display: block; // or equivalent
}

This could be tightened up by annotating the leading hr element with .e.g jp-deck-mod-onscreen, so that the CSS isn't changing as frequently, though it will be a full repaint anyway when changing the classes.

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

Successfully merging a pull request may close this issue.

1 participant