Used to generate a json file for html docs.
The json file is a list of maps, where each map has the structure
interface DeclInfo {
name: string;
args: efmt[];
type: efmt;
doc_string: string;
filename: string;
line: int;
attributes: string[];
equations: efmt[];
kind: string;
structure_fields: [string, efmt][];
constructors: [string, efmt][];
}
Where efmt is defined as follows ('c' is a concatenation, 'n' is nesting):
type efmt = ['c', efmt, efmt] | ['n', efmt] | string;
Include this file somewhere in mathlib, e.g. in the scripts
directory. Make sure mathlib is
precompiled, with all.lean
generated by mk_all.sh
.
Usage: lean entrypoint.lean
prints the generated JSON to stdout.
entrypoint.lean
imports this file.
- name : name
- is_meta : bool
- args : list (bool × efmt)
- type : efmt
- doc_string : option string
- filename : string
- line : ℕ
- attributes : list string
- equations : list efmt
- kind : string
- structure_fields : list (string × efmt)
- constructors : list (string × efmt)
The information collected from each declaration
extracts decl_info
from d
. Should return none
instead of failing.