[Proposal] Simpler but expanded TML standard #2
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Introduction
TML should lessen the number of elements it uses. The way to do that is to implement markdown.
Markdown should have no effect outside of quotes. Only text that would be displayed or read with a screen reader should be placed in quotes.
Elements
The meta element should be implemented, which contains pertinent metadata about the document:
If paragraph elements contain multiple quoted sections, they should concatenate:
(p "These " "parts " "all" " " "come" " together" ".")
Full paragraphs could be written with multiple separate elements:
or grouped into one:
However, paragraph elements would never contain any named elements.
List elements should not require item elements:
Definition lists should therefore be written as unordered lists with paragraph elements:
Styling of lists should be implicit in the layout of the element so an inline list without item decorations could be written as
(ul "item" "item" "item")
instead of the above. The source code for these could wrap as long as the first item starts on the first line of the element:Some elements should be supported for accessibility.
For example, a contact element should be written like this:
(@ <user@example.com> +1(555)555-5555 "1 Example Lane, Somewhere, USA 11111")
E-mail addresses should be placed inside carets, phone numbers after a plus and the country code, and physical addresses within quotes.
Citation elements should be used to cite sources for information:
Note that the citation element should be placed below its
:label
target. If one shares its immediate parent with its:label
target, that attribute could be left out.Footer-style citations should be written using the same citation element:
Styling
Unique styling elements should be replaced with markdown:
(p "This text is ~~struckthrough~~, *italicized*, and _bold_.")
Hyperlinks and anchors should also be replaced:
(p "See [here](https://example.com "Title") for an example.")
As should headings:
(p "# Heading 1")
Since underlines cannot be made in markdown without HTML, I recommend styling as anchors without links:
(p "[This text is underlined]")
Code blocks should be a paragraph element with backticks instead of quotes:
Block quotations should similarly be p elements but with triple quotes:
Note that captions can be made by creating a paragraph element within the same group as the other elements.
Inline quotations should be written within two single quotes.
(p 'I\'m sorry, Dave. I\'m afraid I can\'t do that.')
Groups, such as heading groups, should be written without any explicit element declaration:
Operators
Directional overrides are an important part of a markup language if it hopes to support multiple languages; these should be written using carets to mark the direction change:
(p "\"Oh I do like to be beside the seaside\" in Hebrew is written \"" < "אה, אני אוהב להיות ליד חוף הים" > "\" and is an example of a seaside song.")
A horizontal rule is the only kind of markdown supported outside of quotes. One is drawn between elements (or inside them) if three hyphens are placed in a row:
Attributes
Identification of specific elements is important in any markup language that use anchors. In order to be identified, an element should have an
:id
attribute:(p :id thing "This text is has the " (p :abbr "ID" "identification") " \"thing\"!")
Labels are an important part of the screen reader user's experience. They expand text's association with other elements from purely visual to programmatic; therefore, any paragraph element can have the
:label
attribute:When terms are being defined in-text, use the definition attribute to notate what word is being defined in the context:
(p "An ")(p :def "example")(p ", according to [Merriam-Webster](https://merriam-webster.com/), is \"a parallel or closely similar case especially when serving as a precedent or model\".")
When abbreviating, use the
:abbr
attribute to expand the abbreviation in metadata:((p :abbr "GNU" "GNU's Not Unix")(p "'s ")(p :def :abbr "AGPL" "Affero General Public License")(p " is a copyleft license, which mandates server owners conveying covered software over a network provide a method to acquire the source code to remote users.")
When citing a source for a quotation, the
:cite
attribute may be used in place of the element. This allows for citations to be hidden but still present in the markup metadata:(p :cite <https://piped.mint.lgbt/watch?v=GM-e46xdcUo> 'This one was invented by a writer.')