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 setting at least the template, possibly other options, from the CLI #1816

Open
fperez opened this issue Jan 25, 2025 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@fperez
Copy link

fperez commented Jan 25, 2025

For me, two use cases motivate this proposal:

  1. Easy experimentation with different templates without having to edit the source md/ipynb files. This is particularly useful in the case of using myst to generate output PDF from single source file. I have been very successfully using it to replace LaTeX lately, and I think easy experimentation at the CLI is part of making such a workflow as fluid a possible.
  2. Batch conversion of (potentially many) md/ipynb files into PDF. Concretely, at Berkeley we have use cases where we want to have easy ways for student work done in notebooks that they can get as a PDF very easily, and without having to learn much about myst/yaml/etc, as that's not the point of most courses. We want

Proposal

I suggest supporting a --template option at the CLI that lets the template be specified at the CLI.

It could also be useful to allow for --template-options to take a string with additional options, but at that point the complexity may not be worth it, and it may be best to keep it at just the basic template choice, with further customization being done via frontmatter or myst.yml file. So I'm less sure about this addition, but pretty convinced the basic ``--template` would be valuable.

Additional notes

Original discussion on discord

@fperez fperez added the enhancement New feature or request label Jan 25, 2025
@choldgraf
Copy link
Collaborator

I wonder if there's some way we could support arbitrary CLI overrides for myst.yml. there must be other patterns out there for this for yaml-based config

@fperez
Copy link
Author

fperez commented Jan 27, 2025

The nesting makes it complex, as for a purely generic override mechanism you probably would want to have something like --myst-override= and then pass either a custom yaml file for that section or an inline yaml/json block (which is horrible in a single line at the shell prompt).

For that case, I suggest instead looking at #1817 (with potential inheritance/override patterns). I would keep this a bit more pragmatic and focus on a few widely used cases that are justified by concrete needs, leaving the arbitrary complexity contained into a custom file. Yaml/json aren't really CLI friendly formats, is my basic take.

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

No branches or pull requests

2 participants