Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.