Tools to provide a standard, predictable interface to access the four different types of documentation defined by https://diataxis.fr/
Go to file
contrapunctus 7ec68e3713 Create library to find and read the docspec file 2022-01-22 23:37:50 +05:30
lib Create library to find and read the docspec file 2022-01-22 23:37:50 +05:30
README.org Present benefits as list 2022-01-22 01:44:54 +05:30
docspec.asd Create library to find and read the docspec file 2022-01-22 23:37:50 +05:30

README.org

DocSpec

DocSpec provides a standard, predictable interface to access the four different types of documentation for a project - tutorials (lessons), how-to guides (recipes), explanation (discussion), and reference (technical description).

DocSpec is

  1. a configuration file in your project root, specifying how to reach sections of your documentation, and associating symbols with them if desired
  2. a Common Lisp library to query the file
  3. a command line client built on the library
  4. an Emacs package, providing a completing-read interface

It is hoped that this tool will -

  1. make documentation more accessible to users, and
  2. make more projects aware of the Diataxis Framework, and incentivize them to structure their documentation according to its suggestions, which in turn would make their documentation easier to read, write, and maintain.

Creating the file

Below is what an example DocSpec file for the McCLIM project might look like.

Each documentation type has topics it covers - in this example, each topic is a symbol, but they could also be strings.

The documentation for each topic can be presented in one or more formats - a string, a PDF file, an HTML file, etc.

((tutorial
  (first-attempt     (:pdf "<url>") (:html "<url>"))
  (defining-commands (:pdf "<url>") (:html "<url>"))
  ...)
 (howto
  (create-text-editor-pane    (:pdf "<url>") (:html "<url>"))
  (run-app-in-separate-thread (:pdf "<url>") (:html "<url>"))
  (create-new-backend         (:pdf "<url>") (:html "<url>"))
  ...)
 (explanation
  (coordinate-systems  (:pdf "<url>") (:html "<url>"))
  (sheet-hierarchies   (:pdf "<url>") (:html "<url>"))
  (development-history (:pdf "<url>") (:html "<url>"))
  ...)
 (reference
  (redisplay       (:pdf "<url>") (:html "<url>"))
  (layout-protocol (:pdf "<url>") (:html "<url>"))
  (output-protocol (:pdf "<url>") (:html "<url>"))
  ...))

Tools making use of DocSpec can offer commands such as view-tutorial, view-howto, view-explanation, and view-reference. Users can configure a priority list for their preferred formats; if the package does not offer documentation in any of those formats, the tool could prompt them to select an available format.