From 4be76145708012c320cc9c67100c4a58c67ad707 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Mon, 13 Sep 2010 11:27:12 +0000 Subject: [PATCH] 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 --- examples/example-list.html | 9 +++++++++ tools/exampleparser.py | 8 ++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/examples/example-list.html b/examples/example-list.html index 038b9574e4..34c5e5eb1e 100644 --- a/examples/example-list.html +++ b/examples/example-list.html @@ -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 @@

Related Classes go here

+
+ +
diff --git a/tools/exampleparser.py b/tools/exampleparser.py index 11b183e0f1..9ee16ea29e 100755 --- a/tools/exampleparser.py +++ b/tools/exampleparser.py @@ -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/'