{"id":13993911,"url":"https://github.com/ickc/pancritic","last_synced_at":"2025-10-27T16:22:00.293Z","repository":{"id":49521704,"uuid":"56901729","full_name":"ickc/pancritic","owner":"ickc","description":"using criticmarkup in the pandoc markdown source","archived":false,"fork":false,"pushed_at":"2021-04-15T21:13:55.000Z","size":1421,"stargazers_count":55,"open_issues_count":7,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-29T05:04:57.834Z","etag":null,"topics":["markdown","pandoc","pandoc-filter","pandoc-filters"],"latest_commit_sha":null,"homepage":"https://ickc.github.io/pancritic/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ickc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["ickc"]}},"created_at":"2016-04-23T05:13:30.000Z","updated_at":"2025-03-20T10:34:13.000Z","dependencies_parsed_at":"2022-08-25T23:00:52.677Z","dependency_job_id":null,"html_url":"https://github.com/ickc/pancritic","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickc%2Fpancritic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickc%2Fpancritic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickc%2Fpancritic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ickc%2Fpancritic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ickc","download_url":"https://codeload.github.com/ickc/pancritic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249205580,"owners_count":21229952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["markdown","pandoc","pandoc-filter","pandoc-filters"],"created_at":"2024-08-09T14:02:37.238Z","updated_at":"2025-10-27T16:22:00.229Z","avatar_url":"https://github.com/ickc.png","language":"Python","funding_links":["https://github.com/sponsors/ickc"],"categories":["Python"],"sub_categories":[],"readme":"\u003c!--This README is auto-generated from `docs/README.md`. Do not edit this file directly.--\u003e\n\n  - [Definition of CriticMarkup](#definition-of-criticmarkup)\n  - [Installation](#installation)\n  - [Usage: pancritic as a markdown wrapper (including but not limited\n    to\n    pandoc)](#usage-pancritic-as-a-markdown-wrapper-including-but-not-limited-to-pandoc)\n      - [pancritic specific options](#pancritic-specific-options)\n      - [Previous Users](#previous-users)\n      - [Advanced Usage: pancritic as a pandoc\n        preprocessor](#advanced-usage-pancritic-as-a-pandoc-preprocessor)\n  - [Caveats](#caveats)\n      - [LaTeX Ouptut](#latex-ouptut)\n  - [Credits](#credits)\n\n[![Build\nStatus](https://travis-ci.org/ickc/pancritic.svg?branch=master)](https://travis-ci.org/ickc/pancritic)\n[![GitHub\nReleases](https://img.shields.io/github/tag/ickc/pancritic.svg?label=github+release)](https://github.com/ickc/pancritic/releases)\n[![PyPI\nversion](https://img.shields.io/pypi/v/pancritic.svg)](https://pypi.python.org/pypi/pancritic/)\n[![Development\nStatus](https://img.shields.io/pypi/status/pancritic.svg)](https://pypi.python.org/pypi/pancritic/)\n[![Python\nversion](https://img.shields.io/pypi/pyversions/pancritic.svg)](https://pypi.python.org/pypi/pancritic/)\n\u003c!-- [![Downloads](https://img.shields.io/pypi/dm/pancritic.svg)](https://pypi.python.org/pypi/pancritic/) --\u003e\n![License](https://img.shields.io/pypi/l/pancritic.svg)\n[![Coveralls](https://img.shields.io/coveralls/ickc/pancritic.svg)](https://coveralls.io/github/ickc/pancritic)\n\u003c!-- [![Scrutinizer](https://img.shields.io/scrutinizer/g/ickc/pancritic.svg)](https://scrutinizer-ci.com/g/ickc/pancritic/) --\u003e\n\nUsing CriticMarkup with pandoc. It serves both as a wrapper and a\npre-processor.\n\n# Definition of CriticMarkup\n\n  - Deletions: This is {--is --}a test.\n  - Additions: This {++is ++}a test.\n  - Substitutions: This {\\~\\~isn’t\\~\\\u003eis\\~\\~} a test.\n  - Highlighting: This is a {==test==}.\n  - Comments: This is a test{\\\u003e\\\u003eWhat is a test for?\\\u003c\\\u003c}.\n\n# Installation\n\nInstall using\n\n``` bash\npip install pancritic\n```\n\n# Usage: pancritic as a markdown wrapper (including but not limited to pandoc)\n\npancritic provides a pandoc-like cli. Pandoc users will feel right at\nhome. See help from\n\n``` bash\npancritic -h\n```\n\nA typical use of pancritic will be like\n\n``` bash\npancritic -s -o index.html index.md\n```\n\nSee examples in [HTML](tests.html) and [PDF](tests.pdf).\n\n## pancritic specific options\n\n  - `--engine`  \n    The default engine is `markdown`. Valid options are `markdown`,\n    `markdown2`, `panflute`, `pypandoc`. You need to install the\n    respective package in order to use them. `markdown` and `markdown2`\n    are pure Python, hence useful for other CPU architechture.\n    `panflute` and `pypandoc` both uses pandoc as backend.\n\n  - `-m`|`--critic-mode`  \n    a/accept, r/reject: accept/reject changes.\n    \n    d/diff: generates a diff. In HTML output, JS is used for toggling\n    between diff, accept, reject.\n    \n    m/markup: treat the CriticMarkup as Markup. i.e. in HTML output\n    there isn’t any toggles but the diff view only. In LaTeX output,\n    diff and markup modes are identical except for an additional nav.\n    `-m m` should be used with LaTeX output.\n\n## Previous Users\n\n### Previous Users of pandoc-criticmarkup\n\nThis is completely rewritten in Python. The cli has been completely\nchanged too. The former options of `-a`, `-r`, `-d` are replaced with\n`-m a`, `-m r`, `-m d`, and added a `-m m`.\n\n### Previous Users of `criticParser_CLI.py`\n\nThis is a heavy fork of `criticParser_CLI.py`, with these differences:\n\n1.  CLI has changed, with a more pandoc-like interface.\n2.  Python 3 (and 2) compatible.\n3.  Bug fixes (formerly hightlight without comment are parsed\n    incorrectly).\n4.  It has much more input/output format options as well as engines.\n\nExamples,\n\n``` bash\ncriticParser_CLI.py input.md -m2 -o output.html --css css.html\n# is equivalent to\npancritic -o output.html input.md --critic-template css.html --engine markdown2\n```\n\n## Advanced Usage: pancritic as a pandoc preprocessor\n\nA somewhat surprising behavior is when the to-format and output\nextension is different. In pancritic, the to-format indicates the\nCriticMarkup parsing behavior (mainly tex vs. html). And the output\nextension controls the final output’s format (e.g. markdown, html, etc.)\n\nAn interesting use of this is to use pancritic as a pandoc preprocessor\ninstead, like this\n\n``` bash\npancritic input.md -t markdown -m m | pandoc -s -o output.html\n```\n\nThis will be useful if more advanced pandoc args are needed.\n\n# Caveats\n\n  - Nesting CriticMarkup might have unexpected behavior, especially in\n    LaTeX output. See [the caveats section in the spec of\n    CriticMarkup](http://criticmarkup.com/spec.php#caveats).\n\n  - mainly tested with HTML and LaTeX output. RST output almost works,\n    but injecting CSS/JS into the output causes some problems.\n    Currently, it can be get arround with `--critic-template` and\n    injecting the CSS/JS manually. See `pancritic/template.py` for the\n    template used.\n\n## LaTeX Ouptut\n\nNote that the LaTeX output requires the LaTeX packages\n`changes\u003e=3`.\\[1\\]\n\nOne can tell pandoc to use this package by either using a custom\ntemplate or `--include-in-header` option. Or you can use the trick of\nputting the following in your YAML front matter, like this file:\n\n``` yaml\n---\nfontfamily: lmodern,changes\n...\n```\n\nMarkdown within the CriticMarkup will not be rendered in LaTeX output.\nIf you want to change this behavior, you can take a look at: [LaTeX\nArgument\nParser](https://gist.github.com/mpickering/f1718fcdc4c56273ed52).\n\n| CriticMarkup             | LaTeX                         |\n| ------------------------ | ----------------------------- |\n| `{--[text]--}`           | `\\deleted{[text]}`            |\n| `{++[text]++}`           | `\\added{[text]}`              |\n| `{~~[text1]~\u003e[text2]~~}` | `\\replaced{[text2]}{[text1]}` |\n| `{==[text]==}`           | `\\highlight{[text]}`          |\n| `{\u003e\u003e[text]\u003c\u003c}`           | `\\comment{[text]}`            |\n\nTranslation from CriticMarkup to LaTeX.\n\n# Credits\n\n  - Heavily modified from [CriticMarkup Toolkit’s\n    criticParser\\_CLI.py](http://criticmarkup.com/services.php)\n  - [tests.md](tests.md) is modified from [MMD-Test-Suite/Critic.text at\n    master ·\n    fletcher/MMD-Test-Suite](https://github.com/fletcher/MMD-Test-Suite/blob/master/CriticMarkup/Critic.text)\n\n\u003c!-- end list --\u003e\n\n1.  The version of the package in TeXLive 2018 is still v2.\n    [TeXLive 2019 should be available\n    on 2019-4-30](https://www.tug.org/texlive/), meanwhile you need to\n    \n    ``` bash\n    # sudo is needed in most cases, depending on where you put it\n    sudo tlmgr update --self\n    sudo tlmgr update changes\n    # check it is \u003e=3\n    tlmgr info changes\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fickc%2Fpancritic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fickc%2Fpancritic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fickc%2Fpancritic/lists"}