Merge documentation spread over many .html files into a single .html file, preserving page order

2

I have a directory which contains some documentation. At the top level there's a single file (index.html) which contains a full table of contents:

Front Matter
Contents
1. Introduction
2. Built-in Objects
2.1 Built-in Functions

Each sub-section is then split out into its own .html file (ie, there's a file corresponding to 2, another file corresponding to 2.1, another for 2.1.1).

I want to merge this all into one gigantic .html file, keeping the ordering the same as what's in the TOC (so if I scroll down through the page, section 2 immediately follows section 1, and is immediately followed by section 2.1).

Are there pre-built tools that do this? I use both OS X and Ubuntu, but something cross-platform (ideally, written in Python) would be preferred.

James Polley

Posted 2009-12-28T11:41:35.287

Reputation: 5 892

Answers

0

I don't know of a tool to do that. I'd write a script in Python using the SGML parser module.

ā„¯aphink

Posted 2009-12-28T11:41:35.287

Reputation: 3 531