OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Subject: Problems with funcsynopsis and programlisting


While writing a guide explaining why DocBook is good (for our
programmers), I wanted to include a silly C program as example of
markup. I found three problems here with HTML output (DocBook 4.1 and
stylesheets 1.54) and I also have a doubt:

The "int main(...)" came in the beginning of the gray box,
disrespecting my instructions to keep programlistings indented by four
spaces. All the other parts came indented. Here is the code I've used
to mark it up:

       <funcdef>int <function moreinfo="none">main</function></funcdef>
       <paramdef>int *<parameter moreinfo="none">argc</parameter></paramdef>
       <paramdef>char *<parameter moreinfo="none">argv</parameter>[]</paramdef>

The second problems regards indentation. Indentation wasn't respected
while using the above code. I tried to indent the <funcsynopsis> by
four spaces, but it remained as if there was no space before it,
disrespecting the programlisting behaviour. 

The last problem is with callouts. Look at (3) and (4) below. This is
an attempt to reproduce the output I got. Wasn't it right to have (3)
and (4) "glued" to each other? Instead of this whitespace I wanted
having "(3)(4)". 

     #include <stdio.h>                                         (1)
     #include <string.h>                                        (2)       
     #define FIM_CR 13
     #define FIL_LF 10
 int main(int argc, char *argv[]);

       FILE *input_file;
       FILE *output_file;
       char caractere;
       char fim_de_caractere;
       int tamanho_caractere;
       char appendix[5] = ".dos";                               (3)                                          (4)
       char *output_name;
       char *input_name;
       if (argc < 2) {
         puts("Você precisa passar o nome de um arquivo.\n");
         return 0;

And now, my doubt. Is there any way to get

int main(int argc, char *argv[]) {

(note the curly brackets instead of the semmicolon)? 

Ah! I liked very much that the coded lines didn't counted as program
lines for the callouts :-)) It allowed me to count the lines on the
original source code and just add the markup at my document. 

Godoy. <godoy@conectiva.com>

Departamento de Publicações       Conectiva S.A.
Publishing Department             Conectiva Inc.

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Powered by eList eXpress LLC