| Author | DaveJarvis <email> |
|---|---|
| Date | 2025-08-29 18:24:04 GMT-0700 |
| Commit | 249c9c2bc61bf981fed00e7381f7a90adebd4db8 |
| Parent | 0d6122a |
| Delta | 51 lines added, 44 lines removed, 7-line increase |
| ``` | ||
| -Variables can reference other variables by bookending the key name within symbols: | ||
| +Variables can reference other variables by bookending the key name within symbols, provided the reference is enclosed in quotation marks: | ||
| ``` | ||
| key: Value | ||
| -key_1: {{key}} 1 | ||
| -key_2: {{key}} 2 | ||
| +key_1: "{{key}} 1" | ||
| +key_2: "{{key}} 2" | ||
| ``` | ||
| author: Author Name | ||
| copyright: | ||
| - owner: {{novel.author}} | ||
| + owner: "{{novel.author}}" | ||
| ``` | ||
| ``` yaml | ||
| novel: | ||
| - title: Diary of {{novel.author}} | ||
| - author: Anne Frank | ||
| + title: "Diary of {{novel.author}}" | ||
| + author: "Anne Frank" | ||
| ``` | ||
| ```bash | ||
| -keenwrite.bin -i $HOME/document/01.Rmd -o document.pdf \ | ||
| - --image-dir=$HOME/document/images -v $HOME/document/variables.yaml \ | ||
| - --metadata="title={{book.title}}" --metadata="author={{book.author}}" \ | ||
| - --r-dir=$HOME/document/r --r-script=$HOME/document/r/bootstrap.R \ | ||
| +keenwrite.bin \ | ||
| + -i $HOME/document/01.Rmd \ | ||
| + -o document.pdf \ | ||
| + --image-dir=$HOME/document/images \ | ||
| + -v $HOME/document/variables.yaml \ | ||
| + --metadata="title={{book.title}}" \ | ||
| + --metadata="author={{book.author}}" \ | ||
| + --r-dir=$HOME/document/r \ | ||
| + --r-script=$HOME/document/r/bootstrap.R \ | ||
| --theme-dir=$HOME/document/themes/boschet | ||
| ``` | ||
| That command will convert `01.Rmd` to `document.pdf` and replace the metadata using values from the variable definitions file. | ||
| -Directory names containing spaces must be quoted. For example, on Windows: | ||
| +Directory or file names containing spaces must be quoted. For example, on Windows: | ||
| ```bash |
| node [fontname = "Noto Sans" fontsize=6 height=.25 penwidth=.5]; | ||
| edge [fontname = "Noto Sans" fontsize=6 penwidth=.5 arrowsize=.5]; | ||
| - node [shape=box color="{{keenwrite.palette.primary.light}}" fontcolor="{{keenwrite.palette.primary.dark}}"] | ||
| - edge [color="{{keenwrite.palette.grayscale.light}}" fontcolor="{{keenwrite.palette.grayscale.dark}}"] | ||
| - {{keenwrite.classes.processors.variable.definition}} -> {{keenwrite.classes.processors.markdown}} [xlabel="{{keenwrite.graph.label.chain.next}} "] | ||
| - {{keenwrite.classes.processors.markdown}} -> {{keenwrite.classes.processors.preview}} [xlabel="{{keenwrite.graph.label.chain.next}} "] | ||
| - {{keenwrite.classes.processors.markdown}} -> Extensions [label=" contains"] | ||
| + node [shape=box color="{{app.palette.primary.light}}" fontcolor="{{app.palette.primary.dark}}"] | ||
| + edge [color="{{app.palette.grayscale.light}}" fontcolor="{{app.palette.grayscale.dark}}"] | ||
| + {{app.classes.processors.variable.definition}} -> {{app.classes.processors.markdown}} [xlabel="{{app.graph.label.chain.next}} "] | ||
| + {{app.classes.processors.markdown}} -> {{app.classes.processors.preview}} [xlabel="{{app.graph.label.chain.next}} "] | ||
| + {{app.classes.processors.markdown}} -> Extensions [label=" contains"] | ||
| Extensions -> FencedBlockExtension | ||
| Extensions -> CaretExtension | ||
| ## Extension System Architecture | ||
| -An extension is an addition to the Markdown parser, flexmark-java, that is used when converting the document's abstract syntax tree into an HTML document. The {{keenwrite.classes.processors.markdown}} contains both prepackaged and custom extensions. This extensible architecture allows for specialized processing of various Markdown elements, enabling support for advanced features like mathematical expressions, enhanced image handling, and custom block types. | ||
| +An extension is an addition to the Markdown parser, flexmark-java, that is used when converting the document's abstract syntax tree into an HTML document. The {{app.classes.processors.markdown}} contains both prepackaged and custom extensions. This extensible architecture allows for specialized processing of various Markdown elements, enabling support for advanced features like mathematical expressions, enhanced image handling, and custom block types. | ||
| 1. Edit the vector graphics file using any text editor. | ||
| -2. Find `version="1.1"` and change it to `version="1.2"`. | ||
| -3. Save the file. | ||
| +1. Find `version="1.1"`. | ||
| +1. Change the version to: `version="1.2"`. | ||
| +1. Save the file. | ||
| The SVG will now appear inside the application; however, the text may appear as black blocks. | ||
| ## Black blocks | ||
| This section explains why text elements may render as solid black rectangles and provides steps to resolve this rendering issue. | ||
| -Depending on how text is added to a vector graphic in Inkscape, the text may be inserted within an element called a `flowRoot`. Although Batik recognizes `flowRoot` for SVG version 1.2, it cannot fully interpret the contents. Black blocks are drawn instead of the text, such as those depicted in [@fig:blocked-text]: | ||
| +Depending on how text is added to a vector graphic in Inkscape, the text may be inserted within an element called a `flowRoot`. Although Batik recognizes `flowRoot` for SVG version 1.2, it cannot fully interpret the contents. Black blocks are drawn instead of the text, such as those depicted in [@fig:blocked-text]. | ||
|  | ||
| 1. Start Inkscape. | ||
| -2. Load the SVG file. | ||
| -3. Select all the text elements. | ||
| -4. Click **Text → Unflow**. | ||
| +1. Load the SVG file. | ||
| +1. Select all the text elements. | ||
| +1. Click **Text → Unflow**. | ||
| The text may change size and position; recreate the text without dragging using the text tool. After all the text areas have been recreated, continue as follows: | ||
| 1. Click **Edit → XML Editor**. | ||
| -2. Expand the **XML Editor** to see more elements. | ||
| -3. Delete all elements named `svg:flowRoot`. | ||
| -4. Save the file. | ||
| +1. Expand the **XML Editor** to see more elements. | ||
| +1. Delete all elements named `svg:flowRoot`. | ||
| +1. Save the file. | ||
| When the illustration is reloaded, the black blocks will have disappeared, but the text elements ignore any assigned colour. | ||
| 1. Open the SVG file in a plain text editor. | ||
| -2. Remove all references `-inkscape-font-specification:'<FONT>';`, including the trailing (or leading) semicolon. | ||
| -3. Save the file. | ||
| +1. Remove all references `-inkscape-font-specification:'<FONT>';`, including the trailing (or leading) semicolon. | ||
| +1. Save the file. | ||
| [@fig:resolved-text] shows colours having reappeared after reloading: | ||
| ```markdown | ||
| ::: {#poem-01 .stanza author="Emily Dickinson" year=1890} | ||
| -Because I could not stop for Death — | ||
| -He kindly stopped for me — | ||
| -The Carriage held but just Ourselves — | ||
| +Because I could not stop for Death -- | ||
| +He kindly stopped for me -- | ||
| +The Carriage held but just Ourselves -- | ||
| And Immortality. | ||
| ::: | ||
| ``` | ||
| The above snippet produces: | ||
| ```html | ||
| <div id="poem-01" class="stanza" data-author="Emily Dickinson" data-year="1890"> | ||
| -<p>Because I could not stop for Death — | ||
| -He kindly stopped for me — | ||
| -The Carriage held but just Ourselves — | ||
| +<p>Because I could not stop for Death -- | ||
| +He kindly stopped for me -- | ||
| +The Carriage held but just Ourselves -- | ||
| And Immortality.</p> | ||
| </div> | ||
| ::: poem | ||
| :::::: stanza | ||
| -Because I could not stop for Death — | ||
| -He kindly stopped for me — | ||
| -The Carriage held but just Ourselves — | ||
| +Because I could not stop for Death -- | ||
| +He kindly stopped for me -- | ||
| +The Carriage held but just Ourselves -- | ||
| And Immortality. | ||
| :::::: | ||
| ::: | ||
| ``` | ||
| The above example produces: | ||
| ```html | ||
| <div class="poem"><div class="stanza"> | ||
| -<p>Because I could not stop for Death — | ||
| -He kindly stopped for me — | ||
| -The Carriage held but just Ourselves — | ||
| +<p>Because I could not stop for Death -- | ||
| +He kindly stopped for me -- | ||
| +The Carriage held but just Ourselves -- | ||
| And Immortality.</p> | ||
| </div></div> | ||
| #!/usr/bin/env bash | ||
| -#keenwrite.bin \ | ||
| -java -jar /tmp/keenwrite.jar \ | ||
| +keenwrite.bin \ | ||
| + $1 \ | ||
| --debug \ | ||
| --all \ |
| document: | ||
| - title: KeenWrite | ||
| + title: "{{app.title}}" | ||
| subtitle: User Manual | ||
| -keenwrite: | ||
| +app: | ||
| + title: KeenWrite | ||
| classes: | ||
| processors: |