Skip to main content

HTMLBuilder

Struct HTMLBuilder 

Source
pub struct HTMLBuilder {
Show 33 fields pub name: String, pub format: String, pub epilog: String, pub out_suffix: String, pub link_suffix: String, pub searchindex_filename: String, pub allow_parallel: bool, pub copysource: bool, pub use_index: bool, pub embedded: bool, pub search: bool, pub download_support: bool, pub supported_image_types: Vec<String>, pub supported_remote_images: bool, pub supported_data_uri_images: bool, pub outdir: PathBuf, pub srcdir: PathBuf, pub confdir: PathBuf, pub static_dir: PathBuf, pub sources_dir: PathBuf, pub downloads_dir: PathBuf, pub images_dir: PathBuf, pub config: BuildConfig, pub current_docname: String, pub secnumbers: HashMap<String, Vec<u32>>, pub imgpath: String, pub dlpath: String, pub css_files: Vec<CSSFile>, pub js_files: Vec<JSFile>, pub template_engine: TemplateEngine, pub global_context: Map<String, Value>, pub relations: HashMap<String, DocumentRelation>, pub domain_indices: Vec<DomainIndex>,
}
Expand description

HTML Builder that mirrors Sphinx’s StandaloneHTMLBuilder

Fields§

§name: String§format: String§epilog: String§out_suffix: String§link_suffix: String§searchindex_filename: String§allow_parallel: bool§copysource: bool§use_index: bool§embedded: bool§search: bool§download_support: bool§supported_image_types: Vec<String>§supported_remote_images: bool§supported_data_uri_images: bool§outdir: PathBuf§srcdir: PathBuf§confdir: PathBuf§static_dir: PathBuf§sources_dir: PathBuf§downloads_dir: PathBuf§images_dir: PathBuf§config: BuildConfig§current_docname: String§secnumbers: HashMap<String, Vec<u32>>§imgpath: String§dlpath: String§css_files: Vec<CSSFile>§js_files: Vec<JSFile>§template_engine: TemplateEngine§global_context: Map<String, Value>

Global template context

§relations: HashMap<String, DocumentRelation>§domain_indices: Vec<DomainIndex>

Implementations§

Source§

impl HTMLBuilder

Source

pub fn new( config: BuildConfig, srcdir: PathBuf, outdir: PathBuf, ) -> Result<Self>

Source

pub async fn init(&mut self) -> Result<()>

Initialize the builder (mirrors Sphinx’s init method)

Source

pub async fn write_doc( &mut self, docname: &str, doctree: &Document, ) -> Result<()>

Write a single document (mirrors Sphinx’s write_doc)

Source

pub fn get_target_uri(&self, docname: &str) -> String

Get target URI for a document: quote(docname) + self.link_suffix, as StandaloneHTMLBuilder.get_target_uri percent-encodes it.

Source

pub async fn gen_indices(&mut self) -> Result<()>

Generate indices (mirrors Sphinx’s gen_indices)

Source

pub async fn copy_static_files(&self) -> Result<()>

Copy static files (mirrors Sphinx’s copy_static_files)

Source

pub async fn copy_image_files( &self, images: &HashMap<String, String>, ) -> Result<()>

Copy image files

Source

pub async fn copy_download_files( &self, downloads: &HashMap<String, String>, ) -> Result<()>

Copy download files

Source

pub async fn dump_search_index(&self, search_index: &SearchIndex) -> Result<()>

Dump search index

Source

pub async fn write_build_info(&self) -> Result<()>

Write build info file

Source

pub async fn dump_object_inventory( &self, search_index: &SearchIndex, ) -> Result<()>

Write the direct builder’s inventory from the same search-index object records used by its Sphinx-shaped JSON output. The full builder has richer environment registries, but both paths use InventoryFile for the wire format, the std domain’s preseeded labels, and the one priority table the search index applies to the same objects.

Source

pub async fn finish(&mut self, search_index: &SearchIndex) -> Result<()>

Finish the build process

Trait Implementations§

Source§

impl Debug for HTMLBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.