├── .github ├── tl_packages └── workflows │ └── compile.yml ├── .gitignore ├── 1-preamble.tex ├── 2-identifier-syntax.tex ├── 3-documents.tex ├── 4-interpretation.tex ├── 5-line-directives.tex ├── 5.1-paragraph.tex ├── 5.10-footnote.tex ├── 5.11-alignment.tex ├── 5.2-blockquote.tex ├── 5.3-lists.tex ├── 5.4-header.tex ├── 5.5-horizontal-rule.tex ├── 5.6-code-block.tex ├── 5.7-instruction.tex ├── 5.7.1-set.tex ├── 5.7.1.1-line-break-mode.tex ├── 5.7.1.2-metadata.tex ├── 5.7.2-message.tex ├── 5.7.3-include.tex ├── 5.7.4-directives.tex ├── 5.7.5-label.tex ├── 5.7.6-raw.tex ├── 5.8-comment.tex ├── 5.9-embed.tex ├── 5.9.1-types.tex ├── 5.9.1.1-image.tex ├── 5.9.1.2-video.tex ├── 5.9.1.3-audio.tex ├── 5.9.1.4-source.tex ├── 5.9.2-parameters.tex ├── 5.9.2.1-float.tex ├── 5.9.2.2-width.tex ├── 5.9.2.3-height.tex ├── 5.9.2.4-label.tex ├── 5.9.2.5-caption.tex ├── 5.9.2.6-description.tex ├── 6-inline-directives.tex ├── 6.1-bold.tex ├── 6.10-compound.tex ├── 6.10.1-bold.tex ├── 6.10.2-italic.tex ├── 6.10.3-underline.tex ├── 6.10.4-strikethrough.tex ├── 6.10.5-spoiler.tex ├── 6.10.6-font.tex ├── 6.10.7-color.tex ├── 6.10.8-size.tex ├── 6.10.9-hyperlink.tex ├── 6.11-footnote-reference.tex ├── 6.12-newline.tex ├── 6.2-italic.tex ├── 6.3-underline.tex ├── 6.4-strikethrough.tex ├── 6.5-code.tex ├── 6.6-dashes.tex ├── 6.7-subtext.tex ├── 6.8-supertext.tex ├── 6.9-url.tex ├── LICENSE ├── Makefile ├── README.md ├── README.mess ├── assets ├── Jahzzar - Take Me Higher.mp3 ├── markless-logo.png └── splat.webm ├── custom.css ├── git-tag.lua ├── index.css ├── index.lass ├── issues.lua ├── issues ├── accidental directive invocation.mess ├── compound stack depth.mess ├── line breaks.mess └── line directive simplicity.mess ├── make.lisp ├── markless.cfg ├── markless.css ├── markless.tex ├── template.ctml ├── x-commands.tex └── x-glossary.tex /.github/tl_packages: -------------------------------------------------------------------------------- 1 | scheme-basic 2 | luatex 3 | luatexbase 4 | luacode 5 | luaxml 6 | geometry 7 | fix-cm 8 | ulem 9 | hyperref 10 | xcolor 11 | tcolorbox 12 | listings 13 | enumitem 14 | caption 15 | glossaries 16 | xstring 17 | fontspec 18 | tabularx 19 | environ 20 | multirow 21 | make4ht 22 | context 23 | binhex 24 | -------------------------------------------------------------------------------- /.github/workflows/compile.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | on: [push] 3 | jobs: 4 | build: 5 | runs-on: ubuntu-latest 6 | permissions: 7 | pages: write 8 | id-token: write 9 | defaults: 10 | run: 11 | shell: bash 12 | steps: 13 | - uses: actions/checkout@v1 14 | - name: Get tags 15 | run: git fetch --tags origin 16 | - name: Restore cache 17 | id: cache-ql 18 | uses: actions/cache@v3 19 | with: 20 | path: | 21 | ~/.quicklisp 22 | ~/.cache/common-lisp 23 | ~/.sbclrc 24 | key: lisp 25 | - name: Install packages 26 | run: | 27 | mkdir -p ~/.local/share/fonts 28 | curl -Lo ~/.local/share/fonts/ComicSansMS.ttf https://github.com/ImageMagick/msttcorefonts/raw/main/fonts/Comic_Sans_MS.ttf 29 | fc-cache -fv 30 | sudo apt-get install --yes --no-install-recommends \ 31 | sbcl xindy context macutils 32 | - name: Setup TeX Live 33 | uses: teatimeguest/setup-texlive-action@v3 34 | with: 35 | package-file: | 36 | .github/tl_packages 37 | - name: Install env 38 | if: steps.cache.outputs.cache-hit != 'true' 39 | run: | 40 | curl https://beta.quicklisp.org/quicklisp.lisp \ 41 | | cat - <(echo "(quicklisp-quickstart:install :path \"~/.quicklisp/\")" \ 42 | "(when (< 0 (length \"$DIST\")) (ql-dist:install-dist \"$DIST\" :prompt NIL))" \ 43 | "(ql::without-prompting (ql:add-to-init-file))" \ 44 | "(ql:quickload '(clip cl-markless-plump) :silent T)") \ 45 | | sbcl --noinform 46 | env: 47 | DIST: http://dist.shirakumo.org/shirakumo.txt 48 | - name: Build 49 | run: | 50 | mkdir -p $OUTPUT 51 | make 52 | cp -r markless.html markless.css markless.pdf index.html index.css assets $OUTPUT 53 | env: 54 | OUTPUT: ${{ format('{0}/gh-pages/', runner.temp) }} 55 | - name: Upload Github Pages Artefact 56 | uses: actions/upload-pages-artifact@v3.0.1 57 | with: 58 | path: ${{ format('{0}/gh-pages/', runner.temp) }} 59 | - name: Write to Github Pages 60 | id: deployment 61 | uses: actions/deploy-pages@v4 62 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.aux 2 | *.glg 3 | *.glo 4 | *.gls 5 | *.log 6 | *.out 7 | *.synctex.gz 8 | *.toc 9 | *.xdy 10 | *.4ct 11 | *.4tc 12 | *.dvi 13 | *.idv 14 | *.lg 15 | *.tmp 16 | *.xref 17 | auto/ 18 | *.dep 19 | index.html 20 | markless.html 21 | markless.pdf 22 | -------------------------------------------------------------------------------- /1-preamble.tex: -------------------------------------------------------------------------------- 1 | \definesection{Preamble} 2 | Markless is a new markup standard that focuses on being intuitive and fast to parse. Being a purely text-based markup, no complicated editor software is required to create documents in it. With its focus on intuition and consistency it should also be a good fit as a markup choice for text based platforms such as chat, forums, etc. Markless does not specify its results based on another document format, meaning that an implementation could be written to turn a Markless document into practically any other format. Markless is strict and does not allow for any ambiguities in its markup. This both makes it less confusing for the user, and easier to parse for a program. Being based on a specification rather than a reference implementation, Markless also offers the users a much more stable and reliant source to turn to in case of questions about the behaviour of an implementation.\\ 3 | 4 | This document specifies the way a Markless \g{document} is treated and how the various markup \gpl{directive} are to be \glink{interpretation}{interpreted}. It does not describe the technological aspects of writing an \g{implementation} for Markless. It should also not be used as a guide or introduction on how to write Markless documents, but rather as a reference if you should want to write a new \g{implementation} or are unsure about the behaviour of an existing one. This document also describes the terminology to allow talking about Markless terms unambiguously. See the \sectionref{glossary} for reference. \\ 5 | 6 | Included in most sections are one or more examples. These examples exist purely for illustrative purposes and are not normative. An \g{implementation} may deviate from the behaviour illustrated by the examples as long as it adheres to the actual description of this specification. 7 | 8 | %%% Local Variables: 9 | %%% mode: latex 10 | %%% TeX-master: "markless" 11 | %%% TeX-engine: luatex 12 | %%% TeX-command-extra-options: "-shell-escape" 13 | %%% End: 14 | -------------------------------------------------------------------------------- /2-identifier-syntax.tex: -------------------------------------------------------------------------------- 1 | \definesection{Identifier Syntax} 2 | In order to concisely specify \gpl{identifier} we use a special syntax, of which the full grammar and semantics are reflected here using BNF notation. \\ 3 | 4 | \begin{tabular}{lcl} 5 | \definesyntax{rule} &::=& ``\inline$($''? (\syntax{matcher} \syntax{quantifier}?)+ ``\inline$)$ ''? \\ 6 | \definesyntax{matcher} &::=& \multilinecell{\syntax{rule} | \syntax{string} | \syntax{some-characters} \\ 7 | | \syntax{any-character} | \syntax{not} | \syntax{either} | \syntax{binding} \\ 8 | | \syntax{binding-reference} | \syntax{identifier-reference}} \\ 9 | \definesyntax{string} &::=& \syntax{character}+ \\ 10 | \definesyntax{char-class} &::=& ``\inline$~$'' \syntax{character} \\ 11 | \definesyntax{some-characters} &::=& ``\inline$[$'' \syntax{character}+ ``\inline$]$'' \\ 12 | \definesyntax{any-character} &::=& ``\inline$.$'' \\ 13 | \definesyntax{not} &::=& ``\inline$!$'' \syntax{matcher} \\ 14 | \definesyntax{either} &::=& \syntax{rule} ``\inline$|$'' \syntax{rule}\\ 15 | \definesyntax{binding} &::=& ``\inline$<$'' \syntax{name} ``\inline$ $'' \syntax{rule} ``\inline$>$'' \\ 16 | \definesyntax{binding-reference} &::=& ``\inline$<$'' \syntax{name} ``\inline$>$'' \\ 17 | \definesyntax{identifier-reference} &::=& ``\inline${$'' \syntax{name} ``\inline$}$'' \\ 18 | \definesyntax{quantifier} &::=& \syntax{one-or-more} | \syntax{none-or-more} | \syntax{one-or-none} \\ 19 | \definesyntax{one-or-more} &::=& \syntax{rule} ``\inline$+$'' \\ 20 | \definesyntax{none-or-more} &::=& \syntax{rule} ``\inline$*$'' \\ 21 | \definesyntax{one-or-none} &::=& \syntax{rule} ``\inline$?$'' \\ 22 | \definesyntax{name} &---& Some \g{alphanumeric} \g{string} to identify the text matched by the \syntax{rule}. \\ 23 | \definesyntax{character} &---& A \g{character}. \\ 24 | \end{tabular} \\ 25 | 26 | {\setlength{\parindent}{0cm} 27 | Appearing within the ``'' quotes are \gpl{character} to be found in the \g{identifier specifier}. \\ 28 | 29 | If a backslash appears anywhere within the \g{identifier specifier}, it is ignored and the \g{character} immediately after it is taken literally without being interpreted as one of the \gpl{character} in the syntax rules and without being interpreted using this backslash rule. Thus two backslashes immediately after one another are interpreted as a single, literal backslash \g{character}. \\ 30 | 31 | In order for a \syntax{rule} to \g{match}, the \syntax{quantifier} supplied with the \syntax{matcher} must match. If no \syntax{quantifier} is included in a \syntax{rule}, the \syntax{rule} \glink{match}{matches} if the \syntax{matcher} \glink{match}{matches} exactly once. \\ 32 | 33 | In order for a \syntax{string} to \g{match}, the exact sequence of \gpl{character} must be found. \\ 34 | 35 | In order for a \syntax{char-class} to \g{match}, a \g{character} specified by the \g{character class} associated with the given \syntax{character} must be found. The following classes are specified: \inline$a$ for \g{alphabetic}, \inline$n$ for \g{numeric}, \inline$_$ for \g{whitespace}, and \inline$w$ for \g{alphanumeric}. \\ 36 | 37 | In order for \syntax{some-characters} to \g{match}, one of the \gpl{character} must be found. \\ 38 | 39 | In order for \syntax{any-character} to \g{match}, a single \g{character} must be found, but it matters not which \g{character} it is. \\ 40 | 41 | In order for \syntax{not} to \g{match}, the following \syntax{matcher} must not \g{match}. \\ 42 | 43 | 44 | In order for \syntax{either} to \g{match}, either the \syntax{rule} left to it, or the \syntax{rule} right to it must \g{match}. \\ 45 | 46 | In order for \syntax{one-or-more} to \g{match}, the \syntax{rule} must be \glink{match}{matched} at least once, but may be \glink{match}{matched} an arbitrary number of times immediately after each other. The \syntax{rule} is only repeatedly \glink{match}{matched} until the \syntax{rule} immediately after the \syntax{one-or-more} is \glink{match}{matched}. \\ 47 | 48 | In order for \syntax{none-or-more} to \g{match}, the \syntax{rule} does not have to be \glink{match}{matched} at all, but may be \glink{match}{matched} an arbitrary number of times immediately after each other. The \syntax{rule} is only repeatedly \glink{match}{matched} until the \syntax{rule} immediately after the \syntax{none-or-more} is \glink{match}{matched}. \\ 49 | 50 | In order for \syntax{one-or-none} to \g{match}, the \syntax{rule} does not have to be \glink{match}{matched} at all, but if it is, it is only \glink{match}{matched} exactly once. \\ 51 | 52 | In order for a \syntax{binding} to \g{match}, the \syntax{rule} contained must \g{match}. The specific \g{string} \glink{match}{matched} by the \syntax{rule} is then associated with the \syntax{name} of the \syntax{binding}. \\ 53 | 54 | In order for an \syntax{identifier-reference} to \g{match}, the \g{identifier} corresponding to the \syntax{name} must \g{match}. The effect is as if the according \g{identifier specifier} was used in place of the \syntax{identifier-reference}.\\ 55 | 56 | In order for a \syntax{binding-reference} to \g{match}, the exact \g{string} associated with the \syntax{name} of the \syntax{binding} must be found. 57 | } 58 | 59 | %%% Local Variables: 60 | %%% mode: latex 61 | %%% TeX-master: "markless" 62 | %%% TeX-engine: luatex 63 | %%% TeX-command-extra-options: "-shell-escape" 64 | %%% End: 65 | -------------------------------------------------------------------------------- /3-documents.tex: -------------------------------------------------------------------------------- 1 | \definesection{Documents} 2 | Markless describes a number of \gpl{directive} to transform a \g{document} from its bare \g{string} representation into that of a \g{textual component}. While the \gpl{directive} are described in this specification using Unicode \gpl{character}, the specification does not enforce any particular \g{encoding} on the \g{document}. However, in order for an \g{implementation} to be \glink{conforming implementation}{conforming}, \gpl{character} used to identify a \g{directive} in a \g{document} must be \g{equivalent} to those in this specification. \\ 3 | 4 | The effect of a \g{textual component} on its \g{text} applies on all \gpl{level}. In the case of conflicting \gpl{style}, the \g{style} of the \g{textual component} on the closest \g{level} above the \g{text} applies. In effect this means that a \g{textual component} on a lower \g{level} can override a \g{style} for its \g{text}. \\ 5 | 6 | An \g{implementation} may choose to compose multiple \gpl{textual component} in order to achieve the effect of a single \g{specified textual component}. It may also insert \gpl{textual component} at any point in the \g{document} if necessary by the resulting \g{document format}. An \g{implementation} may also ignore any \g{style} of a \g{specified textual component} if the resulting \g{document format} cannot support its effect. 7 | 8 | % Somewhere we need to note about general backslash escaping. 9 | 10 | %%% Local Variables: 11 | %%% mode: latex 12 | %%% TeX-master: "markless" 13 | %%% TeX-engine: luatex 14 | %%% TeX-command-extra-options: "-shell-escape" 15 | %%% End: 16 | -------------------------------------------------------------------------------- /4-interpretation.tex: -------------------------------------------------------------------------------- 1 | \definesection{Interpretation} 2 | This section describes the procedure by which an \g{implementation} \glink{interpretation}{interprets} a \g{document}. This procedure is used as a reference to allow verification of correctness. An \g{implementation} does not necessarily have to follow this procedure as long as the output it produces is equivalent with an \g{implementation} that does. 3 | 4 | \definesubsection{State} 5 | The following state is kept and updated as the procedure advances. 6 | 7 | \begin{itemize} 8 | \item The input stream from which characters are read. 9 | \item The parser state variables such as the \g{line break mode}. 10 | \item A \g{cursor}. 11 | \item A stack wherein each entry is composed of a \g{directive} and a \g{textual component}. 12 | \item A list of \gpl{disabled directive}. 13 | \item A table associating \gpl{label} to \gpl{textual component}. 14 | \end{itemize} 15 | 16 | \definesubsection{Procedure} 17 | \begin{step} 18 | \item A ``root-directive'' and a ``root-component'' are pushed onto the stack. 19 | \item If the input stream has things to read: 20 | \begin{step} 21 | \item A \g{line} is read from the input stream. 22 | \item The \g{cursor} is set to the beginning of the \g{line}. 23 | \item The stack is traversed upwards from the bottom: 24 | \begin{step} 25 | \item The \g{directive} at the current stack entry attempts to \g{match}. 26 | \item If the \g{match} succeeds: 27 | \begin{step} 28 | \item The \g{cursor} is advanced by the \glink{match}{matched} \gpl{character}. 29 | \item The current stack entry is advanced upwards. 30 | \item Go to 2.3.1. 31 | \end{step} 32 | \item The stack is unwound down to and including the current stack entry. See \sectionref{Stack Unwinding}. 33 | \end{step} 34 | \item The \g{directive} on top of the stack is invoked: 35 | \begin{step} 36 | \item If an \g{applicable directive} \glink{match}{matches}: 37 | \begin{step} 38 | \item The \glink{match}{matched} \g{directive} may enter \gpl{textual component} into the \g{current component}. 39 | \item The \glink{match}{matched} \g{directive} may push itself and a \g{textual component} onto the stack or perform other changes to the state as specified. 40 | \item The \g{cursor} is advanced by the \glink{match}{matched} \gpl{character}. 41 | \item Go to 2.4. 42 | \end{step} 43 | \item The \g{character} at the \g{cursor} is added to the \g{current component}. 44 | \item The \g{cursor} is advanced by the \g{character}. 45 | \end{step} 46 | \item If the \g{cursor} is not yet at the end of the \g{line}: 47 | \begin{step} 48 | \item Go to 2.4. 49 | \end{step} 50 | \item If the \g{line break mode} is \inline$show$, a \g{newline} is added to the \g{current component}. 51 | \item Go to 2. 52 | \end{step} 53 | \item The stack is unwound fully. See \sectionref{Stack Unwinding}. 54 | \item The interpretation is complete. The ``root-component'' represents the resulting \g{document}. 55 | \end{step} 56 | 57 | \definesubsubsection{Stack Unwinding} 58 | \begin{step} 59 | \item If the stack is taller than the desired height: 60 | \begin{step} 61 | \item If the directive on top of the stack is a \g{inline directive}: 62 | \begin{step} 63 | \item The \g{current component} is converted to one that has no \g{style}. 64 | \item \Gpl{character} that have been consumed by the prefix match of the \g{directive} are prepended to the \g{current component}. 65 | \item Other potentially necessary actions to undo the match of the \g{directive} are performed. 66 | \end{step} 67 | \item The top of the stack is popped off. 68 | \item Go to 1. 69 | \end{step} 70 | \end{step} 71 | 72 | \definesubsubsection{Root Directive} 73 | The root directive always \glink{match}{matches} but is never considered an \g{applicable directive}. 74 | 75 | %%% Local Variables: 76 | %%% mode: latex 77 | %%% TeX-master: "markless" 78 | %%% TeX-engine: luatex 79 | %%% TeX-command-extra-options: "-shell-escape" 80 | %%% End: 81 | -------------------------------------------------------------------------------- /5-line-directives.tex: -------------------------------------------------------------------------------- 1 | \definesection{Line Directives} 2 | In order for a \g{directive} to be a \g{line directive}, its \g{identifier} must \g{match} the beginning of a \g{line}. \\ 3 | 4 | A \g{textual component} specified by a \g{line directive} can potentially contain any other \g{textual component}. Therefore, any \g{directive} is potentially recognisable within a \g{line directive}, including other \gpl{line directive}. However, a \g{line directive} may explicitly restrict which \gpl{directive} are recognised within itself. A \g{line directive} cannot cross the boundaries of another \g{line directive} of a different kind. If such a case were to occur, the current \g{line directive} is forcibly ended without regard for any possible trailing \g{match}. 5 | 6 | \definesubsubsection{Singular Line Directives} 7 | A \g{line directive} is a \g{singular line directive} if it is only ever active for a single \g{line}. If it is matched on two consecutive \gpl{line} this results in two separate \gpl{resulting textual component}. \\ 8 | 9 | When a \g{singular line directive} is \glink{processing}{processed}, processing begins anew over the \g{content binding} until the end of the \g{line} is reached, at which point the \g{resulting textual component} is ended. After that, control is handed back to the \g{standard processing loop}. 10 | 11 | \definesubsubsection{Spanning Line Directives} 12 | A \g{line directive} is a \g{spanning line directive} if the \g{identifier} contains a \g{content binding}, and if \glink{match}{matches} on consecutive \gpl{line} of the \g{identifier} are interpreted as a single \g{match}. The semantics of such a spanning match are as follows: Only a single \g{resulting textual component} is produced for all the consecutively \glink{match}{matching} \gpl{line}. The \g{text} of this \g{resulting textual component} is produced by concatenating the contents of the \g{content binding} on each \g{line}. If the \g{content binding} does not \g{match} the \g{newline} on every \g{line}, the \g{newline} must be inserted between each \g{string} of the \g{content binding}. \\ 13 | 14 | When a \g{spanning line directive} is \glink{processing}{processed}, processing begins anew over the \g{content binding} until the end of the \g{line} is reached. Standard end of \g{line} \g{interpretation} proceeds. If the following \g{line} \glink{match}{matches} the same \g{spanning line directive} as before, processing begins anew over the \g{content binding} thereof without any new \gpl{resulting textual component} being started or inserted. If the following \g{line} does not \g{match} the same \g{spanning line directive} as before, the \g{resulting textual component} is ended and control is handed back to the \g{standard processing loop}. 15 | 16 | \definesubsubsection{Guarded Line Directives} 17 | A \g{line directive} is a \g{guarded line directive} if its \glink{match}{matched} region is specified by two \gpl{identifier} that each match a single \g{line}. The \g{text} of the \g{resulting textual component} is the \g{text} from the \g{line} immediately after the \g{line} the first \g{identifier} \glink{match}{matches} until and including the \g{line} immediately before the \g{line} the second \g{identifier} \glink{match}{matches}. \\ 18 | 19 | When a \g{guarded line directive} is \glink{processing}{processed}, processing begins anew over the \g{content binding} until the the part of the \g{identifier} after the \g{content binding} is \glink{full match}{fully matched}, at which point the \g{resulting textual component} is ended and control is handed back to the \g{standard processing loop}. 20 | 21 | \input{5.1-paragraph.tex} 22 | \input{5.2-blockquote.tex} 23 | \input{5.3-lists.tex} 24 | \input{5.4-header.tex} 25 | \input{5.5-horizontal-rule.tex} 26 | \input{5.6-code-block.tex} 27 | \input{5.7-instruction.tex} 28 | \input{5.8-comment.tex} 29 | \input{5.9-embed.tex} 30 | \input{5.10-footnote.tex} 31 | \input{5.11-alignment.tex} 32 | 33 | %%% Local Variables: 34 | %%% mode: latex 35 | %%% TeX-master: "markless" 36 | %%% TeX-engine: luatex 37 | %%% TeX-command-extra-options: "-shell-escape" 38 | %%% End: 39 | -------------------------------------------------------------------------------- /5.1-paragraph.tex: -------------------------------------------------------------------------------- 1 | \definesubsection{Paragraph} 2 | \begin{identifier}{paragraph} 3 | 4 | \end{identifier} 5 | \definetextualcomponent{paragraph}{margin: top, bottom} \\ 6 | 7 | The paragraph can only be \glink{match}{matched} if no other \g{line directive} \glink{match}{matches}. \Gpl{line} belong to the same paragraph until the length of \inline{spaces} changes, a new \g{inline directive} is recognised, or an \g{empty line} is encountered. The paragraph is a \g{spanning line directive}. \\ 8 | 9 | Paragraphs are visually distinguished by a margin above and below the \g{text}. An \g{implementation} may additionally employ indentation rules to distinguish the beginning of a paragraph. \\ 10 | 11 | \begin{examples} 12 | \begin{examplesource} 13 | This is a paragraph 14 | that spans multiple lines 15 | 16 | This is another paragraph. 17 | \end{examplesource} 18 | \begin{exampleoutput} 19 | This is a paragraph\\ 20 | that spans multiple lines.\\ 21 | \\ 22 | This is another paragraph. 23 | \end{exampleoutput} 24 | \begin{examplesource} 25 | Paragraph One 26 | Paragraph Two 27 | \end{examplesource} 28 | \begin{exampleoutput} 29 | Paragraph One\\ 30 | \\ 31 | Paragraph Two 32 | \end{exampleoutput} 33 | \end{examples} 34 | 35 | %%% Local Variables: 36 | %%% mode: latex 37 | %%% TeX-master: "markless" 38 | %%% TeX-engine: luatex 39 | %%% TeX-command-extra-options: "-shell-escape" 40 | %%% End: 41 | -------------------------------------------------------------------------------- /5.10-footnote.tex: -------------------------------------------------------------------------------- 1 | \definesubsection{Footnote} 2 | \begin{identifier}{footnote} 3 | \[\] 4 | \end{identifier} 5 | \definetextualcomponent{footnote}{} \\ 6 | 7 | The footnote is a \g{singular line directive}. Outputted to the \g{resulting textual component} is the \g{text} held by the \inline$number$ \g{binding} followed by a \unicode{3A}, followed by the \g{text} held by the \g{content binding}. The footnote can only contain \gpl{inline directive}. \\ 8 | 9 | Unlike other \gpl{directive} the footnote's \g{resulting textual component} cannot be placed where the \g{identifier} is found. It must be placed such that it is at the end of a \g{page} in the \g{document}.\\ 10 | 11 | The \g{resulting textual component} is associated with a \g{label} with the name being the content of the \inline$number$ \g{binding}. \\ 12 | 13 | \begin{examples} 14 | \begin{examplesource} 15 | Examples[1] are not authoritative. 16 | 17 | [1] Examples are things like this. 18 | \end{examplesource} 19 | \begin{exampleoutput} 20 | Examples\raisebox{.4ex}{\scriptsize \hyperref[footnote:ex1]{[1]}} are not authoritative. \\ 21 | \rule{0.2\textwidth}{1pt} \\ 22 | \label{footnote:ex1}1: Examples are things like this. 23 | \end{exampleoutput} 24 | \end{examples} 25 | 26 | %%% Local Variables: 27 | %%% mode: latex 28 | %%% TeX-master: "markless" 29 | %%% TeX-engine: luatex 30 | %%% TeX-command-extra-options: "-shell-escape" 31 | %%% End: -------------------------------------------------------------------------------- /5.11-alignment.tex: -------------------------------------------------------------------------------- 1 | \definesubsection{Alignment} 2 | \begin{identifier}{Left Align} 3 | \|\< 4 | \end{identifier} 5 | \begin{identifier}{Right Align} 6 | \|\> 7 | \end{identifier} 8 | \begin{identifier}{Center} 9 | \>\< 10 | \end{identifier} 11 | \begin{identifier}{Justify} 12 | \|\| 13 | \end{identifier} 14 | \definetextualcomponent{left align}{text-align: left} 15 | \definetextualcomponent{right align}{text-align: right} 16 | \definetextualcomponent{center}{text-align: center} 17 | \definetextualcomponent{justify}{text-align: justify} \\ 18 | 19 | All alignment directives are \g{spanning line directive} that change the alignment of a body of \g{text}. The alignment content can contain any \g{directive} with the condition that the \gpl{directive} are matched against the \g{text} of the \g{resulting textual component}. \\ 20 | 21 | \begin{examples} 22 | \begin{examplesource} 23 | |< Left 24 | >< Center 25 | |> Right 26 | \end{examplesource} 27 | \begin{exampleoutput} 28 | \begin{minipage}{0.5\textwidth} 29 | \begin{flushleft}Left\end{flushleft} 30 | \begin{center}Center\end{center} 31 | \begin{flushright}Right\end{flushright} 32 | \end{minipage} 33 | \end{exampleoutput} 34 | \end{examples} 35 | 36 | %%% Local Variables: 37 | %%% mode: latex 38 | %%% TeX-master: "markless" 39 | %%% TeX-engine: luatex 40 | %%% TeX-command-extra-options: "-shell-escape" 41 | %%% End: 42 | -------------------------------------------------------------------------------- /5.2-blockquote.tex: -------------------------------------------------------------------------------- 1 | \definesubsection{Blockquote} 2 | \begin{identifier}{blockquote-header} 3 | \~ (\| )? 4 | ( )* 5 | \end{identifier} 6 | \begin{identifier}{blockquote} 7 | \| 8 | \end{identifier} 9 | \definetextualcomponent{blockquote header}{margin: left; font-weight: bold} 10 | \definetextualcomponent{blockquote}{margin: left} \\ 11 | 12 | The blockquote header is a \g{singular line directive} that identifies the source of a quote. Only the \g{text} held by the \g{content binding} is outputted into the \g{resulting textual component}. The blockquote header \g{content binding} can only contain \gpl{inline directive}. If the \inline$body$ \g{binding} is present, then the blockquote header's \g{resulting textual component} is closed, and parsing resumes as if at a block toplevel, meaning a blockquote will be parsed next. This allows a shorter form of combined header and body. A single \g{match} may span over multiple \gpl{line} if the \g{text} \glink{match}{matched} by the \inline$spacing$ \g{binding} is of the same length as that of the \inline$content$ \g{binding} plus the two prefix characters. \\ 13 | 14 | The blockquote is a \g{spanning line directive} that identifies a body of \g{text} that is being quoted. The blockquote can contain any \g{directive} with the condition that the \gpl{directive} are matched against the \g{text} of the \g{resulting textual component}. \\ 15 | 16 | An implementation may choose to group the \comp{blockquote header} and \comp{blockquote} together and reorder them if they are found consecutive to one another. However, a body can only ever be grouped together with a single header. In the case where a header lies between two bodies, the header is counted to belong to the second body. If a header is found without a corresponding body, the \g{implementation} may \glink{signalling}{signal} a \g{warning}. \\ 17 | 18 | \begin{examples} 19 | \begin{examplesource} 20 | ~ This Document 21 | | The blockquote header is a \ 22 | | singular line directive. 23 | \end{examplesource} 24 | \begin{exampleoutput} 25 | \begin{blockquote}[This Document] 26 | The blockquote header is a singular line directive. 27 | \end{blockquote} 28 | \end{exampleoutput} 29 | \begin{examplesource} 30 | | Unattributed text. 31 | \end{examplesource} 32 | \begin{exampleoutput} 33 | \begin{blockquote} 34 | Unattributed text. 35 | \end{blockquote} 36 | \end{exampleoutput} 37 | \begin{examplesource} 38 | ~ Yukari | Hello there! 39 | \end{examplesource} 40 | \begin{exampleoutput} 41 | \begin{blockquote}[Yukari] 42 | Hello there! 43 | \end{blockquote} 44 | \end{exampleoutput} 45 | \begin{examplesource} 46 | ~ Yukari | I.... 47 | | I have nothing left to add. 48 | \end{examplesource} 49 | \begin{exampleoutput} 50 | \begin{blockquote}[Yukari] 51 | I....\linebreak 52 | I have nothing left to add. 53 | \end{blockquote} 54 | \end{exampleoutput} 55 | \end{examples} 56 | 57 | %%% Local Variables: 58 | %%% mode: latex 59 | %%% TeX-master: "markless" 60 | %%% TeX-engine: luatex 61 | %%% TeX-command-extra-options: "-shell-escape" 62 | %%% End: 63 | -------------------------------------------------------------------------------- /5.3-lists.tex: -------------------------------------------------------------------------------- 1 | \definesubsection{Lists} 2 | \begin{identifier}{ordered-list} 3 | \. 4 | ( )* 5 | \end{identifier} 6 | \begin{identifier}{unordered-list} 7 | - 8 | ( )* 9 | \end{identifier} 10 | \definetextualcomponent{ordered list}{margin: left} 11 | \definetextualcomponent{ordered list item}{display: list-item; list-item-prefix: number} 12 | \definetextualcomponent{unordered list}{margin: left} 13 | \definetextualcomponent{unordered list item}{display: list-item; list-item-prefix: dot} \\ 14 | 15 | The lists are \gpl{spanning line directive} and mark the enumeration of one or more items of a list. They can contain any \g{directive} with the condition that the \gpl{directive} are matched against the \g{text} of the \g{resulting textual component}. \\ 16 | 17 | After the respective list \g{identifier} has been \glink{match}{matched}, a new respective item \g{textual component} in which the higher \g{level} \g{text} is contained, is inserted for each \g{match} into the spanning \g{resulting textual component}. A single \g{match} may span over multiple \gpl{line} if the \g{text} \glink{match}{matched} by the \inline$spacing$ \g{binding} is of the same length as that of the \inline$number$ \g{binding}. In such a case, each item \g{match} itself is treated like a \g{spanning line directive} where the \g{content binding} is concatenated. \\ 18 | 19 | Ordered list items must be numbered by the \g{decimal number} given by the \inline$number$ \g{binding}, even if there is no order to how the numbers appear in the list or if there are duplicates. \\ 20 | 21 | \begin{examples} 22 | \begin{examplesource} 23 | - Finish this spec 24 | - Implement a parser 25 | \end{examplesource} 26 | \begin{exampleoutput} 27 | \begin{minipage}{0.5\textwidth} 28 | \begin{itemize}[noitemsep] 29 | \item Finish this spec 30 | \item Implement a parser 31 | \end{itemize} 32 | \end{minipage} 33 | \end{exampleoutput} 34 | \begin{examplesource} 35 | 1.Buy some ingredients 36 | 2.Clean the kitchen 37 | Don't forget the sink! 38 | 5.Watch TV 39 | \end{examplesource} 40 | \begin{exampleoutput} 41 | \begin{minipage}{0.5\textwidth} 42 | \begin{enumerate}[noitemsep] 43 | \item Buy some ingredients 44 | \item Clean the kitchen\\Don't forget the sink! 45 | \setcounter{enumi}{4} 46 | \item Watch TV 47 | \end{enumerate} 48 | \end{minipage} 49 | \end{exampleoutput} 50 | \end{examples} 51 | 52 | %%% Local Variables: 53 | %%% mode: latex 54 | %%% TeX-master: "markless" 55 | %%% TeX-engine: luatex 56 | %%% TeX-command-extra-options: "-shell-escape" 57 | %%% End: 58 | -------------------------------------------------------------------------------- /5.4-header.tex: -------------------------------------------------------------------------------- 1 | \definesubsection{Header} 2 | \begin{identifier}{header} 3 | 4 | \end{identifier} 5 | \definetextualcomponent{header}{font-weight:bold; font-size: 1-level; indent: true; label: content} \\ 6 | 7 | The header is a \g{singular line directive}. It represents a section heading. Only the \g{text} held by the \g{content binding} is outputted to the \g{resulting textual component}. The header can only contain \gpl{inline directive}.\\ 8 | 9 | The length of the \inline$level$ \g{binding} determines the level of the heading. The level may potentially be infinitely high, though the \g{implementation} may represent levels above a certain number in the same manner. It must however support a different representation for at least levels 1 and 2. Generally, the higher the level, the smaller the font size of the heading should be. \\ 10 | 11 | An \g{implementation} may choose to number each header, where this number prefix is put together by the number prefix of the header on a level one higher followed by a dot and a counter representing how many headers of the same level have appeared until and including the current one since the last header of a higher level. In the case of a level one heading only the counter is used, as there is no higher level prefix to prepend. In the case where no level one higher is contained in the \g{document}, the level is treated as if it existed with the counter for it being 0.\\ 12 | 13 | The \g{resulting textual component} is associated with a \g{label} of the same name as the \g{text} of the \g{resulting textual component}. \\ 14 | 15 | \begin{examples} 16 | \begin{examplesource} 17 | # Header 18 | The header is a singular line 19 | directive 20 | ## Subsection 21 | That allows neat sectioning! 22 | \end{examplesource} 23 | \begin{exampleoutput} 24 | \textbf{\quad\Large Header}\\ 25 | The header is a singular line\\ 26 | directive.\\ 27 | \textbf{\quad\large Subsection}\\ 28 | That allows neat sectioning!\\ 29 | \end{exampleoutput} 30 | \begin{examplesource} 31 | # Cooking a Lasagna 32 | Here's what you have to buy: 33 | ## Ingredients 34 | A buncha stuff! 35 | ## Steps 36 | It's a lengthy recipe, but finally \ 37 | you'll have to 38 | #### Bake it 39 | \end{examplesource} 40 | \begin{exampleoutput} 41 | \textbf{\quad\Large 1 Cooking a Lasagna}\\ 42 | Here's what you have to buy: \\ 43 | \textbf{\quad\large 1.1 Ingredients}\\ 44 | A buncha stuff! \\ 45 | \textbf{\quad\large 1.2 Steps}\\ 46 | It's a lengthy recipe, but finally you'll have to \\ 47 | \textbf{\quad\small 1.2.0.1 Bake it}\\ 48 | \end{exampleoutput} 49 | \end{examples} 50 | 51 | %%% Local Variables: 52 | %%% mode: latex 53 | %%% TeX-master: "markless" 54 | %%% TeX-engine: luatex 55 | %%% TeX-command-extra-options: "-shell-escape" 56 | %%% End: -------------------------------------------------------------------------------- /5.5-horizontal-rule.tex: -------------------------------------------------------------------------------- 1 | \definesubsection{Horizontal Rule} 2 | \begin{identifier}{horizontal-rule} 3 | ==+ 4 | \end{identifier} 5 | \definetextualcomponent{horizontal-rule}{display: line} \\ 6 | 7 | The horizontal rule is a \g{singular line directive}. It is translated into a \g{resulting textual component} that represents a horizontal rule or break on the page. This must span the entire width of the document and could be represented by a thin line. If the \g{document} cannot support the drawing of lines, the horizontal rule may instead be approximated through other means.\\ 8 | 9 | \begin{examples} 10 | \example{==}{\rule{0.5\textwidth}{1pt}} 11 | \begin{examplesource} 12 | And now, for a brief break. 13 | ===== 14 | Back to the show! 15 | \end{examplesource} 16 | \begin{exampleoutput} 17 | And now, for a brief break. \\ 18 | \rule{0.5\textwidth}{1pt} \\ 19 | Back to the show! 20 | \end{exampleoutput} 21 | \end{examples} 22 | 23 | %%% Local Variables: 24 | %%% mode: latex 25 | %%% TeX-master: "markless" 26 | %%% TeX-engine: luatex 27 | %%% TeX-command-extra-options: "-shell-escape" 28 | %%% End: -------------------------------------------------------------------------------- /5.6-code-block.tex: -------------------------------------------------------------------------------- 1 | \definesubsection{Code block} 2 | \begin{identifier}{code-block} 3 | *? 4 | 5 | 6 | \end{identifier} 7 | \definetextualcomponent{code block}{font-family: monospace; white-space: preserve} \\ 8 | 9 | The code block is a \g{guarded line directive}. It marks the \g{text} to belong to a \g{textual component} that somehow distinguishes the block as source code. Only the \g{text} held by the \g{content binding} is outputted to the \g{resulting textual component}. The code block \g{directive} cannot contain any other \gpl{directive}. \\ 10 | 11 | The \gpl{newline} and \g{whitespace} must be represented exactly as in the source text. Multiple consecutive \g{whitespace} \gpl{character} cannot be combined and must be individually represented. A \g{newline} \g{character} cannot be escaped and must always result in a new line being started. \G{escaping} is deactivated within the content, meaning backslashes are output literally in the \g{resulting textual component}. \\ 12 | 13 | The \inline$options$ \g{binding} holds potential parameters that can configure the \g{style} of the \g{resulting textual component}. The syntax and effect of the options is \g{implementation dependant}. If a language is requested in the \inline$language$ \g{binding} that the \g{implementation} does not have specific support for, a \g{warning} is \glink{signalling}{signalled}. The language \inline$text$ must always be supported and will incur no styling changes. \\ 14 | 15 | \begin{examples} 16 | \begin{examplesource} 17 | Some unexciting code: 18 | :: common-lisp 19 | (print "Hello world") 20 | :: 21 | \end{examplesource} 22 | &$\Rightarrow$& 23 | \begin{tabular}{@{}l@{}} 24 | Some unexciting code: \\ 25 | \begin{lstlisting}[style=codestyle,language=Lisp,showstringspaces=false] 26 | (print "Hello world") 27 | \end{lstlisting} 28 | \end{tabular} 29 | \end{examples} 30 | 31 | %%% Local Variables: 32 | %%% mode: latex 33 | %%% TeX-master: "markless" 34 | %%% TeX-engine: luatex 35 | %%% TeX-command-extra-options: "-shell-escape" 36 | %%% End: 37 | -------------------------------------------------------------------------------- /5.7-instruction.tex: -------------------------------------------------------------------------------- 1 | \definesubsection{Instruction} 2 | \begin{identifier}{instruction} 3 | \! 4 | \end{identifier} 5 | 6 | The instruction is a \g{singular line directive}. Its purpose is to interact with the \g{implementation} and cause it to perform differently. There is no corresponding \g{resulting textual component} for the instruction \g{directive}. \\ 7 | 8 | An \g{implementation} is allowed to add further instructions. If an instruction is not recognised, the \g{implementation} must \glink{signalling}{signal} an \g{error}. \\ 9 | 10 | \input{5.7.1-set.tex} 11 | \input{5.7.2-message.tex} 12 | \input{5.7.3-include.tex} 13 | \input{5.7.4-directives.tex} 14 | \input{5.7.5-label.tex} 15 | \input{5.7.6-raw.tex} 16 | 17 | %%% Local Variables: 18 | %%% mode: latex 19 | %%% TeX-master: "markless" 20 | %%% TeX-engine: luatex 21 | %%% TeX-command-extra-options: "-shell-escape" 22 | %%% End: -------------------------------------------------------------------------------- /5.7.1-set.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsection{Set} 2 | \defineinstruction{set}{set } \\ 3 | 4 | Sets the state of the \g{variable} of the given name to a certain value. An \g{implementation} may check the value for validity and \glink{signalling}{signal} an \g{error} if it is invalid. An \g{implementation} is allowed to add further variables. If a variable is not recognised, the \g{implementation} must \glink{signalling}{signal} an \g{error}. \\ 5 | 6 | \input{5.7.1.1-line-break-mode.tex} 7 | \input{5.7.1.2-metadata.tex} 8 | 9 | %%% Local Variables: 10 | %%% mode: latex 11 | %%% TeX-master: "markless" 12 | %%% TeX-engine: luatex 13 | %%% TeX-command-extra-options: "-shell-escape" 14 | %%% End: -------------------------------------------------------------------------------- /5.7.1.1-line-break-mode.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsubsection{Line Break Mode} 2 | \definevariable{line-break-mode}{show} \\ 3 | 4 | The \var{line-break-mode} variable may only assume two values: \inline$show$, and \inline$hide$. If the line break mode is \inline$show$, when the processor encounters an unescaped \g{newline}, a new \g{line} is started in the output \g{document}. \\ 5 | 6 | \begin{examples} 7 | \begin{examplesource} 8 | ! set line-break-mode show 9 | foo 10 | bar\ 11 | baz 12 | ! set line-break-mode hide 13 | bada 14 | boom 15 | \end{examplesource} 16 | \begin{exampleoutput} 17 | foo\\ 18 | barbaz\\ 19 | badaboom 20 | \end{exampleoutput} 21 | \end{examples} 22 | 23 | %%% Local Variables: 24 | %%% mode: latex 25 | %%% TeX-master: "markless" 26 | %%% TeX-engine: luatex 27 | %%% TeX-command-extra-options: "-shell-escape" 28 | %%% End: -------------------------------------------------------------------------------- /5.7.1.2-metadata.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsubsection{Metadata} 2 | \definevariable{author}{} \\ 3 | \definevariable{copyright}{} \\ 4 | \definevariable{language}{} \\ 5 | 6 | Declares \g{metadata} about the \g{document}. The \g{implementation} may use this information and embed it into the output \g{document}. 7 | 8 | %%% Local Variables: 9 | %%% mode: latex 10 | %%% TeX-master: "markless" 11 | %%% TeX-engine: luatex 12 | %%% TeX-command-extra-options: "-shell-escape" 13 | %%% End: -------------------------------------------------------------------------------- /5.7.2-message.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsection{Message} 2 | \defineinstruction{info}{info } 3 | \defineinstruction{warn}{warn } 4 | \defineinstruction{error}{error } \\ 5 | 6 | The \instr{info} instruction causes the \g{implementation} to \glink{signalling}{signal} the given message. 7 | The \instr{warn} instruction causes the \g{implementation} to \glink{signalling}{signal} a \g{warning} with the given message. 8 | The \instr{error} instruction causes the \g{implementation} to \glink{signalling}{signal} an \g{error} with the given message. \\ 9 | 10 | %%% Local Variables: 11 | %%% mode: latex 12 | %%% TeX-master: "markless" 13 | %%% TeX-engine: luatex 14 | %%% TeX-command-extra-options: "-shell-escape" 15 | %%% End: -------------------------------------------------------------------------------- /5.7.3-include.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsection{Include} 2 | \defineinstruction{include}{include } \\ 3 | 4 | Causes the implementation to \glink{interpretation}{interpret} the contents of the given file. If the file is not accessible for some reason, the \g{implementation} must \glink{signalling}{signal} an \g{error}. \\ 5 | 6 | %%% Local Variables: 7 | %%% mode: latex 8 | %%% TeX-master: "markless" 9 | %%% TeX-engine: luatex 10 | %%% TeX-command-extra-options: "-shell-escape" 11 | %%% End: -------------------------------------------------------------------------------- /5.7.4-directives.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsection{Directives} 2 | \defineinstruction{disable}{disable ( )*} 3 | \defineinstruction{enable}{enable ( )*} \\ 4 | 5 | The \instr{disable} and \instr{enable} instructions cause the \g{implementation} to respectively disable or enable the named \gpl{directive}. The name of a directive must be recognised regardless of the case the user writes the directive in. If a given name is not recognised, the \g{implementation} may \glink{signalling}{signal} a \g{warning}. If a user tries to disable the \comp{paragraph} \g{directive}, an \g{error} must be \glink{signalling}{signalled}. \\ 6 | 7 | \begin{examples} 8 | \begin{examplesource} 9 | ! disable instruction 10 | ! error Exit! 11 | \end{examplesource} 12 | \begin{exampleoutput} 13 | ! error Exit! 14 | \end{exampleoutput} 15 | \end{examples} 16 | 17 | %%% Local Variables: 18 | %%% mode: latex 19 | %%% TeX-master: "markless" 20 | %%% TeX-engine: luatex 21 | %%% TeX-command-extra-options: "-shell-escape" 22 | %%% End: 23 | -------------------------------------------------------------------------------- /5.7.5-label.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsection{Label} 2 | \defineinstruction{label}{label } \\ 3 | 4 | Associates a \g{label} with the component that immediately precedes this \g{instruction} at the current level. The \g{implementation} must \glink{signalling}{signal} an \g{error} if there is no preceding component at the current level. \\ 5 | 6 | %%% Local Variables: 7 | %%% mode: latex 8 | %%% TeX-master: "markless" 9 | %%% TeX-engine: luatex 10 | %%% TeX-command-extra-options: "-shell-escape" 11 | %%% End: 12 | -------------------------------------------------------------------------------- /5.7.6-raw.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsection{Raw} 2 | \defineinstruction{raw}{raw } \\ 3 | 4 | If the \g{implementation}'s chosen output backend matches that of the \inline$backend$ \g{binding}, the \g{implementation} should emit the \inline$content$ \g{binding}'s text verbatim into the resulting document. This should allow creating output specific effects. The exact semantics and results of this are \g{implementation dependant}. If the \g{implementation}'s chosen output backend does not match, the instruction is ignored. \\ 5 | 6 | Users should note that basic Markless parsing rules such as backslash escapes still apply for the \inline$content$, so the content is not copied directly 1:1 from the source text to the output document. \\ 7 | 8 | \begin{examples} 9 | \example{! raw latex \\\\textit\{Hello\}}{\textit{Hello}} 10 | \example{! raw html Hello}{} 11 | \end{examples} 12 | 13 | %%% Local Variables: 14 | %%% mode: latex 15 | %%% TeX-master: "markless" 16 | %%% TeX-engine: luatex 17 | %%% TeX-command-extra-options: "-shell-escape" 18 | %%% End: -------------------------------------------------------------------------------- /5.8-comment.tex: -------------------------------------------------------------------------------- 1 | \definesubsection{Comment} 2 | \begin{identifier}{comment} 3 | ;+ .* 4 | \end{identifier} 5 | 6 | The comment is a \g{singular line directive}. If the \ident{comment} \g{identifier} is \glink{match}{matched}, the entire line is skipped and discarded. There is no corresponding \g{resulting textual component} for the comment \g{directive} and as such it must not have any effect on the \g{document}. \\ 7 | 8 | \begin{examples} 9 | \begin{examplesource} 10 | ; This is a stupid thing to say. 11 | Sometimes 12 | ;forever 13 | \end{examplesource} 14 | \begin{exampleoutput} 15 | Sometimes \\ 16 | ;forever 17 | \end{exampleoutput} 18 | \end{examples} 19 | 20 | %%% Local Variables: 21 | %%% mode: latex 22 | %%% TeX-master: "markless" 23 | %%% TeX-engine: luatex 24 | %%% TeX-command-extra-options: "-shell-escape" 25 | %%% End: -------------------------------------------------------------------------------- /5.9-embed.tex: -------------------------------------------------------------------------------- 1 | \definesubsection{Embed} 2 | \begin{identifier}{embed} 3 | \[ (, *)*( *\])? 4 | \end{identifier} 5 | \definetextualcomponent{embed}{display: block;target: target} \\ 6 | 7 | The embed is a \g{singular line directive}. The content of the \inline$type$ binding determines the embed's type, and the \inline$parameter$ bindings determine the embed's parameters. The style of the \g{resulting textual component} is dynamically dependant on the given type. \\ 8 | 9 | Unless the \ident{embed-property-width} or \ident{embed-property-height} parameters are present, the size of the embed \g{resulting textual component} is constrained to be smaller than the width and height of the \g{page} it is output to while preserving the embed content's aspect ratio. If the \g{page} has no width or height, or the embed content's dimensions are smaller than both of those, then the embed content is sized to its own dimensions. The \g{resulting textual component} must not be split across multiple \gpl{page}.\\ 10 | 11 | \input{5.9.1-types.tex} 12 | \input{5.9.2-parameters.tex} 13 | 14 | %%% Local Variables: 15 | %%% mode: latex 16 | %%% TeX-master: "markless" 17 | %%% TeX-engine: luatex 18 | %%% TeX-command-extra-options: "-shell-escape" 19 | %%% End: 20 | -------------------------------------------------------------------------------- /5.9.1-types.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsection{Embed Types} 2 | An \g{implementation} must at least support the types specified in this section if permitted by the output \g{document}, but may add additional options the implications of which are completely \g{implementation dependant}. If the output \g{document} does not support a particular type, a \comp{paragraph} containing a single \comp{url} \g{textual component} is outputted with its target set to the \inline$target$ \g{binding}'s value, its content set to either the content of the \inline$description$ option if present, or the \inline$target$ \g{binding}'s value if not, and a \g{warning} is \glink{signalling}{signalled}. If the \g{implementation} does not support the requested type at all, an \g{error} is \glink{signalling}{signalled}. \\ 3 | 4 | \input{5.9.1.1-image.tex} 5 | \input{5.9.1.2-video.tex} 6 | \input{5.9.1.3-audio.tex} 7 | \input{5.9.1.4-source.tex} 8 | 9 | %%% Local Variables: 10 | %%% mode: latex 11 | %%% TeX-master: "markless" 12 | %%% TeX-engine: luatex 13 | %%% TeX-command-extra-options: "-shell-escape" 14 | %%% End: 15 | -------------------------------------------------------------------------------- /5.9.1.1-image.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsubsection{Image} 2 | \defineidentifier{embed-type-image}{image} 3 | \definestyle{embed-type-image}{interaction: image} \\ 4 | 5 | Embeds the image pointed to by the \inline$target$ into the document. The supported image formats are \g{implementation dependant}. If the format of the target is not supported by the \g{implementation}, the \g{directive} is treated as if it were given an unknown type. \\ 6 | 7 | \begin{examples} 8 | \example{[ image assets/markless-logo.png ]}{\includegraphics[scale=0.5]{assets/markless-logo}} 9 | \end{examples} 10 | 11 | %%% Local Variables: 12 | %%% mode: latex 13 | %%% TeX-master: "markless" 14 | %%% TeX-engine: luatex 15 | %%% TeX-command-extra-options: "-shell-escape" 16 | %%% End: 17 | -------------------------------------------------------------------------------- /5.9.1.2-video.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsubsection{Video} 2 | \defineidentifier{embed-type-video}{video} 3 | \defineidentifier{embed-property-loop}{loop} 4 | \defineidentifier{embed-property-autoplay}{autoplay} 5 | \definestyle{embed-type-video}{interaction: video} \\ 6 | 7 | Embeds the video pointed to by the \inline$target$ into the document. The supported video formats are \g{implementation dependant}. If the format of the target is not supported by the \g{implementation}, the \g{directive} is treated as if it were given an unknown type. The \g{resulting textual component} must be interactive in such a way that the \g{user} is presented with a way to start, pause, seek, and change the volume of the video. The video should not play automatically, unless the \ident{embed-property-autoplay} flag property is present. If the \ident{embed-property-loop} flag property is present, the video should start over from the beginning once it reaches the end. \\ 8 | 9 | \begin{examples} 10 | \example{[ video sample.mp4 ]}{\url{file://./sample.mp4}} 11 | \end{examples} 12 | %%% Local Variables: 13 | %%% mode: latex 14 | %%% TeX-master: "markless" 15 | %%% TeX-engine: luatex 16 | %%% TeX-command-extra-options: "-shell-escape" 17 | %%% End: 18 | -------------------------------------------------------------------------------- /5.9.1.3-audio.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsubsection{Audio} 2 | \defineidentifier{embed-type-audio}{audio} 3 | \defineidentifier{embed-property-loop}{loop} 4 | \defineidentifier{embed-property-autoplay}{autoplay} 5 | \definestyle{embed-type-audio}{interaction: audio} \\ 6 | 7 | Embeds the audio file pointed to by the \inline$target$ into the document. The supported audio formats are \g{implementation dependant}. If the format of the target is not supported by the \g{implementation}, the \g{directive} is treated as if it were given an unknown type. The \g{resulting textual component} must be interactive in such a way that the \g{user} is presented with a way to start, pause, seek, and change the volume of the audio. The audio track should not play automatically, unless the \ident{embed-property-autoplay} flag property is present. If the \ident{embed-property-loop} flag property is present, the audio track should start over from the beginning once it reaches the end. Since an audio file does not have any dimensions associated with it, the \g{implementation} is free to choose the sizing it deems appropriate. \\ 8 | 9 | \begin{examples} 10 | \example{[ audio sample.mp3 ]}{\url{file://./sample.mp3}} 11 | \end{examples} 12 | %%% Local Variables: 13 | %%% mode: latex 14 | %%% TeX-master: "markless" 15 | %%% TeX-engine: luatex 16 | %%% TeX-command-extra-options: "-shell-escape" 17 | %%% End: 18 | -------------------------------------------------------------------------------- /5.9.1.4-source.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsubsection{Source} 2 | \defineidentifier{embed-type-source}{source} 3 | \defineidentifier{embed-property-options}{options } 4 | \defineidentifier{embed-property-language}{language } 5 | \defineidentifier{embed-property-start}{start } 6 | \defineidentifier{embed-property-end}{end } 7 | \defineidentifier{embed-property-encoding}{encoding } 8 | \definestyle{embed-type-source}{font-family: monospace; white-space: preserve} \\ 9 | 10 | Embeds the source code pointed to by the \inline$target$ into the document. To do this, the file is read as a text file in the \g{encoding} specified by \ident{embed-property-encoding}. If the \ident{embed-property-encoding} is not given, UTF-8 \g{encoding} is assumed. If an encoding is requested that the \g{implementation} does not support, an \g{error} is \glink{signalling}{signalled}.\\ 11 | 12 | The file's contents are split into a sequence of lines. If \ident{embed-property-start} is given, as many lines as indicated in its \inline$start$ \g{binding} are discarded from the front. If \ident{embed-property-end} is given, and its \inline$end$ \g{binding} starts with a \unicode{2B}, as many lines as indicated in the \g{binding} are output into the \g{resulting textual component}. If \ident{embed-property-end} is given, but its \g{binding} does not start with \unicode{2B}, the lines until and including the line indicated by the \inline$end$ \g{binding} are output into the \g{resulting textual component}, counting the first line read from the file as the line numbered \inline$1$. \\ 13 | 14 | A line in this context is determined as follows: each line in the file is delimited by either the beginning of the file, the end of the file, or the nearest Linefeed \unicode{A} characters. This means that unlike a Markless \g{line}, the Linefeed \unicode{A} end of line marker cannot be escaped. \\ 15 | 16 | The \ident{embed-property-language} and \ident{embed-property-options} options hold parameters that configure the \g{style} of the \g{resulting textual component}. The syntax and effect of the options is \g{implementation dependant}, but it must be the same as for the \ident{code block} \g{directive}. If a language is requested that the \g{implementation} does not have specific support for, a \g{warning} is \glink{signalling}{signalled}. \\ 17 | 18 | \begin{examples} 19 | \begin{examplesource} 20 | [ source 5.9.1.2-source.tex, language tex, end 2 ] 21 | \end{examplesource} 22 | &$\Rightarrow$&\\ 23 | \begin{tabular}{@{}l@{}} 24 | \begin{lstlisting}[style=codestyle,showstringspaces=false] 25 | \definesubsubsubsection{Source} 26 | \defineidentifier{embed-type-source}{source} 27 | \end{lstlisting} 28 | \end{tabular} 29 | \end{examples} 30 | 31 | 32 | %%% Local Variables: 33 | %%% mode: latex 34 | %%% TeX-master: "markless" 35 | %%% TeX-engine: luatex 36 | %%% TeX-command-extra-options: "-shell-escape" 37 | %%% End: 38 | -------------------------------------------------------------------------------- /5.9.2-parameters.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsection{Embed Parameters} 2 | The parameters are processed in the order they are given and can effect both the content of the \g{resulting textual component} as well as its \g{style}. A parameter may also affect the processing of parameters after it. Two general types of parameters are defined: flag parameters and value parameters. Flag parameters are single parameters that add or remove an attribute from the \g{resulting textual component}'s \g{style}. Value parameters add an attribute whose value is determined by the parameter following the current one. The following parameter is then skipped over and thus not processed. \\ 3 | 4 | An \g{implementation} must at least support the parameters specified in this section if permitted by the output \g{document}, but may add additional parameters the implications of which are completely \g{implementation dependant}. If the output \g{document} does not support a particular parameter, or an unknown parameter is given, a \g{warning} is \glink{signalling}{signalled}. \\ 5 | 6 | \input{5.9.2.1-float.tex} 7 | \input{5.9.2.2-width.tex} 8 | \input{5.9.2.3-height.tex} 9 | \input{5.9.2.4-label.tex} 10 | \input{5.9.2.5-caption.tex} 11 | \input{5.9.2.6-description.tex} 12 | 13 | %%% Local Variables: 14 | %%% mode: latex 15 | %%% TeX-master: "markless" 16 | %%% TeX-engine: luatex 17 | %%% TeX-command-extra-options: "-shell-escape" 18 | %%% End: 19 | -------------------------------------------------------------------------------- /5.9.2.1-float.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsubsection{Float} 2 | \defineidentifier{embed-property-float}{float } 3 | \definestyle{embed-property-float}{float: orientation} \\ 4 | 5 | Causes the embed to float on either the left or right side of the \g{document}. All the \gpl{resulting textual component} after it will flow around it. 6 | 7 | %%% Local Variables: 8 | %%% mode: latex 9 | %%% TeX-master: "markless" 10 | %%% TeX-engine: luatex 11 | %%% TeX-command-extra-options: "-shell-escape" 12 | %%% End: 13 | -------------------------------------------------------------------------------- /5.9.2.2-width.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsubsection{Width} 2 | \defineidentifier{embed-property-width}{width (|)} 3 | \definestyle{embed-property-width}{width: size} \\ 4 | 5 | Causes the embed content's width to be fixed to the specified size. The size can be given in either \inline$pixels$ or \inline$percent$ where \inline$pixels$ will set the width to be the exact amount of pixels given if the document is viewed at its native resolution. \inline$percent$ will scale the width to the given percentage of the width of the \g{document}. If the \g{document} should not have a width, the \inline$percent$ specification does nothing. Unless the \ident{embed-property-height} is also specified, the embed content's aspect ratio must be preserved. \\ 6 | 7 | \begin{examples} 8 | \example{[ image assets/markless-logo.png, width 50px ]}{\includegraphics[width=50px]{assets/markless-logo}} 9 | \end{examples} 10 | 11 | %%% Local Variables: 12 | %%% mode: latex 13 | %%% TeX-master: "markless" 14 | %%% TeX-engine: luatex 15 | %%% TeX-command-extra-options: "-shell-escape" 16 | %%% End: 17 | -------------------------------------------------------------------------------- /5.9.2.3-height.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsubsection{Height} 2 | \defineidentifier{embed-property-height}{height (|)} 3 | \definestyle{embed-property-height}{height: size} \\ 4 | 5 | Causes the embed content's height to be fixed to the specified size. The size can be given in either \inline$pixels$ or \inline$percent$ where \inline$pixels$ will set the height to be the exact amount of pixels given if the document is viewed at its native resolution. \inline$percent$ will scale the height to the given percentage of the height of the \g{document}. If the \g{document} should not have a height, the \inline$percent$ specification does nothing. Unless the \ident{embed-property-width} is also specified, the embed content's aspect ratio must be preserved. \\ 6 | 7 | \begin{examples} 8 | \example{[ image assets/markless-logo.png, width 50px, height 100px ]}{\includegraphics[width=50px,height=100px]{assets/markless-logo}} 9 | \end{examples} 10 | 11 | %%% Local Variables: 12 | %%% mode: latex 13 | %%% TeX-master: "markless" 14 | %%% TeX-engine: luatex 15 | %%% TeX-command-extra-options: "-shell-escape" 16 | %%% End: 17 | -------------------------------------------------------------------------------- /5.9.2.4-label.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsubsection{Label} 2 | \defineidentifier{embed-property-label}{label } \\ 3 | 4 | Causes the embed to be associated with a \g{label} of the given \inline$name$. \\ 5 | 6 | %%% Local Variables: 7 | %%% mode: latex 8 | %%% TeX-master: "markless" 9 | %%% TeX-engine: luatex 10 | %%% TeX-command-extra-options: "-shell-escape" 11 | %%% End: -------------------------------------------------------------------------------- /5.9.2.5-caption.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsubsection{Caption} 2 | \defineidentifier{embed-property-caption}{caption } 3 | \definestyle{embed-property-caption}{interaction: image} \\ 4 | 5 | Causes a \g{textual component} to be output either alongside or within the embed's \g{textual component}. The text may contain any \gpl{inline directive}. The \g{text} held by the \g{content binding} is outputted to this additional \g{resulting textual component}. The text can only contain \gpl{inline directive}.\\ 6 | 7 | \begin{examples} 8 | \longexample{[ image assets/markless-logo.png, caption The //Markless// logo image. ]}{\begin{minipage}{.98\linewidth} 9 | \begin{center} 10 | \includegraphics[height=2cm]{assets/markless-logo} 11 | \end{center} 12 | \vspace{-1cm} 13 | \captionof{figure}{The \textit{Markless} logo image.} 14 | \end{minipage}} 15 | \end{examples} 16 | 17 | %%% Local Variables: 18 | %%% mode: latex 19 | %%% TeX-master: "markless" 20 | %%% TeX-engine: luatex 21 | %%% TeX-command-extra-options: "-shell-escape" 22 | %%% End: 23 | -------------------------------------------------------------------------------- /5.9.2.6-description.tex: -------------------------------------------------------------------------------- 1 | \definesubsubsubsection{Description} 2 | \defineidentifier{embed-property-description}{description } \\ 3 | 4 | A textual description of the embed's content for use when the embed content cannot be displayed, or when the \g{user} employs a reader or other form of aid system that relies entirely on textual representation. 5 | 6 | %%% Local Variables: 7 | %%% mode: latex 8 | %%% TeX-master: "markless" 9 | %%% TeX-engine: luatex 10 | %%% TeX-command-extra-options: "-shell-escape" 11 | %%% End: -------------------------------------------------------------------------------- /6-inline-directives.tex: -------------------------------------------------------------------------------- 1 | \definesection{Inline Directives} 2 | A \g{directive} is an \g{inline directive} if its identification is not bound to \gpl{line}. Unlike \gpl{line directive} therefore it can potentially be identified at any point in a string and span any length. \\ 3 | 4 | Any \g{textual component} specified by an \g{inline directive} can only contain \gpl{textual component} specified by \gpl{inline directive}. An \g{inline directive} may further restrict which \gpl{directive} may appear within itself. An \g{inline directive} cannot cross the boundaries of another \g{directive} of a different kind. If such a case were to occur, the current \g{inline directive} is forcibly ended without regard for any possible trailing \g{match}. A special exception is made in the case of \gpl{spanning line directive}: since a \g{spanning line directive} is the combination of multiple matches of the same kind on consecutive lines into a singular \g{textual component}, an \g{inline directive} must be allowed to span over multiple matches. 5 | 6 | \definesubsubsection{Surrounding Inline Directives} 7 | An \g{inline directive} is a \g{surrounding inline directive} if its \g{identifier} contains syntactical features around a \g{content binding}. \\ 8 | 9 | When a \g{surrounding inline directive} is \glink{processing}{processed}, processing begins anew over the \g{content binding} until the the part of the \g{identifier} after the \g{content binding} is \glink{full match}{fully matched}, at which point the \g{resulting textual component} is ended and control is handed back to the \g{standard processing loop}. 10 | 11 | \definesubsubsection{Entity Inline Directives} 12 | An \g{inline directive} is an \g{entity inline directive} if its \g{identifier} does not contain any \syntax{binding}s and instead the \g{text} of the \g{resulting textual component} is entirely dependant on the \g{entity inline directive} specification. \\ 13 | 14 | When a \g{entity inline directive} is \glink{processing}{processed}, the \g{resulting textual component} is ended once the \g{identifier} has been \glink{full match}{fully matched}. Then control is handed back to the \g{standard processing loop}. 15 | 16 | \definesubsubsection{Compound Inline Directives} 17 | An \g{inline directive} is a \g{compound inline directive} if its \g{identifier} consists of multiple \syntax{binding}s the contents of which are in some form outputted to the \g{resulting textual component}. \\ 18 | 19 | \input{6.1-bold.tex} 20 | \input{6.2-italic.tex} 21 | \input{6.3-underline.tex} 22 | \input{6.4-strikethrough.tex} 23 | \input{6.5-code.tex} 24 | \input{6.6-dashes.tex} 25 | \input{6.7-subtext.tex} 26 | \input{6.8-supertext.tex} 27 | \input{6.9-url.tex} 28 | \input{6.10-compound.tex} 29 | \input{6.11-footnote-reference.tex} 30 | \input{6.12-newline.tex} 31 | 32 | %%% Local Variables: 33 | %%% mode: latex 34 | %%% TeX-master: "markless" 35 | %%% TeX-engine: luatex 36 | %%% TeX-command-extra-options: "-shell-escape" 37 | %%% End: 38 | -------------------------------------------------------------------------------- /6.1-bold.tex: -------------------------------------------------------------------------------- 1 | \definesubsection{Bold} 2 | \defineidentifier{bold}{\\*\\*\\*\\*} 3 | \definetextualcomponent{bold}{font-weight: bold} \\ 4 | 5 | The bold \g{directive} is a \g{surrounding inline directive} that marks the \g{text} to belong to a \g{textual component} that sets the weight of the font to bold. Only the \g{text} held by the \g{content binding} is outputted to the \g{resulting textual component}. \\ 6 | 7 | \begin{examples} 8 | \example{not **bold** at all}{not \textbf{bold} at all} 9 | \example{and **some *things* are bad**}{and \textbf{some *things* are bad}} 10 | \end{examples} 11 | 12 | %%% Local Variables: 13 | %%% mode: latex 14 | %%% TeX-master: "markless" 15 | %%% TeX-engine: luatex 16 | %%% TeX-command-extra-options: "-shell-escape" 17 | %%% End: 18 | -------------------------------------------------------------------------------- /6.10-compound.tex: -------------------------------------------------------------------------------- 1 | \definesubsection{Compound} 2 | \defineidentifier{compound}{''''\\(