Add support for examples list to parse and use tags. Patch from marcjansen

at the code sprint at FOSS4G2010. Woohoo. r=me, (Closes #2829)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@10728 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2010-09-13 11:27:12 +00:00
parent 581525af98
commit 4be7614570
2 changed files with 15 additions and 2 deletions

View File

@@ -34,6 +34,12 @@
font-weight: bold;
color: #333;
}
.ex_tags{
display: inline;
font-size: smaller;
font-style: italic;
color: #333;
}
.ex_filename {
font-weight: normal;
font-size: 0.8em;
@@ -231,6 +237,9 @@
<p class="ex_classes" jugl:content="example.classes">
Related Classes go here
</p>
<div class="ex_tags" jugl:content="'...tagged with ' + example.tags">
</div>
</a>
</li>
</ul>

View File

@@ -135,6 +135,10 @@ def createFeed(examples):
title = doc.createElementNS(atomuri, "title")
title.appendChild(doc.createTextNode(example["title"] or example["example"]))
entry.appendChild(title)
tags = doc.createElementNS(atomuri, "tags")
tags.appendChild(doc.createTextNode(example["tags"] or example["example"]))
entry.appendChild(tags)
link = doc.createElementNS(atomuri, "link")
link.setAttribute("href", "%s%s" % (feedPath, example["example"]))
@@ -171,7 +175,7 @@ def wordIndex(examples):
"""
index = {}
unword = re.compile("\\W+")
keys = ["shortdesc", "title"]
keys = ["shortdesc", "title", "tags"]
for i in range(len(examples)):
for key in keys:
text = examples[i][key]
@@ -204,7 +208,7 @@ if __name__ == "__main__":
print 'Reading examples from %s and writing out to %s' % (examplesLocation, outFile.name)
exampleList = []
docIds = ['title','shortdesc']
docIds = ['title','shortdesc','tags']
#comment out option to create docs from online resource
#examplesLocation = 'http://svn.openlayers.org/sandbox/docs/examples/'