[← README](../../README.md) · [Docs index](../README.md) · [Customising](README.md) # Modules: choose the viewers Coxswain shows many kinds of file in their own way: a PDF as its pages, a game on its board, a spreadsheet as a table, a diagram drawn. Each of those viewers belongs to a **module**, and you can turn off the modules you do not want loaded, in both apps. A file whose module is off is shown as text or hex, like any file with no viewer of its own. All modules are on until you turn one off, so nothing changes until you do, and a module a later version brings comes on by itself: Coxswain keeps the list of modules you turned off, not of those you turned on. ![The desktop app's Settings at Modules, in the Cyber theme: Modules outlined between Previews and Games on the left; on the right each module with its checkbox, its endings, what it uses and Show me, the ones that may download a container image with a downloads badge, and Chess games unticked](../screenshots/gui-settings-modules.png) *Settings at Modules with Chess games turned off, opened with `coxswain-gui --settings=modules`.* ## Contents - [How to use it](#how-to-use-it) - [The modules](#the-modules) - [What you see when a module is off](#what-you-see-when-a-module-is-off) - [What stays whatever is off](#what-stays-whatever-is-off) - [config.toml](#configtoml) - [The older switches](#the-older-switches) - [Building without some modules](#building-without-some-modules) - [Questions](#questions) ## How to use it | Where | Desktop app | Terminal app | |---|---|---| | Settings | **Ctrl+,** or **F12**, then *Modules* on the left: a checkbox per module | **F12**, then *Modules* (**Tab** moves between the areas): **Space** or **Enter** turns the module under the cursor on or off | | Straight there | `coxswain-gui --settings=modules` | `coxswain --settings=modules` | | First-run guide | Its last step says viewers can be turned off; **Choose modules** opens Settings at *Modules* | Its last step says *Viewers you do not need can be turned off: F12 → Modules* (your Settings key) | | By hand | `[modules] off = ["games"]` in `config.toml` | The same file | Each module's row shows its name, the endings it shows, the libraries and programs it uses, and *may download a container image* where it can draw a file with a container when its program is not installed (the desktop app marks those with the *downloads* badge). In the desktop app **Show me** opens the module's own page; the terminal app names the page in the line at the bottom. A change is saved to `config.toml` at once and used straight away, by the panel you are in as much as by the next file. ![The terminal app's Settings at Modules, Classic blue: Modules chosen on the left; on the right the heading Viewers and every module with [x], the cursor on [ ] Chess games; at the bottom its endings, uses cozy-chess, stockfish and docs/previews/chess.md](../screenshots/tui-settings-modules.png) ## The modules | Module | `[modules] off` name | Shows | Uses | |---|---|---|---| | [Documents](../previews/documents.md) | `documents` | PDF, Word (`.docx`), EPUB, Jupyter notebooks, XPS, reStructuredText, AsciiDoc, Typst, PostScript, mail (`.eml`, `.msg`), calendars, contacts | mammoth, Asciidoctor.js, marked, KaTeX, mail-parser, cfb; pandoc, typst, Ghostscript, asciidoctor-pdf | | [PowerPoint and Office](../previews/office.md) | `office` | What LibreOffice opens and Coxswain cannot draw itself (`.doc`, `.pptx`, `.odt` …) | pptx-to-html; LibreOffice | | [E-books](../previews/ebooks.md) | `ebooks` | MOBI, Kindle, FictionBook, LIT, comics (`.cbz`) | jszip; calibre | | [LaTeX projects](../previews/latex.md) | `latex` | `.tex`, `.ltx` | latexmk, tectonic, pdflatex | | [HTML pages](../previews/html.md) | `html` | `.html`, `.htm`, `.xhtml`, drawn sandboxed | DOMPurify | | [Diagrams](../previews/diagrams.md) | `diagrams` | Graphviz, Mermaid, PlantUML, D2, ditaa, Svgbob, Pikchr, nomnoml, WaveDrom, Vega, DBML, ERD, bytefield, draw.io | Viz.js, Mermaid; dot, plantuml, d2, drawio, Kroki | | [OpenSCAD](../previews/openscad.md) | `openscad` | `.scad` models | openscad | | [KiCad](../previews/kicad.md) | `kicad` | Schematics and boards | kicad-cli | | [Data files](../previews/data.md) | `data` | Spreadsheets, SQLite, dBase, Parquet, DuckDB, property lists, certificates | SheetJS, rusqlite, parquet, hyparquet, plist, x509-parser; duckdb | | [Media and files](../previews/media.md) | `media` | Pictures, video, sound, HEIF, camera raw, fonts | lofty, kamadak-exif; ffmpeg, ImageMagick | | [Old pictures and files](../previews/old-formats.md) | `old_formats` | TIFF, TGA, Netpbm, DDS, HDR, EXR, QOI, JPEG XL and the like; tracker music | image, jxl-oxide | | [Geodata](../previews/geodata.md) | `geodata` | Shapefiles, GeoJSON, KML, GPX and the rest of GDAL's vector formats | GDAL | | [Neural network models](../previews/neural-networks.md) | `neural_networks` | ONNX, TensorFlow Lite, Core ML, Keras; local models (GGUF, safetensors) | Netron | | [Chess games](../previews/chess.md) | `games` | Chess, Go, draughts, shogi, xiangqi and bridge files, opening books | cozy-chess; stockfish | | [Cryptography bills of materials](../previews/bom.md) | `bom` | CycloneDX BOMs and CBOMs | | | [Build provenance](../previews/provenance.md) | `provenance` | In-toto attestations, Sigstore bundles | x509-parser | | [Disk images](../files/disk-images.md) | `disk_images` | The facts of `.iso`, `.vhd`, `.vmdk` and other disk images | 7-Zip | Each module is named in Settings after its entry in F1 → Features (*E-books: MOBI, Kindle, FictionBook*, *Disk images, CHM and CBR* …), in your language; the first column links its page. *Chess games* covers every board game Coxswain shows: chess, Go, draughts, shogi, xiangqi and bridge. No module sends your files anywhere; the ones that may download a container image say so, and what can leave the machine is listed under [Settings → Privacy and updates](settings.md#privacy-and-updates). ## What you see when a module is off - **The preview (desktop app)** shows the file's text, or its first bytes in hex when it is no text. A PDF shows its first bytes; a PGN file its moves as text. - **F3** in either app opens the file in the text viewer instead of its own viewer. - **Enter** on a games file, an opening book or a disk image does what it does with any file (its program), and does not open the games board or the image. - **Open games** (the chess action) says that the module is off. - **The first time** a file of a module that is off is shown, the status line says *Shown as text: Chess games is off. Turn it on in Settings (F12) → Modules.* (with your Settings key). It is said once per module. ## What stays whatever is off Folders, archives and everything inside them, text and code, logs, data files (JSON, YAML, TOML), Markdown and hex belong to no module: they are what every file falls back to. Find reads what it reads either way: a module decides only what the apps show (the preview, **F3**, **Enter** on games and disk images, *Open games*, Find's game hits), not what search reads. Actions on files (*Convert video or audio*, *Convert e-book*, *Export the model*, *Make searchable* …) stay in the action menu too. ## config.toml ```toml [modules] # The modules left out, by name (see the table above). Empty, or no [modules]: all are on. off = ["games", "neural_networks"] ``` A name Coxswain does not know is ignored, and Settings drops it when you next change a module there. Both apps read `[modules]` when they start and after every change in Settings. See [Configuration: every key](../reference/configuration.md#modules). ## The older switches Three settings of earlier versions turned one viewer off each. They are modules now, and the settings are gone from Settings, `config.toml` and the docs: | Earlier setting | Now | |---|---| | `bom_viewer` (*CBOM viewer on F3*) | The module `bom`, *Cryptography bills of materials* | | `provenance_viewer` (*Provenance viewer on F3*) | The module `provenance`, *Build provenance* | | `[preview] ebooks` (*E-books with calibre*) | The module `ebooks`, *E-books* | The first time a version with modules starts, it moves them over by itself, once: a setting you had set to `false` puts its module in `[modules] off`; one set to `true`, or never set, just goes, and its module is on. Your comments and the rest of the file stay as they were, and a notice names what was changed. The release builds have every module. They are all in one program; turning one off means it is not used, not that it is left out of the build (for that, see below). ## Building without some modules When you build Coxswain from source, each module is a cargo feature of both apps named after it (`games`, `documents`, `disk_images` …), all on by default. To leave some out, turn the default features off and name the modules you want: ```sh cargo build --release -p coxswain --no-default-features --features games,documents cd gui && COXSWAIN_MODULES_OUT=diagrams,data,neural_networks npm run build && cd .. cargo build --release -p coxswain-gui --no-default-features --features custom-protocol,games,documents ``` The desktop app's viewers are bundled by its web build, which a cargo feature does not reach: `COXSWAIN_MODULES_OUT` names the modules that build leaves out (a name that is no module stops it). A module left out of either is off in the desktop app. A module left out is off whatever `[modules] off` says: Settings → *Modules* shows it greyed (`[-]` and dimmed in the terminal app, a box that cannot be ticked in the desktop app) with *not in this build*, and it cannot be turned on there. Its files are shown as text or hex, as with a module turned off. Its libraries are left out of the program with it, and with them what else uses them: | Module | Left out of both apps | Left out of the desktop app's web build | Also gone | |---|---|---|---| | `documents` | pdf-extract, mail-parser, cfb | mammoth, Asciidoctor.js | Find, Ask and *Make searchable* read no PDF, mail or Outlook message; a `.mbox` no longer opens like a folder | | `office` | | pptx-to-html, JSZip | | | `diagrams` | | Mermaid, Viz.js, draw.io's viewer | Mermaid blocks in Markdown stay code | | `data` | parquet; in the desktop app x509-parser, plist | SheetJS, hyparquet | | | `media` | lofty; in the desktop app kamadak-exif | | Transcribe does not know a recording's length beforehand | | `old_formats` | jxl-oxide, `image`'s old formats | | Compare shows no TIFF or other old picture side by side | | `neural_networks` | | Netron | | | `games` | cozy-chess (the chess rules); resvg (the terminal app's piece pictures) | the piece pictures | | | `provenance` | x509-parser (who signed) | | | A module left out also takes its own code along, the readers and viewers only it uses: | Module | Its own code, left out with it | Also gone | |---|---|---| | `openscad` | OpenSCAD's runs and the drawing of a model | *Export 3D model* | | `kicad` | KiCad's runs | *Export from KiCad* | | `geodata` | GDAL's runs, the GPX map and geodata's facts | *Convert geodata* | | `neural_networks` | the readers of ONNX, TensorFlow Lite, Core ML and Keras models; the desktop app's Netron view | a model's facts in the preview and in F3 | | `bom` | the BOM reader, its ratings and both apps' BOM viewers | the BOM a provenance statement carries does not open from its viewer | | `provenance` | the attestation reader, its checks and both apps' provenance viewers | | | `disk_images` | disk images' facts and their reading with 7-Zip | a disk image, a CHM help file or a CBR comic no longer opens like a folder, in an archive neither | | `old_formats` | the readers of Amiga IFF, PCX, XPM, XBM and Photoshop pictures and of tracker modules | | | `data` | the tables of a SQLite database, a dBase table or a Parquet file | | | `ebooks` | a book's preview | *Convert e-book* and Find still use calibre | | `games` | the readers of chess, Go, draughts, shogi, xiangqi and bridge files, opening books and game databases, the chess engine, the position index, and both apps' chess and Go views | Find and Ask read no game file and find no game in a database; *Find this position*; a game database in an archive is not unpacked beside it; Settings lists no chess engine | The rest (`office`, `latex`, `html`, `diagrams`, `media`) draw their previews with the programs and libraries above, through the converter every preview shares, and have no code of their own beyond that. A copy built without `games` and one built with it can share a search store: each reads the game files once again when the other one ran before (the one without the module drops their text and vectors, the one with it reads them as before). No other file is read again. ## Questions #### Why does a PDF or a game show as text now? The module that shows it is off. Turn it on again in Settings (**F12** in both apps, **Ctrl+,** in the desktop app) → *Modules*, and the file shows as before; the panel you are in shows it at once. If Settings shows it greyed, *not in this build*, it was left out when this copy was built from source ([Building without some modules](#building-without-some-modules)). #### Does turning a module off stop Find reading those files? No. Modules decide what the apps show; Find still reads the words in those files when reading words is on (Settings → *Finding files*). Only a module left out of the build takes some of them along: without `documents`, Find reads no PDF, mail or Outlook message, and without `games` no game file ([Building without some modules](#building-without-some-modules)). #### Does any module send my files anywhere? No. A few may download a container image to draw a file when its program is not installed and containers are on (Settings → *Previews* → *Container images*); Settings marks those with the *downloads* badge, and the image comes from its registry, not your file going anywhere. #### I turned off Chess games: why does Enter on a PGN file open my other chess program now? With the module off, Enter does with a games file what it does with any file: it opens it with the program your system gives it. Turn the module on again to open it on Coxswain's board. #### Can I leave a module out of the build? Yes, when you build from source: each module is a cargo feature, all on by default (see [Building without some modules](#building-without-some-modules)). Settings → *Modules* then shows the ones left out greyed, marked *not in this build*, and their libraries and their own code are not in the program; for the desktop app's web build, name them in `COXSWAIN_MODULES_OUT` too. The release builds have every module. #### What happened to bom_viewer, provenance_viewer and ebooks? They became the modules *Cryptography bills of materials* (`bom`), *Build provenance* (`provenance`) and *E-books* (`ebooks`). On its first start a version with modules took them out of your `config.toml` by itself: one you had set to `false` turned its module off (it is in `[modules] off` now); one set to `true`, or not set, left its module on. See [The older switches](#the-older-switches). E-books need calibre as before: with the module on, a book's preview offers to install it or to download its image, and nothing is downloaded until you ask. #### Where do I see which module a kind of file belongs to? In the table above, and in Settings → *Modules*, where each module lists the endings it shows. --- [← Previous: The Settings window](settings.md) · [Next: Themes →](themes.md)