sx — semantic export tool
Section 1: user commands · version 2.4.0
Synopsis
Placeholders you replace are <var>; literal command text
is <code>:
sx [--format fmt] [--out file] input…
Description
sx converts documents to validated semantic HTML. Given
input files, it writes to file or standard output.
A typical invocation:
sx --format html --out guide.html chapter-*.md
On success it prints a summary — program output is
<samp>:
3 files converted, 0 errors, 0 warnings guide.html written (41 kB)
Interrupt a long run with Ctrl+C; suspend
with Ctrl+Z and resume by typing
fg. Note the nesting: each physical key is its own
<kbd> inside the keystroke's <kbd>.
Options
--format fmt- Output format. One of
html,xhtml, orfragment. Defaults tohtml. --out file- Write to file instead of standard output.
--strict- Treat validator warnings as errors. Exit status 2 on any finding.
-q,--quiet- Suppress the summary line.
Exit status
- 0
- Success.
- 1
- Usage error — the message goes to standard error, for example sx: unknown option '--formt' (did you mean '--format'?).
- 2
- Validation failed under
--strict.
Environment
The variable SX_CACHE overrides the cache directory. An interactive session, mixing all four computer-text elements:
$ SX_CACHE=/tmp/sx sx --strict draft.md
draft.md:12:3: warning: heading level skipped (h2 → h4)
1 file converted, 0 errors, 1 warning
sx: exiting 2 (--strict)