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

Margin directive #516

Closed
rowanc1 opened this issue Aug 2, 2023 · 1 comment
Closed

Margin directive #516

rowanc1 opened this issue Aug 2, 2023 · 1 comment

Comments

@rowanc1
Copy link
Collaborator

rowanc1 commented Aug 2, 2023

JupyterBook allows for margin/sidebar directives (docs). We should have something similar in myst.

Currently we do have a grid system that is defined here:
https://executablebooks.github.io/myst-theme/?path=/docs/components-grid-system--docs

This allows you to add classes, for example to figures to show them in the margins:

:::{figure} images/dc-setup.png
:width: 90%
:class: col-margin-right

Setup of a DC resistivity survey.
:::

image

To do this we would create a directive:

  • There is a start of the directive here. I think it is probably complete actually.
  • We need to add an HTML renderer for the directive, similar to the iframe at least as a way to start. We will need to export that and put it into the default renderers so it is picked up.
  • The theme should be an <aside> and classes should be col-margin-right probably with zero height h-0 and allow the content to overflow. This should only have zero-height at large enough screen sizes (I think like lg:h-0) as the right margin collapses into the body content on smaller screens.
  • Once that is done, I think it will be some more tweaking and start adding out any other options in the directive if there are any!

cc @Jan-David-Black

@rowanc1
Copy link
Collaborator Author

rowanc1 commented Mar 26, 2024

This has been added in #1012.

@rowanc1 rowanc1 closed this as completed Mar 26, 2024
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

No branches or pull requests

1 participant