Prose references¶
prose
¶
Prose references to declarations in a literate document.
The prose of a literate document names declarations with the role
{qvr:ref}`Name`. prose_references finds them outside the document's
fenced blocks, with the offsets of each target, so a checker can resolve
them in the module's scope (quivers.literate.references) and a migration
can rewrite them when a declaration is renamed.
ROLE
module-attribute
¶
A prose reference: {qvr:ref}`Name`.
ProseReference
didactic-model
¶
Bases: Model
One prose reference to a declaration.
| PARAMETER | DESCRIPTION |
|---|---|
target
|
The name referred to, as written.
TYPE:
|
line
|
The 1-based document line of the target.
TYPE:
|
column
|
The 0-based column of the target.
TYPE:
|
start
|
The character offset of the target in the document.
TYPE:
|
end
|
The character offset one past the target.
TYPE:
|
prose_references
¶
prose_references(text: str) -> tuple[ProseReference, ...]
The prose references of a document, outside its fenced blocks.
| PARAMETER | DESCRIPTION |
|---|---|
text
|
The document.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple[ProseReference, ...]
|
Each |