W3C home > Mailing lists > Public > spec-prod@w3.org > January to March 2013

respec2html command line utility

From: Anssi Kostiainen <anssi.kostiainen@nokia.com>
Date: Thu, 21 Feb 2013 20:30:56 +0200
Message-Id: <230E777D-55B1-4DC3-8015-1886006F598D@nokia.com>
To: "spec-prod@w3.org Prod" <spec-prod@w3.org>
Hi,

I wrote a small command line utility for converting a ReSpec source file into a static HTML snapshot. It should be especially helpful for editors who are maintaining both the source .src.html and .html snapshots of Editor's Drafts that are updated frequently.

If you want to give it a spin, here's how:

Install PhantomJS:
  
  http://phantomjs.org/download.html

Grab the respec2html.js script:

  http://darobin.github.com/respec/tools/respec2html.js

Then you can say, assuming Overview.src.html is your source, and Overview.html is the static snapshot you want to create:

  $ /path/to/bin/phantomjs /path/to/respec2html.js Overview.src.html Overview.html

You may want to alias this for convenience, and define something like the following in the config file of your shell (in OS X, that'd likely be ~/.profile):  

  alias respec2html='/path/to/bin/phantomjs /path/to/respec2html.js'

And this will work:

  $ respec2html Overview.src.html Overview.html 
  Loading Overview.src.html
  Loading https://www.w3.org/StyleSheets/TR/W3C-ED
  Loading https://www.w3.org/Icons/w3c_home
  Loading http://www.w3.org/StyleSheets/TR/logo-ED
  Serializing the DOM into HTML...
  Overview.html created!

Enjoy!

-Anssi
Received on Thursday, 21 February 2013 18:31:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 21 February 2013 18:31:25 GMT