-
-
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
More compact syntax for definition lists #128
Comments
Making the blank line optional would break goal 7 (wrapping). However, a lone colon is not very common, it is usually immediately after a word. Perhaps something similar to footnotes?
(maybe colon is not best character here, though) As footnotes/reference definitions already allow the blank line to be omitted your example would look like
However, one major difference to footnotes is that the term within the brackets may contain arbitrary inline content while for footnotes it may only be a tag. This would complicate the block level parsing. This would also disallow multi-line terms, breaking goal 7 (wrapping) and goal 8 (uniformity). |
+1 :Date: 2001-08-16
:Version: 1
:Indentation: Since the field marker may be quite long, the second
and subsequent lines of the field body do not have to line up
with the first line, but they must be indented relative to the
field name marker, and they must line up with each other. |
I would suggest to adopt the MediaWiki definition list syntax: ; term 1a
; term 1b
: def 1a
: def 1b
: def 1c
; term 2
: def 2
; term 3
: def 3 It allows multiple terms after each other, uses somewhat natural punctuation — semicolon leader for terms and colon leader for definition — for the task and is super easy to parse even if extended to allow multiple line/block definitions by indentation because neither semicolon nor colon normally occurs at the start of a line. Personally I have no problem with the blank line requirement since blank lines enhance readability but I think this syntax has advantages whether blank lines are required or not. |
I find it very difficult to distinguish between How about using e.g. single colons for the terms and two colons for the definitions? : term 1a
: term 1b
:: def 1a
:: def 1b
:: def 1c
: term 2
:: def 2
: term 3
:: def 3 Lazy syntax: : term 1a
spanning two lines
: term 1b
:: def 1a
:: def 1b
spanning
three lines (Ideally the lazy syntax would be (auto-)formatted like so:) : term 1a
spanning two lines
: term 1b
:: def 1a
:: def 1b
spanning
three lines No idea about parseability though. |
I don't really like any of these suggestions, because they detract from the uniformity of the language. Currently definition lists work exactly like any other lists; the marker is Aside from that issue, the only one of these that looks good is the rST syntax. However, that is not the rST syntax for definition lists; it is the syntax for field lists. We couldn't use that anyway, because we already use
|
I don't really like any of these suggestions, because they detract
from the uniformity of the language. Currently definition lists work
*exactly* like any other lists; the marker is `:` and the "term" is
the first block after the `:`; the rest is the definition.
In my opinion, definition lists do not necessarily have to work exactly
like lists because they are fundamentally different from lists. Each
description item is a term (`<dt>`) and a description (`<dd>`) while a
list item is only a list item, i.e. `<li>`.
Because they share the same syntax, one might think that they are
similar. For example, in
```
: term
description
- content
more content
```
"description" is different from "term" but "more content" is just a
continuation of "content". This is however not implied by the syntax, as
it looks more or less identical in both cases.
|
Ohhh, that's very neat, didn't realize that. I wonder if the solution here is some syntax/convention to force block-break inline. To strawman, a converter can recognize
as two blocks, without adding extra sytnax and just special-casing If I look at it this way, the problem looks very similar to what we have with tables: on the one hand, we want table cells to be blocks (to support arbitrary formatting). On the other hand, we want to be able to specify multiple cells on the same line for convenience. As another strawman idea, what if we use
|
Interesting thought. It would give us a way (other than list tables) of having block-level content in tables, as well as a compact definition list syntax. A big drawback is the use of the English word |
fleshed out the idea a bit more in #27 (comment) |
Djot's block-oriented definition list syntax is very verbose and "porous" for simple cases. Compare Djot
With asciidoctor
This seems like a tough problem: what I want here I think is making the blank like after the term optional, and maybe even allowing same-line definition, but that goes a bit against djot's grain
The text was updated successfully, but these errors were encountered: