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

Expose overrides as a cli flag #32

Open
matklad opened this issue Jan 10, 2023 · 3 comments
Open

Expose overrides as a cli flag #32

matklad opened this issue Jan 10, 2023 · 3 comments

Comments

@matklad
Copy link
Contributor

matklad commented Jan 10, 2023

#4 added an ability to customize html rendering. It only added programmatic API, but we should expose this as a CLI as well.

I think a good name for the flag would be --html-template slides.js (might also rename "overrides" to "template" in the API).

@jgm
Copy link
Owner

jgm commented Jan 10, 2023

The concept of a "template" is used in pandoc (and many other places) for something that would get filled by the fragment created by renderHTML to produce a "standalone" document. See the User's Guide In pandoc these templates can have variables that are filled, e.g., by metadata or programatically. I think it would be confusing to use the name "template" for this different thing, so I'd prefer to stick with "overrides" (or maybe there's a better name).

@jgm
Copy link
Owner

jgm commented Jan 10, 2023

Note that you can take advantage of pandoc's templates already:

djot -t pandoc | pandoc -f json -s --metadata title="Foo bar" --metadata author="You" -o my.html

should give you nice output.

@matklad
Copy link
Contributor Author

matklad commented Jan 10, 2023

I think it would be confusing to use the name "template" for this different thing, so I'd prefer to stick with "overrides" (or maybe there's a better name).

On the one hand, yes, on the other hand, I feel like overrides are not that different, as they are a generalization of the idea. Pandoc's template is an an override for the root doc element essentially.

From another angle, asciidoctor-web is using --template-require argument for this same thing: https://github.com/Mogztter/asciidoctor-web-pdf#custom-layout.

No super-strong opinion here. An obvious solution is to expose --overrides cli flag and punt on the naming for now.

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

2 participants