Revert "mkdb: convert gtkdoc-mkdb to python"
[gtk-doc.git] / TODO
blob9049f6bce5a8dc8194c1114331941981eba44e55
2 The TODO list for the gtk-doc project is at Bugzilla,
3 the bugtracking system of the GNOME project.
5 Visit
6  http://bugzilla.gnome.org/buglist.cgi?product=gtk-doc&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED
7 to see what is allready requested, or where you can help. :-)
9 To put an other request on the TODO list, visit
10  http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc
12 Also have a look at
13  http://live.gnome.org/DocumentationProject/GtkDocFuture
14 and join discussion about future features.
17 Developers can also add items here :)
19 = Less files to manually edit =
20 The goal is that we configure gtk-doc in configure.ac and Makefile.am and
21 document the code in the sources. Right no we also have to edit a bunch of extra
22 files:
23  * $(DOC_MODULE).types
24  * $(DOC_MODULE)-docs.xml
25  * $(DOC_MODULE)-sections.txt
27 == .types ==
29 * using SCAN_OPTION="--rebuild-types" can be used to avoid maintaining the types
30   file
31 * we need to check if this works well for all kind of _types (e.g. boxed)
32   https://bugzilla.gnome.org/show_bug.cgi?id=605025
34 == -section.txt ==
35 https://bugzilla.gnome.org/show_bug.cgi?id=646094
37 * using SCAN_OPTION="--rebuild-sections" can be used to use the audogenerated
38   sections file
39 * when scanning a header file, everything of the header and the respective .c
40   file will be put to one section
41 * symbols can be hidden using __GTK_DOC_IGNORE__
43 * we need comment markup to override the section
44   e.g.: " * InSection: xxxx"
45   this needs gtkdoc-mkdb::ScanSourceFile to understand a new tag, which
46   otherwise would appear as verbatim in the sources
47 * if one has "@InSection: xxxx" in a section comment we could patch the
48   main.xml file and insert then xi:include line (would possibly rely on a
49   special comment-pair there, we might also need to rewrite these
50   auto-generated xi:includes everytime as the placements could have been
51   changed, or we have a xi:inlcude for each chapter, that we regenerate).
52 * we need a way to specify subsections (Standart, Private)
53   this could be done in the SECTION comment
54   e.g.: "@HideSymbols: <list-of-symbols-to-hide>
55   * we could allow to have a SUBSECTION:xxx comment block too
56     but then we list all the symbols here to override the auto-section placement
57 * if we want to avoid the "InSection in symbol docs we could also have
58   e.g.: "@ExtraSymbols: <list-of-symbols-to-include>
59 * documented symbols that are in a file without section comment and do not
60   appear in "@ExtraSymbols", "@HideSymbols" would go to unused.txt
61   * shall we deprecated the unused sub-sections?
62 * can we have both at the same time (for migration)
63   * yes, read section-file first and add/override from inline comments
66 = More abbreviations =
67 * expand urls (needds more work, see gtkdoc-mkdb : ExpandAbbreviations)
70 = Testing =
71 cd test/gobject
72 diff -u --exclude="Makefile*" docs docs-tmpl | diffstat
75 = Running =
76 gtk-doc is using a makefile with several targets to get from sources to docs. It
77 uses makefile variables for configuration.
78 It might be easier to have a gtkdoc tool that can run the other gtkdoc tools
79 in the right order (ev. by importing them as modules). This could handle a few
80 things nicer that the makefiles don't do well. This would also make it easy to
81 run it manually or integrate into other build systems.
83 = Intermediate files =
84 Can we change the intermediate files into a perl-module? So that all we need to
85 do is to import it. Ideally we have just one outfile for each tool:
86 gtkdoc-scan     -> scan.pm (decl.txt, decl-list.txt, types.txt, sections.txt)
87 gtkdoc-scangobj -> scanobj.pm (interfacs, prerequisites, ...)
89 Can we drop the decl-list.txt file (or rename to make sure this is what a
90 generated section.txt would look like)
92 = Issues =
93 * gtkdoc-fixxref makefile targets use $HTML_DIR
94   * HTML_DIR: The directory where gtk-doc generated documentation is installed
95     it comes from gtk-doc.m4 (--with-html-dir) but has no default
96   * automake exports $htmldir which is by default:
97     ${prefix}/share/doc/${PACKAGE_TARNAME}
98   * the Makefile uses $(DESTDIR)$(TARGET_DIR)
99     where TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE)
100     http://www.gnu.org/software/libtool/manual/automake/DESTDIR.html
101 * gtkdoc does not know about module versions
102   * this is causing troubles when multiple library versions are installed
103     (gtk+-{2,3}, gstreamer-{0.8,0.10,1.0}
104   * right now gtk-doc is xreffing against any <module>/index.sgml found
105   * just using the one with a higher number won't work
108 = Extensibility =
109 We'd like to extend gtk-doc to understand conventions/features of gobject libs.
110 Ideally libs register their extension hooks, so that other libs that use these
111 libs can benefit from the extensions too.
113 == custom get_types collector ==
114 - the default method takes the types from a type file
115 - gstreamer plugin docs take a list of types from the gst plugin registry
117 == custom properties ==
118 - gtk has style and child properties
120 == extra gobject property flags ==
121 - gstreamer has 'controllable' properties
123 = Output =
124 * http://sagehill.net/docbookxsl/index.html
125 * multipage-html
126   * would be good to be able to have page titles as a concatenation of document
127     name and page name (gtk+:GtkWIdget)
128 * formats
129   http://bugzilla.gnome.org/show_bug.cgi?id=531572 : html-single
130   http://bugzilla.gnome.org/show_bug.cgi?id=466535 : pdf
131   http://bugzilla.gnome.org/show_bug.cgi?id=467488 : man
132   we need more configure options in gtk-doc.m4:
133   --(enable|disable)-gtk-doc-(html|pdf|man|html-single|rtf)
134   - html : enabled by default
135   - html-single : is single page html
136 * validation
137     xmllint --noout --xinclude --postvalid tester-docs.xml
138     xmllint --noout --postvalid tester-docs.fo --dtdvalid file://$HOME/download/fo.dtd
139     - fo.dtd : http://www.renderx.com/Tests/validator/fo.zip
140 * single page
141   xsltproc  --nonet --xinclude -o gtk-docs.html /home/ensonic/projects/gtk-doc/gtk-doc-single.xsl  gtk-docs.sgml
142   * need to check if we can pass the style-sheet class as a parameter (--stringparam gtkdoc.stylesheet=(chunk|docbook))
143   * we might also need to reflow some things, as gtk-doc.xsl also runs the devhelp/devhelp2 generation
144     - but then the urls in the devhelp file, refer to the chunked html anyway
146 = Warnings =
147 Bugzilla has some requests for extra warnings. We should support a common
148 commandline option(s) in all tools to enable/disable the warnings. The makefiles
149 should pass the flags from an env-var (GTKDOC_OPTIONS). The env-var should be
150 used after the regular flags, so that the env-var can override hardcoded
151 settings (in Makefile.am).
153 Lets take this warning for the example:
154   "Symbol name not found at the start of the comment block."
156 Version 1: (template "warn-xxx!, warn-yyy!")
157 --warn-missing-symbol-at-comment-start
158 --no-warn-missing-symbol-at-comment-start
160 Version 2: (template "warn:s@")
161 -Wmissing-symbol-at-comment-start
162 -Wno-missing-symbol-at-comment-start
163 -warn missing-symbol-at-comment-start
164 -warn no-missing-symbol-at-comment-start
166 more warnings:
167   - 'deprecated' deprecating 'features'
168   - 'dummy-docs' check if symbol docs are very short and repeat mainly words
169     from the symbol.
170   - possible xrefs (e.g. adding a # or () would make it a successful xref)
172 = GIR =
173 == scanning ==
174 * ideas
175   * use gir files
176     1) replace gtkdoc-scan/gtkdoc-scangobject by gtkdoc-gir and output the classical files or
177        patch gtkdoc-scan/gtkdoc-scangobject to output gir files
178     2) patch gtkdoc-mkdb to read stuff from gir instead of classical files
179   * if gir-files would have the comments too (they are getting this now):
180     * we could even drop scanning the sources
181     * IDEs could use the gir-files to show doc-tooltips for symbols
182   * we might need yet another makefile flavour to use gir files
183 * perl and xml
184   * http://www.xml.com/pub/a/2001/04/18/perlxmlqstart1.html
186 == binding docs ==
187 * simmillar workflow to gettext
188 * add gtkdoc-mk??? to generate binding doc templates
189   * have c-comments there as comments
190   * when updating templates, mark sections that have changed as fuzzy
191 * add options to gtkdoc-mkdb to build docbook from those templates
192 * questions
193   * could we use the tmpl file mechanism?
194   * directory structure?
195     * we need to list the languages like ALL_LINGUAS for translations
196     * we need to create subdirs for binding docs, ideally we use one for 'C' as well
197 * devhelp
198   * devhelp files need a language attribute in the book-tag
199     language={C,C++,JavaScript,Perl,Python,...}
200   * devhelp could show a selector for the language
201   * need to get existing python/~mm docs to use it, gtk-doc could output
202     language=C for own docs
204 === installation ===
205 * need to install each book with a prefix
206 * would be good to have a language attribute in book tag to allow filter by language
207 * look at /usr/share/gtk-doc/html/pygobject/index.html
210 = external processors =
211 We need parametric, user definable macros.
212 |[ ... ]| - programlistings
213 |macro(arg1,arg2,...)[ ... ]| - call macro
214   - pass args as parameters (on the commandline)
215   - pass some gtk-doc vars in environment
216     (gtk-doc version, module, srcdir, buildir)
217   - content of [] on stdin or as a file
218   - get output on stdout or file
219   - and replace the macro with it
220 The changes could be made in gtkdoc-mkdb::ExpandAbbreviations()
221 == example macros ==
222 |highlight(c)[...]| - highlight source code for a specific language (c)
223   - what will this output? preformatted html to be xincluded?
224   - we could have macros for each format, the docbook xml macro would leave
225     enough traces in the html so that a html macro can continue
226 |dot(svg)[...]| - format dot graph and include result as mediaobject (in svg format)
227 |ditta(svg)[...]| - parse ascii art and include result as mediaobject (in svg format)
228   - we need to generate a filename for the image or use anoter parameter
230 == where to define macros ==
231 * system wide and with the package, <prefix>/share/gtk-doc/macros, $(srcdir)
232 * prefix for custom macros?
233 * we could require stdin for input and stdout for output, the wrapper for the
234   actual tool can ensure the convention
237 = styling =
238 === process html ===
239 if we highlight to html we get colors, we need to check what tags we should process though:
240 <pre class="programlisting"> is used for all code boxes.
241 <div class="informalexample"><pre class="programlisting"> is used for examples.
242 problems:
243 * in html we don't know the language anymore
244   * add another div
245 * with source-highlight, constants and types are not markedup.
246   for types we might need to build an own lang file dynamically and include
247   /usr/share/source-highlight/c.lang
248 === |[ ... ]| does not allow setting the language ===
249 * check for vi/emacs/jedit modelines
250   jedit: http://www.jedit.org/users-guide/buffer-local.html
251   vim: http://vim.wikia.com/wiki/Modeline_magic
252   emacs: http://www.delorie.com/gnu/docs/emacs/emacs_486.html
253 * allow <!-- language="C" --> comments after |[
254 * we need to catch those when processing the docbook and expanding the |[
255 * require new macro syntax
257 == show inherited api ==
258 could we write small html files for each object for methods, signals and properties and then use iframes to combine those at runtime like in javadoc?
259 could we do that using javascript and some other magic?
262 = Markup =
263 == tags ==
264 * to document the api-life cycle we have: since, deprecated and stability:
265 * other things we might want to specify:
266   * multi-threading safety: mt-safe, use-with-lock <lock>
268 == protected scope ==
269 * we can have /* < protected > */ in classes
270 * we can have <SUBSECTION Protected> in -section.txt
271 * ideally we have Scope: {Public, Protected, Private} supported in doc comments
272 * there is a bug for gir, https://bugzilla.gnome.org/show_bug.cgi?id=594125
274 == wildcards in symbol names ==
275 Sometimes one defines a set of function and macros with very similar purpose, e.g.
276 READ_INT8, READ_INT16, READ_INT32. It would be great to allow documenting a symbol
277 READ_INT* instead of 3 docs which are copy'n'pasted anyway. In the output we will have
278 all matching declarations in one source listing. Multiple wildcards are okay.
281 = documentation best practises #518427 =
282 * we'd like offer a more complete skelleton
283   * structure
284   * docbook markup (part/chapter structure)
285 * structure
286   Suggested structure for api-docs.
287   Idea is to have more content that api reference. It would be good to have a
288   gnome-platform document in devhelp, so that we could xref that instead of
289   explaining 100 times how to use pkg-config.
291   * examples
292     * gobject in devhelp
293       * concepts / api / tools / tutorial / related tools
294     * gtk in devhelp
295       * overview / api / migation / tools
296     * qt reference docs in qt assistant
297       * classes / overview / tutorial&examples
298   * recommendation
299     * front-page
300       * table with details (http://www.docbook.org/tdg/en/html/bookinfo.html)
301         (problem: what enclosing tag)
302         Logo, Module Version
303         Copyright and Legalnotice
304         Links
305         * homepage, mailing lists, irc channel
306         * repository, source releases, bugtracker
307       * TOC
308     * introduction - what is is about
309     * concepts - explain basic ideas and terminology
310     * development - how to build and run, env-vars, different platforms
311     * api - classic api docs
312     * tutorial & examples - integrated to keep it up-to-date and cross referenced
313     * migration - how to for api changes, deprecations
314     * (releated) tools - tools part of the package or recommended for development
315     * indexes - api-index, depretations, new api since xxx
317 proposed structure in docbook xml:
318 <book>
319   <bookinfo>
320   </bookinfo>
321   <preface><title>Introduction</title>
322     ...
323   </preface>
324   <part label="I"><title>xxx Overview</title>
325     <xi:include href="building.xml" />
326     ...
327   </part>
328   <reference label="II"><title>xxx Core Reference</title>
329     <xi:include href="xml/gtkmain.xml" />
330     ...
331   </part>
332   <reference label="III"><title>xxx Object Reference</title>
333     <chapter><title>Object Hierarchy</title>
334       <xi:include href="xml/tree_index.sgml" />
335     </chapter>
336     <chapter>...
337   </part>
338   <index>...</index>
339 </book>
341 some things to check:
342 * gtk,glib: can we make a <part> for the glosary and index's (according to docbook, yes)
343   should we use <appendix>? its like a chapter.
344 * gobject: uses a <preface> for introductions
345 * gobject: uses <reference> as a parent for the xi:includeed <refentry> docs
348 = extra link for symbols =
349 need options for configure:
350 --enable-gtk-doc-codesearch-links
351 --enable-gtk-doc-liveedit-links
352 == viewvc,cgit,... ==
353 - link to some online service for the code
354 - problem: most don't have local anchors for the symbols
355 - where to set the uri (in the document, like for online url)?
356 - what about a template URL containing a %s for the "path/file" or a special macro
357   http://svn.gnome.org/viewvc/gtk-doc/trunk/tests/gobject/src/gobject.c?view=markup
358   http://buzztard.svn.sourceforge.net/viewvc/buzztard/trunk/buzztard/src/lib/core/core.c?view=markup
359   - unfortunately we can't link to symbols (only lines)
360   - linking to files is difficult as in gtkdoc we have modules
362 == codesearch ==
363 - google (code) link : http://www.google.com/codesearch?q=g_object_unref
364 == live editing ==
365 The idea is to have an 'edit' link in an online version of the docs (build from
366 head development version) per doc-entry (symbols and section).
367 The link goes to a cgi and that gets following parameters: docmodule,symbol.
368 E.g. http://library.gnome.org/devel/references/edit?docmodule=glib&symbol=g_new
369 The cgi would need a hashmap to get from docmodule to the way to check it out
370 (ideally it has a recent checkout and only updates it).
371 problems:
372 - signal that this has been edited already?
373 - support for xi:included examples
374 - updating the checkout could be slow
377 = fix missing since docs =
378 cd gstreamer/gstreamer/docs/gst
379 gtkdoc-mkdb --module=gstreamer --source-dir=../../gst --outputsymbolswithoutsince
380 cd gstreamer/gstreamer/src
381 git bisect start
382 git bisect good
383 git bisect bad RELEASE-0_10_0
384 git bisect run script.sh
386 script:
387 #!/bin/sh
388 make ctags
389 grep "gst_caps_is_always_compatible" tags
392 = performance =
393 - timestamp each step
394   make check >make.log
395 - try CFLAGS=-O0 for compiling the scanner, no need to optimize it
396   CFLAGS="-O0" make check >make.log
397   safes max 0.5 sec.
398 - xslt
399   http://docbook2x.sourceforge.net/latest/doc/performance.html
400   - play with xsltproc --profile --verbose --timing
401     cd tests/gobject/docs/html
402     time /usr/bin/xsltproc 2>xslt.log --profile --verbose --timing --path /home/ensonic/projects/gnome/gtk-doc/gtk-doc/tests/gobject/docs --nonet --xinclude --stringparam gtkdoc.bookname tester --stringparam gtkdoc.version 1.14 /home/ensonic/projects/gnome/gtk-doc/gtk-doc/gtk-doc.xsl ../tester-docs.xml
403     - l10n.language is slow
404       bug: https://sourceforge.net/tracker/index.php?func=detail&aid=2918673&group_id=21935&atid=373750
405       see: http://www.mail-archive.com/docbook-apps@lists.oasis-open.org/msg05412.html
406       - overide l10n.language
407         glib/gobject
408         real        user        sys
409         2m15.221s   1m58.740s   0m1.456s
410         >
411         1m55.480s   1m44.296s   0m2.125s
412       - override many template related to gentext
413         real        user        sys
414         0m43.327s   0m38.594s   0m4.724s
415         >
416         real        user        sys
417         0m33.282s   0m29.266s   0m4.012s
418       - removing the gentext calls for nav-bar alt tags does not help
421   - try plain docbook xslt to see if maybe we have bad xslt templates in the
422     customisation layer (gtk-doc.xsl)
424   - we could do the xinlcude processing once and use it for both html and pdf
425     time /usr/bin/xsltproc 2>../xslt4.log --path /home/ensonic/projects/gnome/gtk-doc/gtk-doc/tests/gobject/docs --nonet --xinclude --stringparam gtkdoc.bookname tester --stringparam gtkdoc.version 1.14 /home/ensonic/projects/gnome/gtk-doc/gtk-doc/gtk-doc.xsl ../tester-docs.xml
426     real        user       sys
427     0m4.846s    0m4.434s   0m0.147s
428     0m4.842s    0m4.386s   0m0.145s
431     time xmllint --nonet --xinclude ../tester-docs.xml >./tester-docs-all.xml
432     real        user       sys
433     0m0.596s    0m0.546s   0m0.023s
435     time /usr/bin/xsltproc 2>../xslt5.log --path /home/ensonic/projects/gnome/gtk-doc/gtk-doc/tests/gobject/docs --nonet --stringparam gtkdoc.bookname tester --stringparam gtkdoc.version 1.14 /home/ensonic/projects/gnome/gtk-doc/gtk-doc/gtk-doc.xsl ./tester-docs-all.xml
436     real        user       sys
437     0m4.167s    0m3.834s   0m0.106s
438     0m4.248s    0m3.851s   0m0.114s
441     time xmllint --nonet --c14n --xinclude ../tester-docs.xml >./tester-docs-all2.xml
443     real        user       sys
444     0m0.700s    0m0.636s   0m0.034s
446     time /usr/bin/xsltproc 2>../xslt6.log --path /home/ensonic/projects/gnome/gtk-doc/gtk-doc/tests/gobject/docs --nonet --stringparam gtkdoc.bookname tester --stringparam gtkdoc.version 1.14 /home/ensonic/projects/gnome/gtk-doc/gtk-doc/gtk-doc.xsl ./tester-docs-all2.xml
448     real        user       sys
449     0m3.344s    0m3.026s   0m0.109s
450     0m3.372s    0m3.037s   0m0.115s
453     l ../tester-docs.xml ./tester-docs-all*.xml
455   - we could also try to compact the installed xslt
456     xmllint --nonet --c14n --xinclude gtk-doc.xsl | sed -ne '/<!--/ { :c; /-->/! { N; b c; }; /-->/s/<!--.*-->//g }; /^  *$/!p;' | sed '/^$/d' >gtk-doc.pre.xsl
457     - unfortunately there is no way to ask xsltproc to pre-transform an xslt, that could
458       - strip comments
459       - process xsl:import and xsl:include
460   - compile xslt
461     http://sourceforge.net/projects/xsltc/
462     http://www.xmlhack.com/read.php?item=618
463   - extra xsltproc options:
464     --novalid: saves ~ 0.12 sec
466 - perl regexps
467   - not really an issue, but we can improve by compiling the regexps
468     http://stackoverflow.com/questions/550258/does-the-o-modifier-for-perl-regular-expressions-still-provide-any-benefit
469   - we use $&, $', and $` in several places (comple match, pre-match and post-match).
470     Those are slow and once they are used a single time perl prepares them for every match operation.
471     Since perl 5.10 one can use the /p flag for matches where this is needed and then use
472     ${^PREMATCH} , ${^MATCH}  and ${^POSTMATCH}
473 - perl profiling
474   - http://blog.timbunce.org/2008/07/15/nytprof-v2-a-major-advance-in-perl-profilers/
475     perl -d:NYTProf gtkdoc-mkdb ...
476     nytprofhtml
477     firefox nytprof/index.html