Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
568 additions
and
5,905 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1 +1,2 @@ | |||
.sass-cache | .sass-cache | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,40 @@ | |||
""" | |||
We use this in development to build jquery.preview.js | |||
""" | |||
import os | |||
import lxml.html | |||
from docutils.core import publish_string | |||
from optparse import OptionParser | |||
|
|||
DIR_PATH = os.path.abspath(os.path.dirname(__file__)) | |||
DEMO_PATH = os.path.join(DIR_PATH, '../demo') | |||
|
|||
if __name__ == '__main__': | |||
|
|||
f = open(os.path.join(DIR_PATH, '../README.rest'), 'r') | |||
html = publish_string(f.read(), writer_name='html') | |||
f.close() | |||
doc = lxml.html.fromstring(html) | |||
|
|||
|
|||
for pre in doc.xpath('//pre'): | |||
pre.set('class', 'prettyprint linenums') | |||
|
|||
body = doc.xpath('//div[@id="jquery-preview"]')[0] | |||
body.xpath('.//h1[@class="title"]')[0].drop_tree() | |||
|
|||
for heading in body.xpath('//h1|//h2|//h3|//h4'): | |||
heading.tag = 'h{}'.format(int(heading.tag[1])+1) | |||
|
|||
f = open(os.path.join(DEMO_PATH, 'index.html.tmpl'), 'r') | |||
doc = lxml.html.fromstring(f.read()) | |||
f.close() | |||
document = doc.xpath('//div[@id="document"]')[0] | |||
for child in body.getchildren(): | |||
document.append(child) | |||
|
|||
f = open(os.path.join(DEMO_PATH, 'index.html'), 'w') | |||
f.write(lxml.html.tostring(doc)) | |||
f.close() | |||
|
|||
print 'Done' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.