[Python-checkins] r50669 - sandbox/trunk/seealso/convert-python-faqs.py
andrew.kuchling
python-checkins at python.org
Sat Jul 15 23:53:15 CEST 2006
Author: andrew.kuchling
Date: Sat Jul 15 23:53:15 2006
New Revision: 50669
Modified:
sandbox/trunk/seealso/convert-python-faqs.py
Log:
Create various random files that Pyramid requires in order to run
Modified: sandbox/trunk/seealso/convert-python-faqs.py
==============================================================================
--- sandbox/trunk/seealso/convert-python-faqs.py (original)
+++ sandbox/trunk/seealso/convert-python-faqs.py Sat Jul 15 23:53:15 2006
@@ -57,8 +57,10 @@
f.write("""--- !fragment
template: index.html
# The data to pass to the template
+global:
+ metadata:
local:
- title: %s
+ title: "%s"
content: !fragment content.yml
""" % title)
f.close()
@@ -75,6 +77,18 @@
text: !htmlfile question.html""")
f.close()
+ f = open(os.path.join(qdir, 'nav.yml'), 'w')
+ f.write("""--- !fragment
+# Type of template to use
+template: nav.html
+
+# Contents of the template
+global:
+ nav : !sectionnav |
+ xxx index.html
+""")
+ f.close()
+
def convert_index (filename):
root = htmlload.load(filename)
@@ -105,7 +119,7 @@
template: index.html
# The data to pass to the template
local:
- title: %s
+ title: "%s"
content: !fragment content.yml
""" % title)
f.close()
@@ -123,8 +137,50 @@
f.close()
def write_master_index (index_files):
- pass
+ f = open(os.path.join(DESTDIR, 'index.yml'), 'w')
+ f.write("""--- !fragment
+template: index.html
+# The data to pass to the template
+local:
+ title: FAQs
+ content: !fragment content.yml
+""")
+ f.close()
+
+ f = open(os.path.join(DESTDIR, 'content.yml'), 'w')
+ f.write("""--- !fragment
+# Type of template to use
+template: content.html
+# The data to pass to the template
+local:
+ content:
+ text: !htmlfile listing.html
+ breadcrumb: !breadcrumb nav.yml nav
+""")
+ f.close()
+
+ f = open(os.path.join(DESTDIR, 'listing.html'), 'w')
+ f.write('<p>XXX put content here later</p>')
+ f.close()
+
+ f = open(os.path.join(DESTDIR, 'nav.yml'), 'w')
+ f.write("""--- !fragment
+# Type of template to use
+template: nav.html
+
+# Contents of the template
+global:
+ nav : !sectionnav |
+ xxx index.html
+""")
+ f.close()
+
+ f = open(os.path.join(DESTDIR, 'content.html'), 'w')
+ f.write("""<n:invisible n:data="content" n:render="mapping">
+<n:slot name="text"></n:slot>
+</n:invisible>""")
+ f.close()
if os.path.exists(DESTDIR):
shutil.rmtree(DESTDIR)
More information about the Python-checkins
mailing list