Skip to main content

Module code

Module code 

Source
Expand description

The code reference: a page for every module, type and function of the code a site names, in the style of DocC — made from the code itself, live, and never written to disk.

A site enables it as the system extension code, one namespace per language:

extensions:
  code:
    config:
      rust:
        files: ["../core/src/**/*.rs"]

Each file is parsed by its namespace’s grammar and query ([extract]), every file’s declarations are linked into items ([rust]), and a item’s page is rendered on request ([render]) at <site folder>/reference/<namespace>/<path>. A save re-parses that one file and links again in memory; nothing is cached on disk.

Structs§

Declaration
What one file says about one thing.
Extracted
What one file says: its own doc comment and its declarations, in the order they are written.
Grammar
A language’s parser: its grammar, the query that finds declarations, and how its doc comments read.
Index
The code reference of one site.
Item
One thing of the code, after every file is linked: a module, a type, a function — what a reference page is about.
Items
Every item of a namespace, by path, and the paths pub use makes another name for.
Member
A part of an item shown on its page: a field, a variant, a method.
Prose
A Markdown file headed # rust:path : what it adds to that item’s page.
Searched
One page of a code reference, as search reads it.

Enums§

Page
What a page address of the code reference names.
Visibility
How a declaration is visible where it is written.

Functions§

at
The code reference whose pages lie where path — a lexical path in the served folder — is: its nearest site’s, when that site has one and path is under its reference/.
changed
Brings every code reference of served up to date after files changed: each changed source file parsed again, each namespace linked again. Whether any page may now read differently.
configure
Enables the code reference of the site whose document file is doc, in the folder base, from its config — or disables it when config is None. Loading the same configuration again keeps the index.
for_document
The code reference of the site whose document file is doc, if it has one.
forget
Forgets every code reference of a document under folder: for server mode, a version it no longer holds, whose items would otherwise stay in memory for good.
input_roots
Every folder a code reference of served reads from: watched whatever the site’s watch list or .gitignore says.