Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

respec2html is a command line utility that converts a ReSpec source file... #133

Merged
merged 3 commits into from Feb 12, 2013

Conversation

anssiko
Copy link
Member

@anssiko anssiko commented Jan 25, 2013

... to an HTML file. Depends on PhantomJS http://phantomjs.org.

@darobin
Copy link
Member

darobin commented Feb 4, 2013

Hi Anssi!

Thanks for this, but I am hesitant to include it because I'm concerned that it's incorrect. I see two problems:

  • It waits 1s, but there's no guarantee that that's enough, especially after we add fetching refs from a remote server. (And even without that, on a slow network it could take more.) The correct approach would be to listen for the end-all message on respecEvents (I'm pretty sure that it can be done with PhantomJS).
  • It does its own HTML serialisation with outerHTML which I'm unsure is correct in all cases. It would be better to call the internal function that does HTML serialisation — with outerHTML there are quite a few things that could end up being in the tree that don't belong there (e.g. the error dialog, and the menus that we're looking at adding).

Do you want to rework this based on that? If not, I'll get around to it at some point!

@anssiko
Copy link
Member Author

anssiko commented Feb 5, 2013

Hi Robin!

Thanks for the review and suggestions. I'm happy to rework this to address your concerns.

…ile to an HTML file. Depends on PhantomJS <http://phantomjs.org>. Changes:

- Poll document.respecDone for doneness.
- Use ReSpec built-in toHTMLSource() for serialization.
@anssiko
Copy link
Member Author

anssiko commented Feb 6, 2013

Hi Robin!

Please see the updated pull request for a reworked version. PhantomJS does not seem to provide an API for listening to custom events, so I worked around the issue by polling document.respecDone for doneness. I now use the ReSpec's built-in toHTMLSource() for serialization.

I also did a minor change to legacy.js to make respec2html.js work for local source files if a html5shiv.js is in use. Before the fix, shiv's scheme was set to undefined.

Let me know if you have any further concerns. I validated the reworked respec2html.js with a bunch of specs and with all the spec tested the script produced a 1:1 copy with the manually converted version.

darobin added a commit that referenced this pull request Feb 12, 2013
respec2html is a command line utility that converts a ReSpec source file...
@darobin darobin merged commit ef6ee70 into w3c:develop Feb 12, 2013
@darobin
Copy link
Member

darobin commented Feb 12, 2013

Brilliant, thanks a lot!

shikhar-scs pushed a commit to shikhar-scs/respec that referenced this pull request Feb 19, 2018
* index.html now uses minified version
* order of included blocks is defined in make.py
* python make.py from the command to to regenerate
js/metrics-graphics.js and js/metrics-graphics.min.js
shikhar-scs pushed a commit to shikhar-scs/respec that referenced this pull request Feb 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants