Skip to content

Commit fc628cf

Browse files
committed
adapt Georg's labels generation for the development style guide
git-svn-id: http://svn.osgeo.org/mapserver/trunk@8288 7532c77e-422f-0410-93f4-f0b67bdd69e2
1 parent 270d739 commit fc628cf

File tree

5 files changed

+256
-11
lines changed

5 files changed

+256
-11
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,11 @@ linkcheck:
7373
@echo
7474
@echo "Link check complete; look for any errors in the above output " \
7575
"or in build/linkcheck/output.txt."
76+
77+
labels:
78+
mkdir -p build/labels build/doctrees
79+
$(SPHINXBUILD) -b labels $(ALLSPHINXOPTS) build/labels
80+
@echo
81+
@echo "Link check complete; look for any errors in the above output " \
82+
"or in build/labels/output.txt."
83+
cp build/labels/labels.txt include/labels.inc

conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
# If your extensions are in another directory, add it here. If the directory
1717
# is relative to the documentation root, use os.path.abspath to make it
1818
# absolute, like shown here.
19-
#sys.path.append(os.path.abspath('.'))
19+
sys.path.append(os.path.abspath('.'))
2020

2121
# General configuration
2222
# ---------------------
2323

2424
# Add any Sphinx extension module names here, as strings. They can be extensions
2525
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
26-
extensions = []
26+
extensions = ['labels']
2727

2828
# Add any paths that contain templates here, relative to this directory.
2929
templates_path = ['_templates']

development/doc_style_guide.txt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
:backlinks: top
1414

1515

16-
MapServer instead of mapserver, map server, Map Server or map Server.
17-
18-
MapScript instead of mapscript, Mapscript, or map script.
19-
20-
PostGIS instead of postgis.
21-
22-
HowTo instead of howto or HOWTO.
16+
* MapServer instead of mapserver, map server, Map Server or map Server.
17+
* MapScript instead of mapscript, Mapscript, or map script.
18+
* PostGIS instead of postgis.
19+
* HowTo instead of howto or HOWTO.
20+
* Email addresses should be manually spam protected:
21+
22+
::
2323

24+
hobu.inc at gmail.com instead of hobu.inc@gmail.com
2425

2526
ReStructured Text Formatting
2627
----------------------------
@@ -30,6 +31,8 @@ the source code.
3031

3132
no ``.. sectnum::`` in the contents directives
3233

34+
Reference Labels
35+
----------------
36+
37+
.. include:: ../include/labels.inc
3338

34-
Email addresses should be manually spam protected:
35-
hobu.inc at gmail.com instead of hobu.inc@gmail.com

include/labels.inc

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
.. table:: \:ref\: reference labels
2+
3+
============================ =============================================================================================
4+
Label Title
5+
============================ =============================================================================================
6+
agg :ref:`AGG Rendering Specifics <agg>`
7+
antialias :ref:`AntiAliasing with MapServer <antialias>`
8+
arcinfo :ref:`ArcInfo <arcinfo>`
9+
arcsde :ref:`ArcSDE <arcsde>`
10+
autotest :ref:`Regression Testing <autotest>`
11+
bugs :ref:`Bug Submission <bugs>`
12+
cgi :ref:`CGI <cgi>`
13+
cgi_controls :ref:`MapServer CGI Controls <cgi_controls>`
14+
cgi_introduction :ref:`MapServer CGI Introduction <cgi_introduction>`
15+
class :ref:`CLASS <class>`
16+
community :ref:`Community Activities <community>`
17+
development :ref:`Development <development>`
18+
dgn :ref:`DGN <dgn>`
19+
documentation :ref:`MapServer 5.2.1 Documentation <documentation>`
20+
dotnet_compile :ref:`.NET MapScript Compilation <dotnet_compile>`
21+
download :ref:`Download <download>`
22+
dynamic_charting :ref:`Dynamic Charting <dynamic_charting>`
23+
editing :ref:`Mapfile Editing <editing>`
24+
errors :ref:`Errors <errors>`
25+
expressions :ref:`Expressions <expressions>`
26+
fastcgi :ref:`FastCGI <fastcgi>`
27+
feature :ref:`FEATURE <feature>`
28+
filter_encoding :ref:`WFS Filter Encoding <filter_encoding>`
29+
flash :ref:`Flash Output <flash>`
30+
fontset :ref:`FONTSET <fontset>`
31+
format_types :ref:`Data Format Types <format_types>`
32+
genindex :ref:`genindex`
33+
gloss :ref:`Glossary <gloss>`
34+
gml :ref:`GML <gml>`
35+
grid :ref:`GRID <grid>`
36+
home :ref:`Welcome to MapServer <home>`
37+
html_legend :ref:`HTML Legends with MapServer <html_legend>`
38+
iis :ref:`IIS Setup for MapServer <iis>`
39+
imagemaps :ref:`HTML Imagemaps <imagemaps>`
40+
include :ref:`INCLUDE <include>`
41+
inline :ref:`Inline <inline>`
42+
input :ref:`Data Input <input>`
43+
input_postgis :ref:`PostGIS/PostgreSQL <input_postgis>`
44+
installation :ref:`Installation <installation>`
45+
introduction :ref:`An Introduction to MapServer <introduction>`
46+
irc :ref:`IRC <irc>`
47+
join :ref:`JOIN <join>`
48+
kml :ref:`KML - Keyhole Markup Language <kml>`
49+
label :ref:`LABEL <label>`
50+
layer :ref:`LAYER <layer>`
51+
legend :ref:`LEGEND <legend>`
52+
legend_utility :ref:`legend <legend_utility>`
53+
license :ref:`License <license>`
54+
linux :ref:`Linux <linux>`
55+
lists :ref:`Mailing Lists <lists>`
56+
management :ref:`Management <management>`
57+
map :ref:`MAP <map>`
58+
map_context :ref:`Map Context <map_context>`
59+
mapcontext_cgi :ref:`Map Context Files <mapcontext_cgi>`
60+
mapfile :ref:`Mapfile <mapfile>`
61+
mapfile_tuning :ref:`Mapfile <mapfile_tuning>`
62+
mapinfo :ref:`MapInfo <mapinfo>`
63+
mapscript :ref:`MapScript <mapscript>`
64+
mapscript_introduction :ref:`Introduction <mapscript_introduction>`
65+
mapscript_ows :ref:`MapScript Wrappers for WxS Services <mapscript_ows>`
66+
mapscript_tests :ref:`MapScript Unit Testing <mapscript_tests>`
67+
mapserv :ref:`mapserv <mapserv>`
68+
modindex :ref:`modindex`
69+
msencrypt :ref:`msencrypt <msencrypt>`
70+
mysql :ref:`MySQL <mysql>`
71+
ntf :ref:`NTF <ntf>`
72+
oci :ref:`Oracle Spatial <oci>`
73+
oci_install :ref:`Oracle Installation <oci_install>`
74+
ogc :ref:`OGC Operation and Configuration <ogc>`
75+
ogr :ref:`OGR <ogr>`
76+
online_resource_wms :ref:`More About the Online Resource URL <online_resource_wms>`
77+
optimization :ref:`Optimization <optimization>`
78+
osx :ref:`Mac OS X <osx>`
79+
output :ref:`Output Generation <output>`
80+
outputformat :ref:`OUTPUTFORMAT <outputformat>`
81+
pdf :ref:`PDF Output <pdf>`
82+
pgeo :ref:`ESRI Personal Geodatabase (MDB) <pgeo>`
83+
php :ref:`PHP MapScript <php>`
84+
php_example :ref:`By Example <php_example>`
85+
php_install :ref:`PHP MapScript Installation <php_install>`
86+
projection :ref:`PROJECTION <projection>`
87+
python :ref:`Python MapScript Appendix <python>`
88+
querying :ref:`Querying <querying>`
89+
querymap :ref:`QUERYMAP <querymap>`
90+
raster :ref:`Raster Data <raster>`
91+
raster_optimization :ref:`Raster <raster_optimization>`
92+
reference :ref:`REFERENCE <reference>`
93+
rfc1 :ref:`MS RFC 1: Technical Steering Committee Guidelines <rfc1>`
94+
rfc10 :ref:`MS RFC 10: Joining the Open Source Geospatial Foundation <rfc10>`
95+
rfc11 :ref:`MS RFC 11: Support for Curved Labels <rfc11>`
96+
rfc12 :ref:`MS RFC 12: C code Unit tests <rfc12>`
97+
rfc13 :ref:`MS RFC 13: Support of Sensor Observation Service in MapServer <rfc13>`
98+
rfc14 :ref:`MS RFC 14: Relative Coordinates for INLINE features <rfc14>`
99+
rfc15 :ref:`MS RFC 15: Support for thread neutral operation of MapServer/MapScript <rfc15>`
100+
rfc16 :ref:`MS RFC 16: MapScript WxS Services <rfc16>`
101+
rfc17 :ref:`MS RFC 17: Dynamic Allocation of layers, styles, classes and symbols <rfc17>`
102+
rfc18 :ref:`MS RFC 18: Encryption of passwords in mapfiles <rfc18>`
103+
rfc19 :ref:`MS RFC 19: Style & Label attribute binding <rfc19>`
104+
rfc2 :ref:`MS RFC 2: Creating line features and/or shapes using WKT <rfc2>`
105+
rfc21 :ref:`MS RFC 21: MapServer Raster Color Correction <rfc21>`
106+
rfc22a :ref:`MS RFC 22a: Feature cache for long running processes and query processing <rfc22a>`
107+
rfc23 :ref:`MS RFC 23: Technical Steering Committee Guidelines <rfc23>`
108+
rfc24 :ref:`MS RFC 24: Mapscript memory management <rfc24>`
109+
rfc24first :ref:`MS RFC 24: Mapscript memory management <rfc24first>`
110+
rfc25 :ref:`MS RFC 25: Align MapServer pixel and extent models with OGC models <rfc25>`
111+
rfc26 :ref:`MS RFC 26: Version 5 Terminology Cleanup <rfc26>`
112+
rfc27 :ref:`MS RFC 27: Label Priority <rfc27>`
113+
rfc28 :ref:`MS RFC 28: Redesign of LOG/DEBUG output mechanisms <rfc28>`
114+
rfc29 :ref:`MS RFC 29: Dynamic Charting Capability <rfc29>`
115+
rfc3 :ref:`MS RFC 3: Feature Layer Plug-in Architecture <rfc3>`
116+
rfc30 :ref:`MS RFC 30: Support for WMS 1.3.0 <rfc30>`
117+
rfc31 :ref:`MS RFC 31: Loading MapServer Objects from Strings <rfc31>`
118+
rfc32 :ref:`MS RFC 32: Support for Anti-Grain Geometry (AGG) Rendering Engine <rfc32>`
119+
rfc33 :ref:`MS RFC 33: Removing msLayerWhichItems() from maplayer.c <rfc33>`
120+
rfc39 :ref:`MS RFC 39: Support of WMS/SLD Named Styles <rfc39>`
121+
rfc4 :ref:`MS RFC 4: MapServer Raster Resampling <rfc4>`
122+
rfc40 :ref:`MS RFC 40: Support Label Text Transformations <rfc40>`
123+
rfc41 :ref:`MS RFC 41: Support of WCS 1.1.x Protocol <rfc41>`
124+
rfc42 :ref:`MS RFC 42: Support of Cookies Forwarding <rfc42>`
125+
rfc43 :ref:`MS RFC 43: Direct tile generation for Google Maps and Virtual Earth API <rfc43>`
126+
rfc44 :ref:`MS RFC 44: Restore URL modification of mapfiles to pre-5.0 levels <rfc44>`
127+
rfc45 :ref:`MS RFC 45: Symbology, Labeling, and Cartography Improvements <rfc45>`
128+
rfc46 :ref:`MS RFC 46: Migrate Website to OSGeo <rfc46>`
129+
rfc47 :ref:`MS RFC 47: Move IGNORE_MISSING_DATA to run-time configuration <rfc47>`
130+
rfc48 :ref:`MS RFC 48: GEOTRANSFORM Geometry operations <rfc48>`
131+
rfc49 :ref:`MS RFC 49: Symbology, Labeling, and Cartography Improvements <rfc49>`
132+
rfc5 :ref:`MS RFC 5: MapServer Horizon Reprojection Improvements <rfc5>`
133+
rfc50 :ref:`MS RFC 50: OpenGL Rendering Support <rfc50>`
134+
rfc6 :ref:`MS RFC 6: Color Range Mapping of Continuous Feature Values <rfc6>`
135+
rfc7 :ref:`MS RFC 7: MapServer CVS Commit Management <rfc7>`
136+
rfc7.1 :ref:`MS RFC 7.1: MapServer SVN Commit Management <rfc7.1>`
137+
rfc8 :ref:`MS RFC 8: Pluggable External Feature Layer Providers <rfc8>`
138+
rfc9 :ref:`MS RFC 9: Item tag for query templates <rfc9>`
139+
rfcs :ref:`Request for Comments <rfcs>`
140+
runsub :ref:`Run-time Substitution <runsub>`
141+
s57 :ref:`S57 <s57>`
142+
scalebar :ref:`SCALEBAR <scalebar>`
143+
scalebar_utility :ref:`scalebar <scalebar_utility>`
144+
sdts :ref:`SDTS <sdts>`
145+
search :ref:`search`
146+
shapefiles :ref:`ESRI Shapefiles (SHP) <shapefiles>`
147+
shp2img :ref:`shp2img <shp2img>`
148+
shptree :ref:`shptree <shptree>`
149+
shptreevis :ref:`shptreevis <shptreevis>`
150+
sld :ref:`SLD <sld>`
151+
sortshp :ref:`sortshp <sortshp>`
152+
sos_server :ref:`SOS Server <sos_server>`
153+
source :ref:`Source <source>`
154+
sponsors :ref:`Sponsors <sponsors>`
155+
style :ref:`STYLE <style>`
156+
svg :ref:`SVG <svg>`
157+
svn :ref:`Subversion <svn>`
158+
swig :ref:`SWIG MapScript API Reference <swig>`
159+
sym2img :ref:`legend <sym2img>`
160+
sym_construction :ref:`Cartographic Symbol Construction with MapServer <sym_construction>`
161+
sym_examples :ref:`Symbology Examples <sym_examples>`
162+
symbol :ref:`SYMBOL <symbol>`
163+
template :ref:`Templating <template>`
164+
testing :ref:`Testing <testing>`
165+
tiger :ref:`USGS TIGER <tiger>`
166+
tile4ms :ref:`tile4ms <tile4ms>`
167+
tile_mode :ref:`Tile Mode <tile_mode>`
168+
tileindex :ref:`Tile Indexes <tileindex>`
169+
unix :ref:`Compiling on Unix <unix>`
170+
utilities :ref:`Utilities <utilities>`
171+
variable_sub :ref:`Variable Substitution <variable_sub>`
172+
vector :ref:`Vector Data <vector>`
173+
vector_optimization :ref:`Vector <vector_optimization>`
174+
vim :ref:`VIM Syntax <vim>`
175+
virtual_vector :ref:`Virtual Spatial Data <virtual_vector>`
176+
wcs_format :ref:`WCS Use Cases <wcs_format>`
177+
wcs_server :ref:`WCS Server <wcs_server>`
178+
web :ref:`WEB <web>`
179+
wfs :ref:`WFS <wfs>`
180+
wfs_client :ref:`WFS Client <wfs_client>`
181+
wfs_server :ref:`WFS Server <wfs_server>`
182+
win32 :ref:`Compiling on Win32 <win32>`
183+
windows :ref:`Windows <windows>`
184+
wms_capabilities :ref:`Validate the Capabilities Metadata <wms_capabilities>`
185+
wms_client :ref:`WMS Client <wms_client>`
186+
wms_server :ref:`WMS Server <wms_server>`
187+
wms_time :ref:`WMS Time <wms_time>`
188+
wrapper :ref:`A Simple CGI Wrapper Script <wrapper>`
189+
============================ =============================================================================================

labels.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
from os import path
3+
from itertools import groupby
4+
from sphinx.builder import Builder
5+
6+
class CollectLabelsBuilder(Builder):
7+
"""
8+
Collects all present explicit labels into a table.
9+
"""
10+
name = 'labels'
11+
12+
def init(self):
13+
pass
14+
15+
def get_outdated_docs(self):
16+
return "table with all labels"
17+
18+
def write(self, *ignored):
19+
labels = self.env.labels.items()
20+
labels.sort(key=lambda x: x[0])
21+
22+
outfile = open(path.join(self.outdir, 'labels.txt'), 'w')
23+
outfile.write('.. table:: \:ref\: reference labels\n\n')
24+
outfile.write('\t============================ =============================================================================================\n')
25+
outfile.write('\t%s %s\n' % ('Label'.ljust(30), 'Title'))
26+
outfile.write('\t============================ =============================================================================================\n')
27+
28+
unlabeled = ['genindex','search','modindex']
29+
for docname, items in groupby(labels, key=lambda x: x[1][0]):
30+
for label in items:
31+
if label[0] in unlabeled:
32+
outfile.write("""\t%s :ref:`%s`\n""" % (label[0].ljust(30), label[0]))
33+
else:
34+
outfile.write("""\t%s :ref:`%s <%s>`\n""" % (label[0].ljust(30), label[1][2],label[0]))
35+
36+
outfile.write('\t============================ =============================================================================================\n')
37+
38+
outfile.close()
39+
40+
def finish(self):
41+
return
42+
43+
44+
def setup(app):
45+
app.add_builder(CollectLabelsBuilder)

0 commit comments

Comments
 (0)