Skip to content
This repository

An HTML version of the ECMAScript draft specification autogenerated from the source

branch: master

Common up the various regexps that match Word REF macro spam.

Tweak a few link regexps to cope with the consequences of using a more permissive REF regexp in some places.
latest commit e317e87e43
Jason Orendorff authored April 22, 2014
Octocat-spinner-32 Ecma_RVB-003.jpg Added support for ECMAScript Internationalization API Specification. December 13, 2012
Octocat-spinner-32 README.md Update README. January 23, 2014
Octocat-spinner-32 docx.py There are actually only 9 numbering levels in Word. Add some comments… April 15, 2014
Octocat-spinner-32 es-intl-1-final.docx Added support for ECMAScript Internationalization API Specification. December 13, 2012
Octocat-spinner-32 es-intl-1-final.html Added support for ECMAScript Internationalization API Specification. December 13, 2012
Octocat-spinner-32 es-spec.py Change transform api. July 29, 2013
Octocat-spinner-32 es5.1-final.dotx Remove generated file es5.1-final.html and add the source dotx file. May 22, 2012
Octocat-spinner-32 es5.1.css Added support for ECMAScript Internationalization API Specification. December 13, 2012
Octocat-spinner-32 es6-draft-all-sections.json Drop "..." when converting section titles to ids. This was the origin… April 15, 2014
Octocat-spinner-32 es6-draft-sections.js Drop "..." when converting section titles to ids. This was the origin… April 15, 2014
Octocat-spinner-32 es6-draft.css Add {position: sticky} to section headings. This requires a moderatel… September 09, 2013
Octocat-spinner-32 es6-draft.docx Rev 23. April 10, 2014
Octocat-spinner-32 es6-draft.html Common up the various regexps that match Word REF macro spam. April 22, 2014
Octocat-spinner-32 figure-1.png Replace Figure 1 with a canned image. March 04, 2012
Octocat-spinner-32 figure-1.svg Replace Figure 1 with a canned image. March 04, 2012
Octocat-spinner-32 figure-2.png Bare-bones support for pic:pic, just in case we ever need it. August 02, 2013
Octocat-spinner-32 fixups.py Common up the various regexps that match Word REF macro spam. April 22, 2014
Octocat-spinner-32 ftpcommands.txt Link to the section-rewriting script from the HTML file. Does not qui… November 12, 2013
Octocat-spinner-32 go add ftp script June 25, 2013
Octocat-spinner-32 hacks.py Mark hacks explicitly. Unfortunately this did not find any dead code. April 17, 2014
Octocat-spinner-32 htmodel.py Fix #62. April 18, 2014
Octocat-spinner-32 transform.py Refine is_deleted(). August 07, 2013
README.md

es-spec - Convert the ECMAScript Language Specification to HTML

To run the program:

./es-spec.py es6-draft.docx

Note: Python 3 is required.

About this program

Architecture: The program is in four parts:

  • Load the Word document (docx.py)
  • Convert it to extremely rough HTML+CSS (transform.py)
  • Apply a series of transformations, ranging from minor tweaks to very fancy algorithms, to the HTML (fixups.py)
  • Dump the resulting HTML document (htmodel.py)

Most of the interesting work, and most of the bugs, are in fixups.py.

Fragility: The script is quite sensitive to the input document and will throw an exception and give up if the document isn't exactly as expected. It's been hard to balance (a) being "liberal in what you accept" with (b) making sure fixups do not break silently, but rather get the user's attention, when the input document changes in unexpected ways.

Debugging: If a directory named _fixup_log exists under the current directory, the script dumps the whole halfway-transformed document to a file in that directory after each fixup.

Something went wrong with that request. Please try again.