You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(As an aside: I’m working on a Markdown parser and just discovered djot yesterday – after having been a fan of Pandoc for years. It fixes virtually every complaint I have about Markdown/CommonMark. Thanks for creating this project!)
For my Markdown dialect, I have introduced “commands” – which are syntactically very similar to classes but live in a separate namespace – which, for HTML output, has the benefit of them not having to play double duty of CSS class (which should appear in output) vs. command (which should not appear in output).
Let me know what you think!
Syntax of commands
Inside attributes, !cmd works syntactically like .cmd.
Outside attributes (code blocks, div blocks), !cmd works like cmd.
For single-line commands, I have found it useful to support attributes for thematic breaks like this:
```!cmdCode block with command```
::: !cmd
Div block with command
:::
Use cases for commands
My tool supports all of the following constructs for HTML and LaTeX. It uses commands as extension points for Pandoc-style filters to implement (most of) them.
If !float links contain text, my tool only adds the number of the float (each kind of float has its own per-chapter counter). That helps with languages that have declension (cases):
It fixes virtually every complaint I have about Markdown/CommonMark
Yup yup yup, have a similar story here, where I blogged a list of my markdown/adoc complaints and got pointed towards the djot afterwards, which turned out to be exactly the thing I wanted!
Could you tell more about the intended semantics of !cmd syntax? I understand that your custom tool could treat it specially, but what's the default behavior? If you paste
::: !cmd
Div block with command
:::
into the djot's playgroud, what is the expected output?
See also #240 which also suggests to carve out syntactic space for something which isn't necessary a css class semantically.
(As an aside: I’m working on a Markdown parser and just discovered djot yesterday – after having been a fan of Pandoc for years. It fixes virtually every complaint I have about Markdown/CommonMark. Thanks for creating this project!)
For my Markdown dialect, I have introduced “commands” – which are syntactically very similar to classes but live in a separate namespace – which, for HTML output, has the benefit of them not having to play double duty of CSS class (which should appear in output) vs. command (which should not appear in output).
Let me know what you think!
Syntax of commands
!cmd
works syntactically like.cmd
.!cmd
works likecmd
.For single-line commands, I have found it useful to support attributes for thematic breaks like this:
Following djot rules, this could be changed to:
--- !cmd {key="value"} --- !cmd {!cmd key="value"} ---
More examples:
Use cases for commands
My tool supports all of the following constructs for HTML and LaTeX. It uses commands as extension points for Pandoc-style filters to implement (most of) them.
Table of contents
Floats (figures, tables, etc.)
If
!float
links contain text, my tool only adds the number of the float (each kind of float has its own per-chapter counter). That helps with languages that have declension (cases):Content indices
Displaying the index:
Specifying entries for the index:
Basic index entry:
Formatted text with a different sort key:
Multiple levels of keys (the span content between square brackets is ignored):
Book structure
--- !frontmatter
--- !mainmatter
--- !appendix
--- !backmatter
Boxouts
Boxes with notes and (optionally) icons:
Users can specify default images sizes elsewhere.
Vertical spaces
The text was updated successfully, but these errors were encountered: