Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 0 down vote accepted

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

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .