Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git

Adds metadata, footnotes extension, updates user manual

AuthorDaveJarvis <email>
Date2025-09-02 11:27:57 GMT-0700
Commite906bd219222f06e9958397dd6fab4c8ca619710
Parenteb66e87
build.gradle
implementation "com.vladsch.flexmark:flexmark-ext-tables:${v_flexmark}"
implementation "com.vladsch.flexmark:flexmark-ext-typographic:${v_flexmark}"
+ implementation "com.vladsch.flexmark:flexmark-ext-footnotes:${v_flexmark}"
// YAML
docs/01-introduction.md
{{app.title}} is a free desktop editor to help transform Markdown documents
-into beautifully typeset PDFs. Whether you're crafting technical documentation,
-reports, or creative content, {{app.title}} layers high-quality publishing
-capabilities onto the simplicity and readability of Markdown.
+into beautifully typeset PDF files. Whether you're crafting technical
+documentation, reports, or creative content, {{app.title}} layers high-quality
+publishing capabilities onto the simplicity and readability of Markdown.
## Tooling
-The text editor has the following tools:
+The editor has the following tools:
* User-defined variables with auto-completion
-* Real-time spell checking and document statistics
-* Interactive document outline for easy navigation
-* Internationalization support (fonts, word counts)
+* Real-time spell checking
* Integrated file manager
+* Interactive document outline
+* Internationalization support (fonts)
+* Document heuristics
+* Word count
-## Typesetting
+## Exports
-Transform Markdown into publication-quality documents:
+From either the editor or the command-line, Markdown can be converted to:
-* PDF file exports by applying customizable themes
-* Render math using plain TeX notation
+* PDF
+* XHTML
+
+When exporting as XHTML, mathematical expressions can be output as:
+
+* TeX notation (KaTeX or MathJax)
+* SVG images
+
+When exporting to a PDF file, TeX-based typesetting software renders the
+expressions directly.
## Visualizations
Enrich documents with diagrams, data visualizations, and multimedia
elements:
+* Input math using plain TeX notation
* Render text-based diagrams (Mermaid, GraphViz, PlantUML, and more)
* R integration for statistical analysis and data plots
docs/02-variables.md
```
-The novel "{{novel.title}}" is a widely read book.
+The novel _{{novel.title}}_ is a widely read book.
```
The preview tab shows:
-> The novel "Diary of Anne Frank" is a widely read book.
+> 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 [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:
docs/04-cmd.md
``` 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
+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"
```
``` bash
keenwrite.bin \
- -i $HOME/document/01.Rmd \
+ -i "${HOME}/document/01.Rmd" \
-o document.pdf \
- --image-dir=$HOME/document/images \
- -v $HOME/document/variables.yaml \
+ --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
+ --r-dir="${HOME}/document/r" \
+ --r-script="${HOME}/document/r/bootstrap.R" \
+ --theme-dir="${HOME}/document/themes/boschet"
```
docs/07-typesetting.md
1. Start the text editor.
1. Click **File → Export As → PDF**.
- * Note the following details (e.g., Windows X86 64-bit):
- * operating system name;
- * instruction set; and
- * architecture.
-1. Click the [link](https://wiki.contextgarden.net/Installation) in the dialog.
+1. Track the following details (e.g., Windows X86 64-bit):
+ * operating system name;
+ * instruction set; and
+ * architecture.
+1. Click the [link](https://wiki.contextgarden.net/Introduction/Installation) in the dialog.
1. Download the appropriate archive file.
1. Extract the `.zip` file into `C:\Users\%USERNAME%\AppData\Local\context` (the "root" directory).
1. Run **install.bat** to download and install the software.
- * If prompted, click **Run anyway** (or click **More info** first).
+ * If prompted, click **Run anyway** (or click **More info** first).
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.
docs/build.sh
#!/usr/bin/env bash
+readonly SCRIPT_SRC="$(dirname "${BASH_SOURCE[${#BASH_SOURCE[@]} - 1]}")"
+readonly SCRIPT_DIR="$(cd "${SCRIPT_SRC}" >/dev/null 2>&1 && pwd)"
+
keenwrite.bin \
$1 \
- --curl-quotes=regular \
--debug \
--all \
--chapters="1-" \
-i 01-introduction.md \
-o user-manual.pdf \
--variables=$(pwd)/metadata.yaml \
+ --metadata=title={{document.title}} \
+ --metadata=subtitle={{document.subtitle}} \
+ --metadata=copyright={{document.copyright}} \
+ --metadata=version=$(git describe --tags --abbrev=0) \
--theme-dir="$HOME/dev/java/keenwrite/themes/texomus"
docs/metadata.yaml
title: "{{app.title}}"
subtitle: User Manual
+ copyright: White Magic Software, Ltd.
app:
title: KeenWrite
docs/user-manual.pdf
Binary files differ
src/main/java/com/keenwrite/processors/markdown/BaseMarkdownProcessor.java
import com.keenwrite.processors.markdown.extensions.spans.BracketedSpanExtension;
import com.vladsch.flexmark.ext.definition.DefinitionExtension;
+import com.vladsch.flexmark.ext.footnotes.FootnoteExtension;
import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughSubscriptExtension;
import com.vladsch.flexmark.ext.superscript.SuperscriptExtension;
extensions.add( CrossReferenceExtension.create() );
extensions.add( CaptionExtension.create() );
+ extensions.add( FootnoteExtension.create() );
extensions.add( EscapedQuotesExtension.create() );
extensions.add( BracketedSpanExtension.create() );
Delta51 lines added, 30 lines removed, 21-line increase