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
6 This causes devhelp2 files to get a version. Due to that devhelp can show it
7 along with the 0.10 version.
9 gtk-doc-plugins.mak | 11 ++++-------
10 gtk-doc.mak | 11 ++++-------
11 2 files changed, 8 insertions(+), 14 deletions(-)
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"; \
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)
28 @rm -f html/version.entities
29 @@ -289,9 +286,9 @@ install-data-local:
30 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
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; \
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
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)"; \
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)
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); \
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; \
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
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.
79 gtk-doc-plugins.mak | 15 +++--------
80 mangle-tmpl.py | 72 ++++++++++++-----------------------------------------
81 2 files changed, 19 insertions(+), 68 deletions(-)
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
91 -#### update templates; done on every build ####
92 +#### generate templates; done on every build ####
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); \
101 - if test -e $(srcdir)/$$f; then cp -u $(srcdir)/$$f . ; fi; \
104 - @gtkdoc-mktmpl --module=$(DOC_MODULE)
106 + @echo ' DOC Building template files'
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
115 # vi:si:et:sw=4:sts=4:ts=4
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
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
131 -# read in inspect/*.xml
132 -# for every tmpl/element-(name).xml: mangle with details from element
139 @@ -28,37 +19,12 @@ def __init__(self, filename):
140 self._sectionids = []
145 - Read and parse the sections from the given file.
147 - lines = open(self.filename).readlines()
148 - matcher = re.compile("<!-- ##### SECTION (\S+) ##### -->\n")
152 - match = matcher.search(line)
154 - id = match.expand("\\1")
155 - self._sectionids.append(id)
156 - self._sections[id] = []
160 - "WARNING: line before a SECTION header: %s" % line)
162 - self._sections[id].append(line)
164 - def get_section(self, id):
166 - Get the content from the given section.
168 - return self._sections[id]
170 def set_section(self, id, content):
172 Replace the given section id with the given content.
174 + if not id in self._sectionids:
175 + self._sectionids.append(id)
176 self._sections[id] = content
179 @@ -73,14 +39,10 @@ def output(self):
181 return "".join(lines)
183 - def write(self, backup=False):
186 Write out the template file again, backing up the previous one.
189 - target = self.filename + ".mangle.bak"
190 - os.rename(self.filename, target)
192 handle = open(self.filename, "w")
193 handle.write(self.output())
195 @@ -136,30 +98,28 @@ def main():
196 inspectdir = sys.argv[1]
197 tmpldir = sys.argv[2]
199 + if not os.path.exists (tmpldir):
202 # parse all .xml files; build map of element name -> short desc
203 #for file in glob.glob("inspect/plugin-*.xml"):
205 for file in glob.glob("%s/plugin-*.xml" % inspectdir):
206 elements.update(get_elements(file))
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)
215 - if element in elements.keys():
216 - description = elements[element]['description']
217 - tmpl.set_section("Short_Description", "%s\n\n" % description)
219 - # put in an include if not yet there
220 + description = elements[element]['description']
221 + tmpl.set_section("Short_Description", "%s\n" % description)
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" />' + \
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)
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
241 As some places we where assuming a single directory. This caused some
242 plugins documentation to be ignored.
244 gtk-doc-plugins.mak | 8 ++++++--
245 gtk-doc.mak | 6 +++++-
246 2 files changed, 11 insertions(+), 3 deletions(-)
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
257 + @_source_dir='' ; \
258 + for i in $(DOC_SOURCE_DIR) ; do \
259 + _source_dir="$${_source_dir} --source-dir=$$i" ; \
262 --module=$(DOC_MODULE) \
263 - --source-dir=$(DOC_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
272 @@ -121,7 +121,11 @@ $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)
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" ; \
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