api

generator.ch

Declarations in generator.ch

1 declarationsdocgen

Declarations

Public only
docgen#
Publicnamespace
namespace docgen
HtmlGenerator#
Publicstruct
struct HtmlGenerator { var config : *DocConfig var summary : *Summary var search_index : string var generated_urls : vector<string> var pages : vector<*SummaryItem> }
delete#
function
func delete(self : *HtmlGenerator) : void
highlight_wrapper#
function
func highlight_wrapper(lang : string_view, code : string_view) : string
replace_extension#
function
func replace_extension(path : &string, old_ext : string_view, new_ext : string_view) : string
get_relative_path_to_root#
function
func get_relative_path_to_root(depth : int) : string
strip_tags#
function
func strip_tags(html : string_view) : string
Helper to strip HTML tags for search index
escape_json_string#
function
func escape_json_string(str : string_view) : string
Helper to escape JSON string
render_sidebar_item#
function
func render_sidebar_item(item : *SummaryItem, current_path : string_view, depth : int) : string
Recursively render sidebar
str_vec_contains#
function
func str_vec_contains(vec : &vector<string>, val : string_view) : bool
is_server_side_supported#
function
func is_server_side_supported(lang : string_view) : bool
get_prism_includes#
function
func get_prism_includes(config : *DocConfig) : string
build_toc#
function
func build_toc(content : string_view, depth : int) : string
Build an on-this-page list from h2/h3 headings in rendered content.
pager_html#
function
func pager_html(gen : &HtmlGenerator, page_item : *SummaryItem, depth : int) : string
Prev/Next pager from the flat reading order
collect_pages#
function
func collect_pages(items : &vector<*SummaryItem>, out : &vector<*SummaryItem>) : void
Flatten the summary tree into an ordered list of pages (for prev/next)
page_position#
function
func page_position(pages : &vector<*SummaryItem>, md_path : string_view) : int
Find a page's position in the flat reading order; -1 if not a page
generate_page#
functionExtension
func generate_page(gen : &HtmlGenerator, title : string_view, content : string_view, output_path : string, relative_depth : int, current_md_path : string_view, page_item : *SummaryItem) : void
process_item#
functionExtension
func process_item(gen : &HtmlGenerator, item : *SummaryItem) : void
generate_sitemap#
function
func generate_sitemap(config : &DocConfig, urls : &vector<string>) : void
generate#
Publicfunction
func generate(config : DocConfig, summary : *Summary) : void