Documentation commands #
We generate html documentation from mathlib. It is convenient to collect lists of tactics, commands, notes, etc. To facilitate this, we declare these documentation entries in the library using special commands.
library_note
adds a note describing a certain feature or design decision. These can be referenced in doc strings with the textnote [name of note]
.add_tactic_doc
adds an entry documenting an interactive tactic, command, hole command, or attribute.
Since these commands are used in files imported by tactic.core
, this file has no imports.
Implementation details #
library_note note_id note_msg
creates a declaration `library_note.i
for some i
.
This declaration is a pair of strings note_id
and note_msg
, and it gets tagged with the
library_note
attribute.
Similarly, add_tactic_doc
creates a declaration `tactic_doc.i
that stores the provided
information.
A rudimentary hash function on strings.
Equations
- s.hash = string.fold 1 (λ (h : ℕ) (c : char), (33 * h + c.val) % unsigned_sz) s
The library_note
command #
The add_tactic_doc_entry
command #
- tactic : doc_category
- cmd : doc_category
- hole_cmd : doc_category
- attr : doc_category
The categories of tactic doc entry.