Crate stanhope

Source
Expand description

Stanhope, named after the Stanhope Printing Press that improved upon Gutenberg’s design by using sturdy iron and steel parts and hand levers to increase printing speed and quality.

This application takes an input argument file in a specific markup and produces a static, printable HTML page based on the markup file’s contents.

The real power in this application is the markup language, which has these features:

  • Single-purpose: just for writing processes that can be printed as documents
  • General: suitable for writing any process
  • Consistent: output branding and style is centrally controlled for 100% consistent processes in an organization’s library
  • Visually flexible: custom templates can mold the look/feel of the HTML produced
  • Format rigid: we want process authors to think carefully to help operators in the field, and Stanhope forces authors to conform to pre-thought out process language and structure that solves this

Modules§

read_csv 🔒
Interpret a well-formatted CSV file into a set of initialized Process structs, one for each row
read_ebml 🔒
Read a markup file and return a robust Process struct
write_ebml 🔒
Write an EBML file using a prototype, and some basic information about a new process
write_html 🔒
Write a single HTML file from a single EBML file input
write_script 🔒
Write various kinds of script files into a Process folder from the Commands
write_webmenu 🔒
Write a single HTML file that serves as a Web Menu for all processes in a Process Library

Structs§

StanhopeArgs 🔒
Command Line Interface (CLI) argument structure

Functions§

archive_single_process 🔒
Perform OS functions to stash a copy of all working material for a process
attempt_fallbacks 🔒
Gracefully cycle through ordered OS commands until one of them works
copy_dir_all 🔒
Recursive copy of all contents in one folder to another
copy_files_all 🔒
Copy everything that ISN’T a directory… just the files
globify_document_number
Accept wildcard statements describing a subset of process folders, and return all matches
list_directories_to_cleanup 🔒
File management: return a vector of directories eligible to delete as a “cleanup” operation
main 🔒
Run Stanhope in one of (or more!) of its modes
print_filename_audit_to_stdout 🔒
Look into each process folder, read the EBML, find the Number and Title, check consistency, print findings to stdout
print_graphics_audit_to_stdout 🔒
Look into each process folder, read the EBML, find the images, and check to see if they exist, print findings to stdout
print_title_block_to_stdout 🔒
Utility function to print a box outline around text in stdout, perhaps for a title