This library enables the transfer of text changes from one document to another, while preserving unique tokens in the destination document.
These tokens must be context-free, which is generally quite an issue, but certain formats such as Markdown and Wiki can handle it OK.
- Suspender - Removes the given set of tokens from the document, storing them in an offsets table (lossless).
- Unsuspender - Joins a base document and an offsets table together to procude a single output document.
- TextReplayer - Push changes from one document to another while preserving unique tokens in the destination document.
- RelativeSuspendedTokens - (De)serialize a tab-delimited syntax for the offsets.
- TokenReplacer - Push token offsets from one document to another.
- TokenRemover - Remove tokens from a document.
Run entire spec suite:
rake
or just run a single spec file:
ruby specs/repositext_tokens_spec.rb
suspend push text from-file to-file [-tokens]
TextReplayer.new(from-text, to-text).replay
suspend push [:subtitle_mark] from-file to-file
TokenReplacer.new(from-text,to-text, Suspension::REPOSITEXT_TOKENS, Suspension::REPOSITEXT_TOKENS).replace([:subtitle_mark]) --> to_file
suspend strip frome-file to-file [-tokens]
Suspender.new(from-text,Suspension::REPOSITEXT_TOKENS).suspend.filtered_text
suspend export from-file to-file [-tokens]
Exports the token offset list.
Suspender.new(from-text,Suspension::REPOSITEXT_TOKENS).suspend.suspended_tokens.to_relative.serialize
suspend import offset-file text-file, to-file
Merges the offset and text file
Retaining repositext tokens in AT.
Retaining plain text and other repositext tokens in AT.
Retaining kramdown-subset tokens, discarding at-specific tokens.
Retaining all other tokens in AT V1.