Let's say I start with a markdown file I made in typora...then I export it as a simple HTML file without anything fancy. The HTML file is a simple html document that only contains headers h1 to h5 and text for each header level...
Is there a simple way to automatically create a "document map" based on the html headings that is attached to the left side of the html document the same way as it is in document maps in microsoft word, acrobat reader? Looking for simplest solution.
For instance, maybe i can cut and paste a small javascript program to query the heading tags and display them on the side?
Or maybe I can write a python, perl, or powershell script to read all the header tags and put links on the side by producing a new html document?
May the simplest method win..
<!doctype html>
<html>
<head>
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
<title>sample</title>
</head>
<body><p> </p>
<p> </p>
<h1 id='heading-1'>heading 1</h1>
<h2 id='apples'>Apples</h2>
<p>Apples are tasty</p>
<h3 id='mcintosh'>McIntosh</h3>
<h3 id='gala'>Gala</h3>
<h3 id='red-delicious'>Red Delicious</h3>
<h2 id='pears'>Pears</h2>
<p>Pears are green</p>
<h2 id='oranges'>Oranges</h2>
<p>oranges are orange</p>
<p> </p>
</body>
</html>
Here's what I want my document to look like in HTML using the simplest javascript code possible
Turns out you don't need to write code, Its even easier than I thought:
From Typora:
File->Preferences->Export->HTML->"Check Include Outline Sidebar"