criticmarkup
Fast CriticMarkup preprocessor with multiple output formats (AsciiDoc, Markdown, LaTeX).
Install
With uv:
uv tool install criticmarkup
With pip:
python -m pip install criticmarkup
Dev install (uv)
uv sync --extra dev
Usage
Convert a file (format inferred from extension):
criticmarkup convert input.md --in-place
Read from stdin, write to stdout:
cat input.md | criticmarkup convert --format markdown
Override a preset template:
criticmarkup convert input.md --addition-replacement-template "<ins>{CURRENT}</ins>"
Change list placeholder
If the input contains {+-~TOC-CHANGES~-+}, it will be replaced with a generated list of change IDs/notes.
Examples
Markdown → Markdown
Input (doc.md):
Intro paragraph.
{+-~TOC-CHANGES~-+}
We {++add new text++} here.
We {--remove old text--} here.
We {~~replace this~>with that~~} here.
We can {==highlight==} something.
And leave a {>>reviewer note<<} comment.
Command:
criticmarkup convert doc.md --in-place
Output (doc.md):
Intro paragraph.
- [addition-1](#addition-1): Added "add new text"
- [deletion-1](#deletion-1): Deleted "remove old text"
- [substitution-1](#substitution-1): Changed "replace this" to "with that"
We <a id="addition-1"></a><!-- Added "add new text" -->
<ins>add new text</ins> here.
We <a id="deletion-1"></a><!-- Deleted "remove old text" -->
<del>remove old text</del> here.
We <a id="substitution-1"></a><!-- Changed "replace this" to "with that" -->
<del>replace this</del><ins>with that</ins> here.
We can <mark>highlight</mark> something.
And leave a <!-- reviewer note --> comment.
AsciiDoc → AsciiDoc
Input (doc.adoc):
Intro paragraph.
{+-~TOC-CHANGES~-+}
We {++add new text++} here.
We {--remove old text--} here.
We {~~replace this~>with that~~} here.
We can {==highlight==} something.
And leave a {>>reviewer note<<} comment.
Command:
criticmarkup convert doc.adoc --in-place
Output (doc.adoc):
Intro paragraph.
- <<addition-1>>
- <<deletion-1>>
- <<substitution-1>>
We [[addition-1, Added "add new text"]]
[red]#*add new text*# here.
We [[deletion-1, Deleted "remove old text"]]
footnote:[In previous version this said "remove old text"] here.
We [[substitution-1, Changed "replace this" to "with that"]]
[red]#*with that*#
footnote:[In previous version this said "replace this"] here.
We can [yellow]#highlight# something.
And leave a footnote:[reviewer note] comment.
LaTeX → LaTeX
Input (doc.tex):
Intro paragraph.
{+-~TOC-CHANGES~-+}
We {++add new text++} here.
We {--remove old text--} here.
We {~~replace this~>with that~~} here.
We can {==highlight==} something.
And leave a {>>reviewer note<<} comment.
Command:
criticmarkup convert doc.tex --in-place
Output (doc.tex):
Intro paragraph.
\item addition-1: Added "add new text"
\item deletion-1: Deleted "remove old text"
\item substitution-1: Changed "replace this" to "with that"
We % addition-1: Added "add new text"
\underline{{add new text}} here.
We % deletion-1: Deleted "remove old text"
\sout{{remove old text}} here.
We % substitution-1: Changed "replace this" to "with that"
\sout{{replace this}}\underline{{with that}} here.
We can \fbox{{highlight}} something.
And leave a % NOTE: reviewer note comment.
Metadata
Release files for criticmarkup 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| criticmarkup-0.1.1.tar.gz | 38.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| criticmarkup-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 46.3 kB
Release files / criticmarkup-0.1.1.tar.gz
| Download URL | criticmarkup-0.1.1.tar.gz |
|---|---|
| Size | 38.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d9f94ff445414c493382e7eb6e5af4aa48055ee1efe8ebedcac30bf1cc74fd41
|
|
BLAKE2b-256 checksum How to use checksums |
7f170c964d484d671e152f5bd5996d21bf6cefe83048b1b514705ed01748a06c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / criticmarkup-0.1.1-py3-none-any.whl
| Download URL | criticmarkup-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e4f9d5d2059e6867f7948e8a7c6b0f1f1e3af139ed5ccfa1203b96997f4c6fac
|
|
BLAKE2b-256 checksum How to use checksums |
cb97837bb7071d0358c03f5861bee6dd831cd28d6a7703cc99801aec0fccdc0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|