Building a Structured Outline
Jelly, 53 50 bytes

Ḋœṡ¥€⁶ZµḢVØ0jI&gt;0ẋ"AƲị“&lt;ol&gt;“&lt;/ol&gt;”żṪ“&lt;li&gt;“&lt;/li&gt;”jⱮƊ


Try it online!

A monadic link taking a list of strings as input and outputting an HTML fragment with nested ordered lists. Should handle arbitrarily deep nesting of lists and return a syntactically valid HTML fragment. 

Example:

H1 All About Birds
H2 Kinds of Birds
H3 The Finch
H3 The Swan
H2 Habitats
H3 Wetlands
H4 Types of wetlands
H5 Very wet wetland
H3 Coast
H1 All about fish
H2 Sharks


yields:

&lt;ol&gt;&lt;li&gt;All About Birds&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Kinds of Birds&lt;/li&gt;&lt;ol&gt;&lt;li&gt;The Finch&lt;/li&gt;&lt;li&gt;The Swan&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;Habitats&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Wetlands&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Types of wetlands&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Very wet wetland&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;li&gt;Coast&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;li&gt;All about fish&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Sharks&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;


All About BirdsKinds of BirdsThe FinchThe SwanHabitatsWetlandsTypes of wetlandsVery wet wetlandCoastAll about fishSharks