]>
Commit | Line | Data |
---|---|---|
e9716b6c JB |
1 | From 2de221ce94b657f9c9a75aa3cc0cb84dbb5da78b Mon Sep 17 00:00:00 2001 |
2 | From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete@collabora.co.uk> | |
3 | Date: Mon, 28 Jan 2013 20:28:09 +0100 | |
4 | Subject: [PATCH] gtk-doc*.mak: Put the API version in the html book name | |
5 | ||
6 | This causes devhelp2 files to get a version. Due to that devhelp can show it | |
7 | along with the 0.10 version. | |
8 | --- | |
9 | gtk-doc-plugins.mak | 11 ++++------- | |
10 | gtk-doc.mak | 11 ++++------- | |
11 | 2 files changed, 8 insertions(+), 14 deletions(-) | |
12 | ||
13 | diff --git a/gtk-doc-plugins.mak b/gtk-doc-plugins.mak | |
14 | index f69d9d7..f19e7d7 100644 | |
15 | --- a/gtk-doc-plugins.mak | |
16 | +++ b/gtk-doc-plugins.mak | |
17 | @@ -222,10 +222,7 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) | |
18 | mkhtml_options="$$mkhtml_options --verbose"; \ | |
19 | fi; \ | |
20 | fi; \ | |
21 | - cd html && gtkdoc-mkhtml $$mkhtml_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) | |
22 | - @mv html/index.sgml html/index.sgml.bak | |
23 | - @$(SED) "s/ href=\"$(DOC_MODULE)\// href=\"$(DOC_MODULE)-@GST_MAJORMINOR@\//g" html/index.sgml.bak >html/index.sgml | |
24 | - @rm -f html/index.sgml.bak | |
25 | + cd html && gtkdoc-mkhtml $$mkhtml_options $(DOC_MODULE)-@GST_MAJORMINOR@ $(DOC_MAIN_SGML_FILE) | |
26 | @rm -f html/$(DOC_MAIN_SGML_FILE) | |
27 | @rm -rf html/xml | |
28 | @rm -f html/version.entities | |
29 | @@ -289,9 +286,9 @@ install-data-local: | |
30 | $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ | |
31 | done; \ | |
32 | fi; \ | |
33 | - echo '-- Installing $(builddir)/html/$(DOC_MODULE).devhelp2' ; \ | |
34 | - if test -e $(builddir)/html/$(DOC_MODULE).devhelp2; then \ | |
35 | - $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE).devhelp2 \ | |
36 | + echo '-- Installing $(builddir)/html/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2' ; \ | |
37 | + if test -e $(builddir)/html/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; then \ | |
38 | + $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2 \ | |
39 | $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; \ | |
40 | fi; \ | |
41 | $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) || true ; \ | |
42 | diff --git a/gtk-doc.mak b/gtk-doc.mak | |
43 | index 17cee71..9d76889 100644 | |
44 | --- a/gtk-doc.mak | |
45 | +++ b/gtk-doc.mak | |
46 | @@ -130,10 +130,7 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) | |
47 | if test "$(?)" = "0"; then \ | |
48 | mkhtml_options=--path="$(abs_srcdir)"; \ | |
49 | fi; \ | |
50 | - cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) | |
51 | - @mv html/index.sgml html/index.sgml.bak | |
52 | - @$(SED) "s/ href=\"$(DOC_MODULE)\// href=\"$(DOC_MODULE)-@GST_MAJORMINOR@\//g" html/index.sgml.bak >html/index.sgml | |
53 | - @rm -f html/index.sgml.bak | |
54 | + cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE)-@GST_MAJORMINOR@ ../$(DOC_MAIN_SGML_FILE) | |
55 | @rm -rf html/xml | |
56 | @rm -f version.entities | |
57 | @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) $(abs_builddir)/html ) | |
58 | @@ -189,9 +186,9 @@ install-data-local: | |
59 | echo '-- Installing '$$i ; \ | |
60 | $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ | |
61 | done; \ | |
62 | - echo '-- Installing $(builddir)/html/$(DOC_MODULE).devhelp2' ; \ | |
63 | - if test -e $(builddir)/html/$(DOC_MODULE).devhelp2; then \ | |
64 | - $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE).devhelp2 \ | |
65 | + echo '-- Installing $(builddir)/html/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2' ; \ | |
66 | + if test -e $(builddir)/html/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; then \ | |
67 | + $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2 \ | |
68 | $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; \ | |
69 | fi; \ | |
70 | $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) || true ; \ | |
71 | From d37af32e2d6d1b546af72978f8441a84996ab3ea Mon Sep 17 00:00:00 2001 | |
72 | From: Stefan Sauer <ensonic@users.sf.net> | |
73 | Date: Sun, 7 Jun 2015 20:12:05 +0200 | |
74 | Subject: [PATCH] mangle-tmpl.py: generate tmpl files instead of merging | |
75 | ||
76 | We don't have any hand-written docs in tmpl files. Stop generating them with | |
77 | gtkdoc and just write the minimal files ourself. | |
78 | --- | |
79 | gtk-doc-plugins.mak | 15 +++-------- | |
80 | mangle-tmpl.py | 72 ++++++++++++----------------------------------------- | |
81 | 2 files changed, 19 insertions(+), 68 deletions(-) | |
82 | ||
83 | diff --git a/gtk-doc-plugins.mak b/gtk-doc-plugins.mak | |
84 | index 5d9b2f9..767e55a 100644 | |
85 | --- a/gtk-doc-plugins.mak | |
86 | +++ b/gtk-doc-plugins.mak | |
87 | @@ -171,19 +171,10 @@ scan-build.stamp: $(HFILE_GLOB) $(EXTRA_HFILES) $(basefiles) scanobj-build.stamp | |
88 | --ignore-headers="$(IGNORE_HFILES)"; \ | |
89 | touch scan-build.stamp | |
90 | ||
91 | -#### update templates; done on every build #### | |
92 | +#### generate templates; done on every build #### | |
93 | ||
94 | -# in a non-srcdir build, we need to copy files from the previous step | |
95 | -# and the files from previous runs of this step | |
96 | -tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES) | |
97 | - @echo ' DOC Rebuilding template files' | |
98 | - @if test x"$(srcdir)" != x. ; then \ | |
99 | - for f in $(SCANOBJ_FILES) $(SCAN_FILES); \ | |
100 | - do \ | |
101 | - if test -e $(srcdir)/$$f; then cp -u $(srcdir)/$$f . ; fi; \ | |
102 | - done; \ | |
103 | - fi | |
104 | - @gtkdoc-mktmpl --module=$(DOC_MODULE) | |
105 | +tmpl-build.stamp: | |
106 | + @echo ' DOC Building template files' | |
107 | @$(PYTHON) \ | |
108 | $(top_srcdir)/common/mangle-tmpl.py $(srcdir)/$(INSPECT_DIR) tmpl | |
109 | @touch tmpl-build.stamp | |
110 | diff --git a/mangle-tmpl.py b/mangle-tmpl.py | |
111 | index 51ea8c2..7a92d04 100644 | |
112 | --- a/mangle-tmpl.py | |
113 | +++ b/mangle-tmpl.py | |
114 | @@ -2,21 +2,12 @@ | |
115 | # vi:si:et:sw=4:sts=4:ts=4 | |
116 | ||
117 | """ | |
118 | -use the output from gst-xmlinspect.py to mangle tmpl/*.sgml and | |
119 | -insert/overwrite Short Description and Long Description | |
120 | +use the files from inspect/*.xml to create mininal tmpl/*.sgml files containing | |
121 | +'Short Description' and 'Long Description' to inject element details into the | |
122 | +docbook files produced by gtkdoc-mkdb | |
123 | """ | |
124 | ||
125 | -# FIXME: right now it uses pygst and scans on its own; | |
126 | -# we really should use inspect/*.xml instead since the result of | |
127 | -# gst-xmlinspect.py is committed by the docs maintainer, who can be | |
128 | -# expected to have pygst, but this step should be done for every docs build, | |
129 | -# so no pygst allowed | |
130 | - | |
131 | -# read in inspect/*.xml | |
132 | -# for every tmpl/element-(name).xml: mangle with details from element | |
133 | - | |
134 | import glob | |
135 | -import re | |
136 | import sys | |
137 | import os | |
138 | ||
139 | @@ -28,37 +19,12 @@ def __init__(self, filename): | |
140 | self._sectionids = [] | |
141 | self._sections = {} | |
142 | ||
143 | - def read(self): | |
144 | - """ | |
145 | - Read and parse the sections from the given file. | |
146 | - """ | |
147 | - lines = open(self.filename).readlines() | |
148 | - matcher = re.compile("<!-- ##### SECTION (\S+) ##### -->\n") | |
149 | - id = None | |
150 | - | |
151 | - for line in lines: | |
152 | - match = matcher.search(line) | |
153 | - if match: | |
154 | - id = match.expand("\\1") | |
155 | - self._sectionids.append(id) | |
156 | - self._sections[id] = [] | |
157 | - else: | |
158 | - if not id: | |
159 | - sys.stderr.write( | |
160 | - "WARNING: line before a SECTION header: %s" % line) | |
161 | - else: | |
162 | - self._sections[id].append(line) | |
163 | - | |
164 | - def get_section(self, id): | |
165 | - """ | |
166 | - Get the content from the given section. | |
167 | - """ | |
168 | - return self._sections[id] | |
169 | - | |
170 | def set_section(self, id, content): | |
171 | """ | |
172 | Replace the given section id with the given content. | |
173 | """ | |
174 | + if not id in self._sectionids: | |
175 | + self._sectionids.append(id) | |
176 | self._sections[id] = content | |
177 | ||
178 | def output(self): | |
179 | @@ -73,14 +39,10 @@ def output(self): | |
180 | ||
181 | return "".join(lines) | |
182 | ||
183 | - def write(self, backup=False): | |
184 | + def write(self): | |
185 | """ | |
186 | Write out the template file again, backing up the previous one. | |
187 | """ | |
188 | - if backup: | |
189 | - target = self.filename + ".mangle.bak" | |
190 | - os.rename(self.filename, target) | |
191 | - | |
192 | handle = open(self.filename, "w") | |
193 | handle.write(self.output()) | |
194 | handle.close() | |
195 | @@ -136,30 +98,28 @@ def main(): | |
196 | inspectdir = sys.argv[1] | |
197 | tmpldir = sys.argv[2] | |
198 | ||
199 | + if not os.path.exists (tmpldir): | |
200 | + os.mkdir(tmpldir) | |
201 | + | |
202 | # parse all .xml files; build map of element name -> short desc | |
203 | #for file in glob.glob("inspect/plugin-*.xml"): | |
204 | elements = {} | |
205 | for file in glob.glob("%s/plugin-*.xml" % inspectdir): | |
206 | elements.update(get_elements(file)) | |
207 | ||
208 | - for file in glob.glob("%s/element-*.sgml" % tmpldir): | |
209 | - base = os.path.basename(file) | |
210 | - element = base[len("element-"):-len(".sgml")] | |
211 | + for element in elements.keys(): | |
212 | + file = "%s/element-%s.sgml" % (tmpldir, element) | |
213 | tmpl = Tmpl(file) | |
214 | - tmpl.read() | |
215 | - if element in elements.keys(): | |
216 | - description = elements[element]['description'] | |
217 | - tmpl.set_section("Short_Description", "%s\n\n" % description) | |
218 | ||
219 | - # put in an include if not yet there | |
220 | + description = elements[element]['description'] | |
221 | + tmpl.set_section("Short_Description", "%s\n" % description) | |
222 | + | |
223 | + # add include for details | |
224 | line = '<include xmlns="http://www.w3.org/2003/XInclude" href="' + \ | |
225 | 'element-' + element + '-details.xml">' + \ | |
226 | '<fallback xmlns="http://www.w3.org/2003/XInclude" />' + \ | |
227 | '</include>\n' | |
228 | - section = tmpl.get_section("Long_Description") | |
229 | - if not section[0] == line: | |
230 | - section.insert(0, line) | |
231 | - tmpl.set_section("Long_Description", section) | |
232 | + tmpl.set_section("Long_Description", line) | |
233 | tmpl.write() | |
234 | ||
235 | main() | |
236 | From f363b3205658a38e84fa77f19dee218cd4445275 Mon Sep 17 00:00:00 2001 | |
237 | From: Nicolas Dufresne <nicolas.dufresne@collabora.com> | |
238 | Date: Mon, 20 Jun 2016 15:38:01 -0400 | |
239 | Subject: [PATCH] Fix handling of DOC_SOURCE_DIR list | |
240 | ||
241 | As some places we where assuming a single directory. This caused some | |
242 | plugins documentation to be ignored. | |
243 | --- | |
244 | gtk-doc-plugins.mak | 8 ++++++-- | |
245 | gtk-doc.mak | 6 +++++- | |
246 | 2 files changed, 11 insertions(+), 3 deletions(-) | |
247 | ||
248 | diff --git a/gtk-doc-plugins.mak b/gtk-doc-plugins.mak | |
249 | index fe0977c..4b5dd1b 100644 | |
250 | --- a/gtk-doc-plugins.mak | |
251 | +++ b/gtk-doc-plugins.mak | |
252 | @@ -179,9 +179,13 @@ sgml-build.stamp: scan-build.stamp $(CFILE_GLOB) $(top_srcdir)/common/plugins.xs | |
253 | $(top_srcdir)/common/plugins.xsl $$a > xml/`basename $$a`; done | |
254 | @for f in $(EXAMPLE_CFILES); do \ | |
255 | $(PYTHON) $(top_srcdir)/common/c-to-xml.py $$f > xml/element-`basename $$f .c`.xml; done | |
256 | - @gtkdoc-mkdb \ | |
257 | + @_source_dir='' ; \ | |
258 | + for i in $(DOC_SOURCE_DIR) ; do \ | |
259 | + _source_dir="$${_source_dir} --source-dir=$$i" ; \ | |
260 | + done ; \ | |
261 | + gtkdoc-mkdb \ | |
262 | --module=$(DOC_MODULE) \ | |
263 | - --source-dir=$(DOC_SOURCE_DIR) \ | |
264 | + $${_source_dir} \ | |
265 | --expand-content-files="$(expand_content_files)" \ | |
266 | --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) \ | |
267 | --output-format=xml \ | |
268 | diff --git a/gtk-doc.mak b/gtk-doc.mak | |
269 | index 2aab3a9..4beebcf 100644 | |
270 | --- a/gtk-doc.mak | |
271 | +++ b/gtk-doc.mak | |
272 | @@ -121,7 +121,11 @@ $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE) | |
273 | ||
274 | sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(expand_content_files) | |
275 | @echo ' DOC Building XML' | |
276 | - @gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) --output-format=xml $(MKDB_OPTIONS) | |
277 | + @_source_dir='' ; \ | |
278 | + for i in $(DOC_SOURCE_DIR) ; do \ | |
279 | + _source_dir="$${_source_dir} --source-dir=$$i" ; \ | |
280 | + done ; \ | |
281 | + gtkdoc-mkdb --module=$(DOC_MODULE) $$(_source_dir) --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) --output-format=xml $(MKDB_OPTIONS) | |
282 | @cp ../version.entities xml | |
283 | @touch sgml-build.stamp | |
284 |