pub const EXAMPLES_TOML: &str = "# The examples `datui --help`, the manpages, the command-line reference and the\n# README show, in order. Each runs exactly as written, on a fresh install.\n#\n# command What to type.\n# description What it does, in one line.\n# test How scripts/docs/doc_examples.py runs it:\n# run locally, in an empty directory, on every pull request\n# network in the nightly job: it reads public data\n# interactive locally; its producer never ends and is stopped once\n# the first rows show\n# expect What counts as working, when it is not the default: `rows` (the\n# table shows rows; the default when it opens something), `screen`\n# (a screen that stays up, such as the home screen), `exit` (a command\n# that prints and exits 0; the default for subcommands)\n# pages The manpages whose EXAMPLES show it, as NAME.SECTION (default\n# [\"datui.1\"]); `datui --help` shows those of datui.1, and\n# `datui COMMAND --help` those of datui-COMMAND.1\n# files Files the command reads, written into its directory first and shown\n# above it: [{ name = \"config.toml\", text = \"\"\"...\"\"\" }]. Never\n# create a file in the command itself\n\n[[example]]\ncommand = \"datui\"\ndescription = \"Open the home screen. Example datasets lists the catalog that comes with datui\"\ntest = \"run\"\n\n[[example]]\ncommand = \"datui https://vincentarelbundock.github.io/Rdatasets/csv/palmerpenguins/penguins.csv\"\ndescription = \"Palmer penguins from the web\"\ntest = \"network\"\n\n[[example]]\ncommand = \"datui s3://noaa-ghcn-pds/parquet/by_year/YEAR=2024/ELEMENT=TMAX/\"\ndescription = \"NOAA daily highs for 2024, one table from public S3\"\ntest = \"network\"\n\n[[example]]\ncommand = \"datui --hive \'s3://noaa-ghcn-pds/parquet/by_year/YEAR=2024/ELEMENT=T*/*.parquet\'\"\ndescription = \"A glob, read as one partitioned table: every 2024 element starting with T\"\ntest = \"network\"\n\n[[example]]\ncommand = \"datui abfss://release@overturemapswestus2.dfs.core.windows.net/\"\ndescription = \"Overture Maps releases in public Azure storage, listed on the home screen\"\ntest = \"network\"\nexpect = \"screen\"\n\n[[example]]\ncommand = \"datui https://huggingface.co/openai-community/gpt2/resolve/main/model.safetensors\"\ndescription = \"A model\'s tensors, read from its header without downloading the weights\"\ntest = \"network\"\n\n[[example]]\ncommand = \"printf \'id,amount\\\\n1,9.50\\\\n2,3.25\\\\n\' | datui\"\ndescription = \"Data piped in; the format is read from its first bytes\"\ntest = \"run\"\n\n[[example]]\ncommand = \"journalctl -o json -n 1000 | datui\"\ndescription = \"The last 1,000 systemd journal entries, a column per field\"\ntest = \"run\"\n\n[[example]]\ncommand = \"(echo time,value; while sleep 0.2; do echo \\\"$(date +%s),$RANDOM\\\"; done) | datui -f -\"\ndescription = \"Rows as they arrive; t pauses, Esc stops following\"\ntest = \"interactive\"\n\n[[example]]\ncommand = \"datui --hex /bin/sh\"\ndescription = \"A file\'s bytes in the hex view\"\ntest = \"run\"\nexpect = \"screen\"\n\n[[example]]\ncommand = \"datui -c display.row_numbers=true https://vincentarelbundock.github.io/Rdatasets/csv/palmerpenguins/penguins.csv\"\ndescription = \"Any config key, for this run\"\ntest = \"network\"\n\n[[example]]\ncommand = \"datui config init\"\ndescription = \"Write the config file, every key commented out at its default\"\ntest = \"run\"\npages = [\"datui.1\", \"datui-config.1\", \"datui-config.5\"]\n\n[[example]]\ncommand = \"datui formats\"\ndescription = \"List the format specs and dictionaries datui finds\"\ntest = \"run\"\npages = [\"datui.1\", \"datui-formats.1\"]\n\n[[example]]\ncommand = \"datui man keys\"\ndescription = \"The keys of every screen, as a manual page\"\ntest = \"run\"\npages = [\"datui.1\", \"datui-man.1\", \"datui-keys.7\"]\n\n[[example]]\ncommand = \"datui catalog show examples\"\ndescription = \"Print the catalog datui ships, the worked example of the format\"\nexpect = \"exit\"\ntest = \"run\"\npages = [\"datui.1\", \"datui-catalog.1\"]\n\n[[example]]\ncommand = \"datui catalog show\"\ndescription = \"List the catalogs: id, label, datasets and file\"\nexpect = \"exit\"\ntest = \"run\"\npages = [\"datui-catalog.1\"]\n\n[[example]]\ncommand = \"datui catalog check team.toml\"\nfiles = [\n { name = \"team.toml\", text = \"\"\"\nlabel = \"Team data\"\n\n[orders]\nname = \"Orders\"\npath = \"data/orders.parquet\"\ndescription = \"Every order, one row each\"\ncolumns.status = { description = \"Where the order is\", values = { P = \"Placed\", S = \"Shipped\" } }\n\"\"\" },\n]\ndescription = \"Check a catalog file and list its datasets\"\nexpect = \"exit\"\ntest = \"run\"\npages = [\"datui-catalog.1\"]\n\n[[example]]\ncommand = \"datui theme list\"\ndescription = \"List the themes: name, the mode it is set for, file and description\"\nexpect = \"exit\"\ntest = \"run\"\npages = [\"datui-theme.1\"]\n\n[[example]]\ncommand = \"datui theme show night-market\"\ndescription = \"Print the built-in dark theme with every slot, a file to start a theme from\"\nexpect = \"exit\"\ntest = \"run\"\npages = [\"datui-theme.1\"]\n\n[[example]]\ncommand = \"datui config path\"\ndescription = \"The config files read, lowest precedence first\"\ntest = \"run\"\npages = [\"datui-config.1\", \"datui-config.5\"]\n\n[[example]]\ncommand = \"datui config keys -c display.row_numbers=true\"\ndescription = \"Every key: its type, default, the value in effect and what set it, here -c\"\ntest = \"run\"\npages = [\"datui-config.1\"]\n\n[[example]]\ncommand = \"DATUI_CONFIG_DIR=. datui config keys\"\nfiles = [\n { name = \"config.toml\", text = \"\"\"\n[display]\nrow_numbers = true\n\"\"\" },\n]\ndescription = \"The values a config file in the current directory sets\"\ntest = \"run\"\npages = [\"datui-config.5\"]\n\n[[example]]\ncommand = \"datui cache clear --recents\"\ndescription = \"Forget the recent datasets and keep the rest of the cache\"\ntest = \"run\"\npages = [\"datui-cache.1\"]\n\n[[example]]\ncommand = \"datui cache clear\"\ndescription = \"Clear the whole cache: recents, prompt history, schemas and copies\"\ntest = \"run\"\npages = [\"datui-cache.1\"]\n\n[[example]]\ncommand = \"datui views list\"\ndescription = \"The saved views: name, the files each matches, when last used\"\ntest = \"run\"\npages = [\"datui-views.1\"]\n\n[[example]]\ncommand = \"python3 make_pairs.py && datui formats check ./pairs.toml t.pairs\"\nfiles = [\n { name = \"pairs.toml\", text = \"\"\"\nname = \"demo.pairs\"\nmatch = { glob = [\"*.pairs\"] }\n\n[records]\nfields = [{ name = \"a\", type = \"u1\" }, { name = \"b\", type = \"u1\" }]\n\"\"\" },\n { name = \"make_pairs.py\", text = \"\"\"\n# Two records of two one-byte fields: (1, 2) and (3, 4).\nwith open(\"t.pairs\", \"wb\") as f:\n f.write(bytes([1, 2, 3, 4]))\n\"\"\" },\n]\ndescription = \"Check a format spec of two one-byte fields against a file of two records, and print the rows it reads\"\ntest = \"run\"\npages = [\"datui-formats.1\"]\n\n[[example]]\ncommand = \"mkdir -p ~/.local/share/bash-completion/completions && datui completions bash > ~/.local/share/bash-completion/completions/datui\"\ndescription = \"Bash completion for your user; new shells load it through bash-completion\"\ntest = \"run\"\npages = [\"datui-completions.1\"]\n\n[[example]]\ncommand = \"mkdir -p ~/.config/fish/completions && datui completions fish > ~/.config/fish/completions/datui.fish\"\ndescription = \"fish completion for your user\"\ntest = \"run\"\npages = [\"datui-completions.1\"]\n\n[[example]]\ncommand = \"mkdir -p ~/.zfunc && datui completions zsh > ~/.zfunc/_datui\"\ndescription = \"zsh completion; add fpath+=~/.zfunc before compinit in ~/.zshrc\"\ntest = \"run\"\npages = [\"datui-completions.1\"]\n\n[[example]]\ncommand = \"datui man --list\"\ndescription = \"The manual pages and what each covers\"\ntest = \"run\"\npages = [\"datui-man.1\"]\n\n[[example]]\ncommand = \"datui man --dir ~/.local/share/man\"\ndescription = \"Write every page where man finds them for your user, as after cargo install\"\ntest = \"run\"\npages = [\"datui-man.1\"]\n";Expand description
The examples: --help shows them, and the manpage, the command-line reference and
the README render them. One file, so they cannot differ; each runs as written, and
scripts/docs/doc_examples.py runs them.