Draft
feat: section-type detection, type-specific layouts, and per-section style customisation (v0.7.0)#4
Conversation
…ion, v0.7.0" Agent-Logs-Url: https://github.com/fasilwdr/md2indexhtml/sessions/c45a0d22-b27b-4d86-bdb8-0f8cc5ec26b2 Co-authored-by: fasilwdr <63807062+fasilwdr@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Create implementation plan for package features
feat: section-type detection, type-specific layouts, and per-section style customisation (v0.7.0)
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The converter applied a single generic layout to all content regardless of structure. This replaces it with a pipeline that auto-detects each
----separated block's type from its## headingand renders an appropriate layout.Core pipeline (
utils.py)The old monolithic
process_headings/apply_element_stylingapproach and the 130-entryDEFAULT_STYLE_CONFIGare removed. The new pipeline:handle_images— resolves paths, copies local files (also fixes off-by-one bug strippingstatic/description/prefix: 18 → 19 chars)parse_document— splits on---, then on## headings, tagging each block with a section type; blocks with no##inherit the previous typegroup_sections— merges consecutive same-type blocks (enables multi-block FAQ / Usage)render_section_group— dispatches to a type-specific rendererNine section types with dedicated renderers
overviewfeaturesinstallation/configurationscreenshotsusageknown_issuesfaq---blockchangeloggenericDetection keywords live in
SECTION_TYPE_KEYWORDS; the default CSS classes for every rendered element live inDEFAULT_SECTION_STYLES— both exported from the package.Per-section style customisation
Any key in
DEFAULT_SECTION_STYLESis overridable at runtime:# CLI md2indexhtml README.md --style-config my_style.json{ "overview": { "section_class": "o_section_overview py-5 bg-primary text-white" }, "faq": { "question_class": "faq-question h5 font-weight-bold text-primary" } }HTML document wrapper
Self-contained inline CSS grid + typography reset replaces the prior approach (which referenced Bootstrap classes with no Bootstrap CDN), making output fully standalone and Odoo Apps Store sanitizer-safe.
README
Completely rewritten: section-type detection table, style-key reference, multi-block continuation explanation, CLI/API examples.