-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Supporting “commands” in addition to “classes” in attributes? #283
Comments
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
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: