| Author | DaveJarvis <email> |
|---|---|
| Date | 2025-09-01 17:09:33 GMT-0700 |
| Commit | 7ce5bd7602029b74b46124920d381c2f6525f6df |
| Parent | 7aacf6a |
| Delta | 27 lines added, 29 lines removed, 2-line decrease |
| ### Edit document | ||
| -Edit the document as normal. Notice how the preview pane updates as new content is added. The toolbar shows various icons that perform different formatting operations. Try them to see how they appear in the preview pane. Other operations not shown on the toolbar include: | ||
| +Edit the document as normal. Notice how the preview tab updates as new content is added. The toolbar shows various icons that perform different formatting operations. Try them to see how they appear in the preview tab. Other operations not shown on the toolbar include: | ||
| * Struck text (enclose the words within `~~` and `~~`) | ||
| * Horizontal rule (use `---` on an otherwise empty line). | ||
| -The preview pane shows one way to interpret and format the document, but many other presentations are possible. | ||
| +The preview tab shows one way to interpret and format the document, but many other presentations are possible. | ||
| ### Insert variable | ||
| ``` | ||
| -The preview pane shows: | ||
| +The preview tab shows: | ||
| > The novel "Diary of Anne Frank" is a widely read book. | ||
| Typing variable names is laborious. Use autocomplete to inject variable names as follows: | ||
| 1. Create a new file. | ||
| 1. Type in a partial variable value, such as `Dia`. | ||
| -1. Press [ConTeXt Ctrl+Space]{.kbd} (hold down the [Control]{.kbd} key and tap [SPACE]{.kbd}). | ||
| +1. Press [Ctrl+Space]{.kbd} (hold down the [Control]{.kbd} key and tap [SPACE]{.kbd}). | ||
| The editor shows: | ||
| ``` | ||
| {{novel.title}} | ||
| ``` | ||
| -The preview pane shows: | ||
| +The preview tab shows: | ||
| > Diary of Anne Frank | ||
| -The variable name is inserted into the document and the preview pane shows the variable's value. | ||
| +The variable name is inserted into the document and the preview tab shows the variable's value. | ||
| On Linux, simple usages include: | ||
| -```bash | ||
| +``` bash | ||
| keenwrite.bin -i $HOME/document/01.md -o document.xhtml | ||
| keenwrite.bin -i $HOME/document/01.md -o document.md \ | ||
| -v $HOME/document/variables.yaml | ||
| ``` | ||
| That command will convert `01.md` into the respective file formats. In the first case, it will become an HTML page. In the second case, it will become a Markdown document with all variables interpolated and replaced. | ||
| A more complex example follows: | ||
| -```bash | ||
| +``` bash | ||
| keenwrite.bin \ | ||
| -i $HOME/document/01.Rmd \ | ||
| Directory or file names containing spaces must be quoted. For example, on Windows: | ||
| -```bash | ||
| +``` bash | ||
| keenwrite.bin -i "C:\Users\My Documents\01.Rmd" -o document.pdf | ||
| ``` | ||
| 1. Click **Save**. | ||
| -Setting the file name extension tells the application what processor to use when transforming the contents for display in the preview pane. Continue by typing in the following text, including the backticks: | ||
| +Setting the file name extension tells the application what processor to use when transforming the contents for display in the preview tab. Continue by typing in the following text, including the backticks: | ||
| ```r | ||
| `r#1 + 1` | ||
| ``` | ||
| -The preview pane shows the result of `1` plus `1`: | ||
| +The preview tab shows the result of `1` plus `1`: | ||
| ``` |
| 1. Run **install.bat** to download and install the software. | ||
| * If prompted, click **Run anyway** (or click **More info** first). | ||
| -1. Right-click [localpath.bat](https://repo.autonoma.ca/keenwrite.git/raw/HEAD/scripts/localpath.bat). | ||
| -1. Select **Save Link As** (or similar). | ||
| +1. Download [localpath.bat](https://repo.autonoma.ca/keenwrite.git/raw/HEAD/scripts/localpath.bat). | ||
| 1. Save the file to the typesetting software's "root" directory. | ||
| 1. Rename `localpath.bat.txt` to `localpath.bat`, if necessary. | ||
| export LOCAL_FILE=context-linuxmusl-64.zip | ||
| export CONTEXT_DIR="${HOME}/${LOCAL_DIR}" | ||
| - export CONTEXT_BIN="tex/texmf-linux-64/bin" | ||
| mkdir -p "${CONTEXT_DIR}" | ||
| cd "${CONTEXT_DIR}" | ||
| wget "https://lmtx.pragma-ade.nl/install-lmtx/${LOCAL_FILE}" | ||
| unzip ${LOCAL_FILE} | ||
| rm ${LOCAL_FILE} | ||
| chmod +x install.sh | ||
| ./install.sh | ||
| echo export CONTEXT_DIR=\"\${HOME}/${LOCAL_DIR}" \ | ||
| >> ${HOME}/.bashrc | ||
| - echo PATH="\"\${PATH}:\${CONTEXT_DIR}/${CONTEXT_BIN}\"" \ | ||
| + echo PATH="\"\${PATH}:\${CONTEXT_DIR}/tex/texmf-linux-64/bin\"" \ | ||
| >> ${HOME}/.bashrc | ||
| source ${HOME}/.bashrc | ||
| A fenced div has the following basic syntax: | ||
| -```markdown | ||
| +``` markdown | ||
| ::: name | ||
| Content | ||
| ::: | ||
| ``` | ||
| To start a fenced div, begin a line with at least three colons (`:::`), followed by at least one space, followed by any word. Content may follow immediately on the next line. Terminate the fenced div with at least three colons. The terminating colons needn't match in number to the starting colons, but it's a good idea to maintain symmetry. | ||
| The XHTML that is generated from the above fenced div will resemble: | ||
| -```html | ||
| +``` html | ||
| <div class="name"> | ||
| <p>Content</p> | ||
| A fenced div may use an extended syntax. The extended syntax can provide a unique identifier, multiple class names, and key/value data pairs. For example: | ||
| -```markdown | ||
| +``` markdown | ||
| ::: {#poem-01 .stanza author="Emily Dickinson" year=1890} | ||
| Because I could not stop for Death -- | ||
| The above snippet produces: | ||
| -```html | ||
| +``` html | ||
| <div id="poem-01" class="stanza" data-author="Emily Dickinson" data-year="1890"> | ||
| <p>Because I could not stop for Death – | ||
| Fenced divs may be nested, such as in the following example: | ||
| -```markdown | ||
| +``` markdown | ||
| ::: poem | ||
| :::::: stanza | ||
| The above example produces: | ||
| -```html | ||
| +``` html | ||
| <div class="poem"><div class="stanza"> | ||
| <p>Because I could not stop for Death – | ||
| For images, add the caption line as follows: | ||
| -```markdown | ||
| +``` markdown | ||
|  | ||
| Caption tables in a similar manner: | ||
| -```markdown | ||
| +``` markdown | ||
| | a | b | c | | ||
| |---|---|---| | ||
| Equations are the same: | ||
| -```markdown | ||
| +``` markdown | ||
| $$E = mc^2$$ | ||
| Consider this example illustrating an image with an anchor and cross-reference: | ||
| -```markdown | ||
| +``` markdown | ||
| In [@fig:animal], a cute animal is shown. | ||
| Anchors can include a wide variety of type names and labels, such as: | ||
| -```markdown | ||
| +``` markdown | ||
| {#fig:cats} | ||
| {#図版:猫} | ||
| 1. Change the content to the following: | ||
| - ```css | ||
| + ``` css | ||
| .root { | ||
| -fx-base: rgb( 30, 30, 30 ); |
| ## Equations | ||
| -[@fig:screenshot-tex] shows TeX equations in a detached preview pane: | ||
| +[@fig:screenshot-tex] shows TeX equations in a detached preview tab: | ||
|  |
| [@fig:architecture] illustrates the high-level application architecture for converting Markdown documents. The architecture is a processing pipeline that transforms raw Markdown content through multiple stages to produce the final output. | ||
| -```diagram-graphviz | ||
| +``` diagram-graphviz | ||
| digraph { | ||
| node [fontname = "Noto Sans" fontsize=6 height=.25 penwidth=.5]; |