3 ms·
You can use SGML (on which HTML is/was based) and my LGPL-licensed sgmljs package [1] for that, plus my SGML DTD grammar for HTML5. [2] describes common tasks i
by tannhaeuser 5y ago
You can use SGML (on which HTML is/was based) and my LGPL-licensed sgmljs package [1] for that, plus my SGML DTD grammar for HTML5. [2] describes common tasks in preservation of Web content to give you a flavor, but you can customize what SGML does with your markup to death really; in your case, you'll probably want to throw away divs and navs to get clean semantic HTML which you can do using SGML link processes (= pipeline of markup filters and transformations), but you could also convert HTML into canonical markup (eg XML) and use Turing-complete XML processing tools such as XSLT as described in the linked tutorial.
[1]: http://sgmljs.net http://sgmljs.net
[2]: http://sgmljs.net/docs/parsing-html-tutorial/parsing-html-tutorial.html http://sgmljs.net/docs/parsing-html-tutorial/parsing-html-tu...