pub struct ParseOptions {
pub source_path: String,
pub sphinx: bool,
pub docname: String,
pub found_docs: Option<Arc<BTreeSet<String>>>,
pub exclude_patterns: Vec<String>,
pub py: PySigConfig,
pub srcdir: Option<PathBuf>,
pub source_encoding: String,
}Fields§
§source_path: StringWhat <document source="..."> prints (docutils new_document name).
sphinx: boolSphinx mode: the Sphinx directive/role registries extend the docutils-native ones (toctree, xref roles, …). The binary build path runs with this on; the docutils differential fixture off.
docname: StringThe docname recorded on pending_xref nodes (sphinx refdoc).
found_docs: Option<Arc<BTreeSet<String>>>Every docname the project discovered (sphinx env.found_docs).
The toctree directive resolves its entries against this set at
parse time, exactly as Sphinx’s TocTree.parse_content does.
None means “parsed without an environment” — a standalone parse
(the differential harnesses, parse_rst callers) where no document
exists, so every toctree entry resolves to nothing and entries/
includefiles stay empty. Shared by Arc because the build clones
these options once per source file.
exclude_patterns: Vec<String>exclude_patterns, which TocTree.parse_content consults to tell an
excluded toctree target from a nonexisting one. Empty for a parse
without an environment, where no entry resolves anyway.
py: PySigConfigThe object-signature / py-domain configuration the read phase
consumes (crate::py::PySigConfig): today the fix_parens roles’
add_function_parentheses, and from the py directives onward the
signature-wrapping and TOC-entry keys too. Defaults to sphinx’s own
defaults, so a parse without a project behaves like a default one.
srcdir: Option<PathBuf>The project source directory (sphinx env.srcdir), which the
include directive’s sphinx-mode path rewrite resolves against
(sphinx/directives/other.py:413-416 runs env.relfn2path on every
include argument before docutils sees it) and which the parse-time
included/dependencies records are spelled relative to.
None — the default — means “parsed without a project”: include
arguments then resolve the docutils way, relative to the directory
of the containing file, and no records are made. Standalone
parses (the differential harnesses, parse_rst callers) keep their
current behavior.
source_encoding: StringSphinx’s source_encoding config value (config.py:244, default
'utf-8-sig'), which the environment copies onto
settings.input_encoding (environment/__init__.py:375). In sphinx
mode both file-inserting directives read it as their default:
include through settings.input_encoding (misc.py:116) and
literalinclude through config.source_encoding (code.py:210);
an explicit :encoding: option still wins. Ignored outside sphinx
mode, where bare docutils’ 'utf-8' default applies.
Trait Implementations§
Source§impl Clone for ParseOptions
impl Clone for ParseOptions
Source§fn clone(&self) -> ParseOptions
fn clone(&self) -> ParseOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParseOptions
impl Debug for ParseOptions
Auto Trait Implementations§
impl Freeze for ParseOptions
impl RefUnwindSafe for ParseOptions
impl Send for ParseOptions
impl Sync for ParseOptions
impl Unpin for ParseOptions
impl UnsafeUnpin for ParseOptions
impl UnwindSafe for ParseOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more