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 format-independent options noDefaults and plain, which control the loading of theme witiko/markdown/defaults #393

Closed
Witiko opened this issue Jan 4, 2024 · 0 comments · Fixed by #394
Labels
context Related to the ConTeXt interface and implementation latex Related to the LaTeX interface and implementation plaintex Related to the plain TeX interface and implementation themes Related to Markdown themes
Milestone

Comments

@Witiko
Copy link
Owner

Witiko commented Jan 4, 2024

In PRs #373 and #392, we separated the default token renderer definitions into a universal theme witiko/markdown/defaults. In LaTeX, we can prevent the execution of the default definitions for LaTeX and only load the default definitions for plain TeX using the LaTeX option plain. However, there is no option to prevent loading any definitions altogether. Furthermore, the option plain is not available for other formats based on plain TeX such as ConTeXt.

Tasks

  • Move the LaTeX option plain from LaTeX to plain TeX and react to it from ConTeXt theme witiko/markdown/defaults.
  • Add new plain TeX option noDefaults and react to it from plain TeX and LaTeX.

Examples

Option noDefaults

Plain TeX example

A plain TeX document that prevents the theme witiko/markdown/defaults from being loaded.

\def\markdownOptionNoDefaults{true}
\input markdown
\markdownBegin
Hello *world*!
\markdownEnd
\bye

Expected output: Hello !

LaTeX example

A LaTeX document that prevents the theme witiko/markdown/defaults from being loaded.

\documentclass{article}
\usepackage[noDefaults]{markdown}
\begin{document}
\begin{markdown}
Hello *world*!
\end{markdown}
\end{document}

Expected output: Hello !

ConTeXt example

A ConTeXt document that prevents the theme witiko/markdown/defaults from being loaded.

\def\markdownOptionNoDefaults{true}
\startluacode
local kpse = require("kpse")
kpse.set_program_name("luatex")
\stopluacode
\usemodule[t][markdown]
\starttext
\startmarkdown
Hello *world*!
\stopmarkdown
\stoptext

Expected output: Hello !

Option plain

LaTeX example

A LaTeX document that prevents the plain TeX part of theme witiko/markdown/defaults from being loaded.

\documentclass{article}
\usepackage[plain]{markdown}
\begin{document}
\begin{markdown}
- foo
- bar
- baz
\end{markdown}
\end{document}

Expected output: foobarbaz

ConTeXt example

A ConTeXt document that prevents the plain TeX part of the theme witiko/markdown/defaults from being loaded.

\def\markdownOptionPlain{true}
\startluacode
local kpse = require("kpse")
kpse.set_program_name("luatex")
\stopluacode
\usemodule[t][markdown]
\starttext
\startmarkdown
- foo
- bar
- baz
\stopmarkdown
\stoptext

Expected output: foobarbaz

@Witiko Witiko added plaintex Related to the plain TeX interface and implementation latex Related to the LaTeX interface and implementation context Related to the ConTeXt interface and implementation themes Related to Markdown themes labels Jan 4, 2024
@Witiko Witiko added this to the 3.4.0 milestone Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context Related to the ConTeXt interface and implementation latex Related to the LaTeX interface and implementation plaintex Related to the plain TeX interface and implementation themes Related to Markdown themes
Projects
None yet
1 participant