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:
@@ -34,6 +34,12 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
.ex_tags{
|
||||||
|
display: inline;
|
||||||
|
font-size: smaller;
|
||||||
|
font-style: italic;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
.ex_filename {
|
.ex_filename {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
@@ -231,6 +237,9 @@
|
|||||||
<p class="ex_classes" jugl:content="example.classes">
|
<p class="ex_classes" jugl:content="example.classes">
|
||||||
Related Classes go here
|
Related Classes go here
|
||||||
</p>
|
</p>
|
||||||
|
<div class="ex_tags" jugl:content="'...tagged with ' + example.tags">
|
||||||
|
|
||||||
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -135,6 +135,10 @@ def createFeed(examples):
|
|||||||
title = doc.createElementNS(atomuri, "title")
|
title = doc.createElementNS(atomuri, "title")
|
||||||
title.appendChild(doc.createTextNode(example["title"] or example["example"]))
|
title.appendChild(doc.createTextNode(example["title"] or example["example"]))
|
||||||
entry.appendChild(title)
|
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 = doc.createElementNS(atomuri, "link")
|
||||||
link.setAttribute("href", "%s%s" % (feedPath, example["example"]))
|
link.setAttribute("href", "%s%s" % (feedPath, example["example"]))
|
||||||
@@ -171,7 +175,7 @@ def wordIndex(examples):
|
|||||||
"""
|
"""
|
||||||
index = {}
|
index = {}
|
||||||
unword = re.compile("\\W+")
|
unword = re.compile("\\W+")
|
||||||
keys = ["shortdesc", "title"]
|
keys = ["shortdesc", "title", "tags"]
|
||||||
for i in range(len(examples)):
|
for i in range(len(examples)):
|
||||||
for key in keys:
|
for key in keys:
|
||||||
text = examples[i][key]
|
text = examples[i][key]
|
||||||
@@ -204,7 +208,7 @@ if __name__ == "__main__":
|
|||||||
print 'Reading examples from %s and writing out to %s' % (examplesLocation, outFile.name)
|
print 'Reading examples from %s and writing out to %s' % (examplesLocation, outFile.name)
|
||||||
|
|
||||||
exampleList = []
|
exampleList = []
|
||||||
docIds = ['title','shortdesc']
|
docIds = ['title','shortdesc','tags']
|
||||||
|
|
||||||
#comment out option to create docs from online resource
|
#comment out option to create docs from online resource
|
||||||
#examplesLocation = 'http://svn.openlayers.org/sandbox/docs/examples/'
|
#examplesLocation = 'http://svn.openlayers.org/sandbox/docs/examples/'
|
||||||
|
|||||||
Reference in New Issue
Block a user