/usr/share/doc/rest2web/html/test_site/section1/index.txt is in rest2web-doc 0.5.2~alpha+svn-r248-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | restindex
format: html
page-title: The Science Index Page
crumb: Science
link-title: Science, Computers, and Technology
page-description:
This section contains books and articles about the wonderful worlds of Science, Computing, and Technology.
/description
sectionlist: science, computers, internet
section-description: science
This is a description of the articles on science.
This description is written using **reST**. That means it can include links__.
__ http://docutils.sourceforge.net
/description
section-description: computers
This is also a description. It would be easy to extend the range of text markups that *rest2web* supported. If there was any demand we could allow html in the descriptions, and even extend the range of supported markups to include *sextile* and *textile*. This would make the name **rest2web** [#]_ less appropriate of course.
.. [#] Obviously reST is my preferred markup...
/description
section-description: internet
This is also a description.
/description
/restindex
<div class="title">
<h1>The Science Index Page</h1>
</div>
<div class="intro">
<p>Welcome to something.</p>
</div>
<div class="indexblock">
<h2>These Are the Sections</h2>
<p>So enjoy....</p>
<div class="sitemap" id="index">
<table border="1" width="300" summary="Links to the Python Pages">
<tbody>
<tr><th colspan="2" >The Voidspace Science Sections</th></tr>
<#
import urllib
blank = ' '
row = '<tr><td>%s</td><td>%s</td></tr>'
entry = '<a href="#%s">%s</a>'
sectlist = [(urllib.quote(section), section.title()) for section in sectionlist if section is not None]
# note we use the variable sectionlist - to loop over the sections in the same order they appear
# in 'sectionlist' in the restindex. We also exclude ``None`` - the default section.
index = 0
while index < len(sectlist):
entry_1 = entry % sectlist[index]
if index == len(sectlist)-1:
entry_2 = blank
else:
entry_2 = entry % sectlist[index+1]
print row % (entry_1, entry_2)
index += 2
#>
<tr>
<td> </td>
<td> </td>
</tr>
</tbody>
</table>
</div>
<#
indexblock = '''\
<a name="%s" id="%s"></a>
<div class="indexblock">
<h2>%s</h2>
<p>%s</p>
<ul>
%s
</ul>
</div>
'''
pageblock = '''\
<li><a href="%s">%s</a>
<p>%s</p>
</li>
'''
for section in sections:
if section is None:
continue
thepages = []
for page in sections[section]['pages']:
a_page = pageblock % (page['target'], page['link-title'], page['page-description'])
if type(a_page) is unicode:
a_page = a_page.encode('utf8')
thepages.append(a_page)
thepages = '\n'.join(thepages)
id = urllib.quote(section)
sect_title = sections[section]['title']
desc = sections[section]['description']
this_sect = indexblock % ( id, id, sect_title, desc, thepages)
print this_sect
#>
</div>
|