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