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 tags.</p> <p>Returns: Dict mapping file paths (.html) to HTML content.</p> <h3>md_to_html</h3> <pre><code class="language-python">def md_to_html(text)</code></pre> <p>Convert Markdown text to HTML.</p> <p>Handles: headings, code blocks, inline code, paragraphs, unordered lists, links, bold, italic.</p> <h3>_inline_format</h3> <pre><code class="language-python">def _inline_format(text)</code></pre> <p>Apply inline formatting: links, bold, italic, inline code.</p> <h3>_escape_html</h3> <pre><code class="language-python">def _escape_html(text)</code></pre> <p>Escape HTML special characters.</p> <h3>_md_to_html_path</h3> <pre><code class="language-python">def _md_to_html_path(md_path)</code></pre> <p>Convert a .md path to .html.</p> <h3>_build_nav</h3> <pre><code class="language-python">def _build_nav(markdown_files)</code></pre> <p>Build navigation items from the markdown file list.</p> <p>Returns list of dicts: {"label": str, "path": str (html path)}</p> <h3>_render_nav</h3> <pre><code class="language-python">def _render_nav(nav_items, prefix, current_path='')</code></pre> <p>Render the sidebar navigation HTML.</p> <h3>_extract_title</h3> <pre><code class="language-python">def _extract_title(md_content, fallback)</code></pre> <p>Extract the first heading from markdown content as the page title.</p> <h3>_wrap_page</h3> <pre><code class="language-python">def _wrap_page(body_html, nav_html, title, project_name, version)</code></pre> <p>Wrap converted HTML body in the full page template.</p> </main> </body> </html>