Command line
self turns documents into web pages and PDFs without the app. Use it in scripts, in a site's
build, or to print a folder of documents at once.
self render report.self --plugins -o site/report.html
self pdf report.self
Get it
#Download the command line for your system from the Download page and unzip it
anywhere. Nothing is installed. Keep the selfscribe-embed folder next to self: it draws the
charts, diagrams and maths. On macOS and Linux, run it as ./self, or add its folder to your
PATH.
Make a web page
#self render report.self --standalone -o report.html
self render report.self --plugins -o site/report.html
--standalone writes a whole page with the document's look and title. Without it you get the
document's HTML alone, to put in a page of your own. --plugins writes a page that draws the
charts, diagrams and data views as it opens, and copies the script that does it into
site/selfscribe-embed/. Move that folder with the page.
Make a PDF
#self pdf report.self
self pdf tune.self -o tune.pdf --page Letter --landscape
The first line writes report.pdf beside the document. A browser already on your computer
prints it without opening a window: Edge, Chrome, Chromium or Brave. The paper is the
document's own set page, and --page and --landscape choose another for this PDF.
--wait 60 gives slow blocks longer to draw.
Check, tidy and watch a document
#self check report.self
self fmt --full -w report.self
self watch report.self --plugins -o report.html
check lists the problems and ends with an error status when there are any. fmt writes every
rule in its full form, or the short one with --short. watch writes the page again each time
the document, or a file it uses, changes.
Know the options
#| Option | What it does |
--root DIR | Where imports are read from. Without it, the nearest folder above with a selfscribe.self. |
--browser PATH | The browser that prints. Also SELFSCRIBE_BROWSER. |
--plugins=DIR | Where selfscribe-embed is. Also SELFSCRIBE_EMBED. |
--no-plugins | A PDF with blocks as their text. |
serve --stdio | Parse and render requests as lines of JSON, for another program. |
self --help lists every command, and self render --help the options of one.