rlsbl.targets.docs.html
Convert Markdown files to static HTML with a built-in minimal converter.
No external dependencies -- handles only the patterns we generate ourselves: headings, code blocks, inline code, paragraphs, lists, links, bold/italic.
Functions
generate_html
def generate_html(markdown_files, version, project_name=None)
Convert Markdown files to static HTML.
Args: markdown_files: Dict mapping relative paths to MD content (from generate_markdown). version: Version string for display. project_name: Project name for
Returns: Dict mapping file paths (.html) to HTML content.
md_to_html
def md_to_html(text)
Convert Markdown text to HTML.
Handles: headings, code blocks, inline code, paragraphs, unordered lists, links, bold, italic.
_inline_format
def _inline_format(text)
Apply inline formatting: links, bold, italic, inline code.
_escape_html
def _escape_html(text)
Escape HTML special characters.
_md_to_html_path
def _md_to_html_path(md_path)
Convert a .md path to .html.
_build_nav
def _build_nav(markdown_files)
Build navigation items from the markdown file list.
Returns list of dicts: {"label": str, "path": str (html path)}
_render_nav
def _render_nav(nav_items, prefix, current_path='')
Render the sidebar navigation HTML.
_extract_title
def _extract_title(md_content, fallback)
Extract the first heading from markdown content as the page title.
_wrap_page
def _wrap_page(body_html, nav_html, title, project_name, version)
Wrap converted HTML body in the full page template.