gesetze-tools icon indicating copy to clipboard operation
gesetze-tools copied to clipboard

Normalize Markdown syntax

Open nichtich opened this issue 11 years ago • 2 comments

Mardown allows for alternative syntax variants, for instance how to create headings, lists, whitespace, etc. Unless we agree on one normalized form, there will be many forms of exactely the same document, leading to different forms of diffs and commits that only origin from changes in markdown syntax. Luckily there is an easy method to normalize via pandoc:

pandoc -f markdown -t markdown index.md

With normalization one can also create a hash of the actual text instead of a hash of one particular form of the text.

See also issue #4 to remove metadata from the laws (right now the metadata is interpreted as markdown table).

nichtich avatar Aug 11 '12 18:08 nichtich

Good idea. Ideally the Markdown will be generated from the XML in canonical format. But the XML contains style changes like inserted line breaks etc. that could lead to unnecessary changes. Something like normalizing too many line breaks is definitely nice.

stefanw avatar Aug 11 '12 18:08 stefanw

Maybe we should agree on some Markdown source format. Are the original line breaks important for the laws? If not, what about putting every sentence in a separate line in the markdown file. This way, diffs are reproducible and can still be rendered according to the viewer size.

darkdragon-001 avatar Mar 29 '21 23:03 darkdragon-001