I would like to add an option which disables the package to allow the production of a traditional LaTeX PDF, or enables the package to produce HTML. It will also define a few tests to allow the user's document to conditionally include code fragments for HTML-only or PDF-only processing.
So what's the best way to internally conditionally disable most of a large package? It's 3000 lines of code and comments.
- One large conditional if/then with thousands of lines in the true clause?
- Many conditional if/then clauses for small pieces at a time?
- Conditionally \input an external file?
- Some kind of verbatim environment?
- Define everything as new private macros, then \let them all at once to the original names \AtBeginDocument? This has the advantage that anything re-defined by other packages in the preamble gets reset to the HTML output just before typesetting, a problem which I already ran into when siunitx redefined tabular.