Compares the two documents semantically, rather than as text, and reports how their nodes correspond and differ. Neither document is presumed correct: they are simply the left and right snapshots that you selected.
Exits with 0 when the documents are equal, 1 when they differ, and 2 on error.
stencila compare [OPTIONS] <LEFT> <RIGHT> [OUTPUT]
# Compare two documents in the terminal
stencila compare before.smd after.smd
# Compare documents in different formats
stencila compare original.smd roundtripped.docx
# Only report how many differences there are
stencila compare before.smd after.smd --summary
# Open a side-by-side view of the comparison in a browser
stencila compare before.smd after.smd --view
# Write the side-by-side view to a HTML file, without opening it
stencila compare before.smd after.smd comparison.html
# Write the comparison artifact as JSON to stdout
stencila compare before.smd after.smd --to json
# Write the comparison artifact to a file
stencila compare before.smd after.smd comparison.yaml
# Ignore differences that are only about identifiers
stencila compare before.smd after.jats.xml --exclude id
# Ignore identifiers everywhere except on figures
stencila compare before.smd after.jats.xml --exclude id --include Figure.id
# Ignore everything about links, and JATS reference types anywhere
stencila compare before.smd after.jats.xml --exclude Link --exclude jatsRefType
# Report nothing but heading differences
stencila compare before.smd after.smd --exclude all --include Heading
# Override the format of an input document
stencila compare before.txt after.smd --left-from smd
Possible values of --input-losses