Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

CriticMarkup Syntax highlighting support within the Txt editor #41

Open
shibacomputer opened this issue Mar 6, 2020 · 0 comments
Open

Comments

@shibacomputer
Copy link
Owner

shibacomputer commented Mar 6, 2020

Txt uses CriticMarkup to track changes within a document. This is because each document created or edited with Txt must be inter-operable in other applications with minimal data loss. Embedding comments, changes, substitutions and other simple document edits in a plaintext document fits the scope of this philosophy.

As per the spec, CriticMarkup uses a simple set of actions for editing and annotating plain text: addition {++ ... ++}, deletion {-- ... --}, substitution {~~ ... ~> ... ~~}, comment {>> <<}, and highlight {== ... ==}{>> ... <<}

Our text editor component for Txt is currently Codemirror (although this isn't a hard requirement), and the app's basic Markdown highlighting support needs to be extended to detect instances of key CriticMarkup syntax, and apply the colours as found in the defined in Txt's definitions.css file. For convenience, the CSS variables are:

var(--comment)
var(--deletion)
var(--addition)
var(--substitute)
var(--highlight-background)
var(--highlight-foreground)
@shibacomputer shibacomputer changed the title Syntax highlighting for documents via CriticMarkup CriticMarkup Syntax highlighting support within the Txt editor Mar 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant