Md To Html Merge
Overview
Convert a single Markdown file to a styled HTML post and insert a new list item into the blog index.
Workflow
- •Decide the input Markdown file and confirm the
index.htmlpath. - •Run
scripts/md_to_html_merge.pywith--mdand--index(and optional overrides). - •Verify the new HTML file and the new list item appears at the top of the list in
index.html.
Command
powershell
python md-to-html-merge/scripts/md_to_html_merge.py ` --md c:\Development\projects\blog\MyPost.md ` --index c:\Development\projects\blog\index.html
Options
- •
--out: Output HTML path (defaults to the Markdown filename with.html). - •
--title: Override the title. - •
--date: Override the date (YYYY-MM-DD).
Behavior
- •Use YAML frontmatter
titleanddatewhen present. - •Otherwise use the first
# Headingas title and today as date. - •Convert Markdown to HTML via the Python
markdownpackage if available, else trypandoc. - •Wrap the HTML in a page template that matches the blog styling.
- •Insert a new list item at the top of
<ul class="post-list">inindex.html. - •Skip insertion if the link already exists.
Resources
scripts/
md_to_html_merge.py converts Markdown to HTML and updates index.html.