Changeset 3274 for trunk/doc/src/docbook/developerdoc/write_docbook_doc.xml
- Timestamp:
- Apr 26, 2007, 1:23:31 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/src/docbook/developerdoc/write_docbook_doc.xml
r3268 r3274 32 32 <para> 33 33 This chapter is for those who intent to contribute to the BASE2 documentation. The chapter 34 contains an explanationof how the documentation is organized, what the different parts is35 about and other things that will make it easier to know where to put new text.34 contains explanations of how the documentation is organized, what the different parts is 35 about and other things that will make it easier to know where to insert new text. 36 36 </para> 37 37 <para> 38 38 The documentation is written with the docbook standard, which is a bunch of defined XML 39 elements and XSLT style sheets that are used to format ting the text. Later in this chapter is a40 reference, over those docbook elements that are recommended to use when writing BASE241 documentation. Further information about docbook can be found in the on line version of39 elements and XSLT style sheets that are used to format the text. Later on in this chapter 40 is a reference, over those docbook elements that are recommended to use when writing BASE2 41 documentation. Further information about docbook can be found in the on-line version of 42 42 O'Reilly's 43 43 <ulink url="http://www.docbook.org/tdg/en/html/">DocBook: The Definitive Guide</ulink> … … 69 69 <listitem> 70 70 <para> 71 This part contains information that are relevant for the common user in72 BASE2.More or less should everything that a power user role or an user role needs73 to know be documented here.71 This part contains information that are relevant for the common BASE2-user. 72 More or less should everything that a power user role or an user role needs 73 to know be included here. 74 74 </para> 75 75 </listitem> … … 79 79 <listitem> 80 80 <para> 81 Things that only an administrator-role can do is putin this part. It81 Things that only an administrator-role can do is documented in this part. It 82 82 can be how to install the program, how to configure the server for best 83 83 performance or other subjects that are related to the administration. … … 89 89 <listitem> 90 90 <para> 91 Documentation about participation in theBASE2 development should be placed91 Documentation concerning the participation of BASE2 development should be placed 92 92 in this part, e.g. coding standards, the java doc from the source code, how 93 93 to develop a plugin etc. … … 102 102 <title>Getting started</title> 103 103 <para> 104 Before start writing any documentation in BASE2 there isa couple of things, some104 Before start writing any documentation in BASE2 there are a couple of things, some 105 105 rules and standards, to have in mind. 106 106 </para> … … 108 108 <title>Organization of source files</title> 109 109 <para> 110 The source files of docbookdocumentation are located in110 The source files of the documentation are located in 111 111 <filename class='directory'>base2root/doc/src/docbook</filename> 112 112 which is showed in 113 <xref linkend="write_docbook_doc.figures.fileorganization" />. 114 The different parts of the documentation are organized into separate folders and each one 115 of the folders contains one index file and one file for each chapter in that part. The 116 index file joins the chapters, in current part/folder, together and doesn't really contain 117 any text. The documentation root directory also contains an <filename class='headerfile'>index.xml</filename> file which joins the 118 index files from the different parts together. 119 </para> 113 <xref linkend="write_docbook_doc.figures.fileorganization" /> 114 . The different parts of the documentation are organized into separate folders and 115 each one of the folders contains one index file and one file for each chapter in 116 that part. The index file joins the chapters, in current part/folder, together and 117 doesn't really contain any text. The documentation root directory also contains an 118 <filename class='headerfile'>index.xml</filename> 119 file which joins the index files from the different parts together. 120 </para> 120 121 <figure id="write_docbook_doc.figures.fileorganization"> 121 122 <title>The organization of documentation files</title> … … 148 149 <xref linkend="write_docbook_doc.examples.chapterbody"/> 149 150 <example id="write_docbook_doc.examples.chapterbody"> 150 <title> Bodyof a chapter</title>151 <title>Example of a chapter</title> 151 152 <programlisting> 152 153 <?xml version="1.0" encoding="UTF-8"?> … … 155 156 "../../../../lib/docbook/preprocess/dweiss-docbook-extensions.dtd"> 156 157 157 <chapter id="example_chapter"> 158 <chapter id="<replaceable>example_chapter</replaceable>"> 159 <?dbhtml dir="<replaceable>folder name to put the chapter's files in</replaceable>"?> 158 160 <title>Example of a chapter </title> 159 <sect1 id="example_chapter.sect1_title"> 160 . 161 . 161 <para> 162 … 163 </para> 164 <sect1 id="<replaceable>example_chapter.sect1</replaceable>"> 165 <title>Example of top level section </title> 166 <para> 167 … 168 </para> 169 <sect2 id="<replaceable>example_chapter.sect1.sect2</replaceable>"> 170 <title>Example of second level section </title> 171 <para> 172 … 173 </para> 174 <sect3 id="<replaceable>example_chapter.sect1.sect2.sect3</replaceable>"> 175 <title>Example of third level section</title> 176 <para> 177 … 178 </para> 179 </sect3> 180 </sect2> 162 181 </sect1> 163 .164 .165 .166 182 </chapter> 167 183 </programlisting> 168 184 </example> 169 185 </para> 186 <note> 187 <para> 188 Don't forget to include the 189 <sgmltag>dbhtml</sgmltag> 190 tag with the attribute 191 <sgmltag class="attribute">dir</sgmltag> 192 set to the value that the chapter's output folder should have as a 193 name. 194 </para> 195 </note> 170 196 </listitem> 171 197 <listitem> 172 198 <para> 173 Next and last step is to get the new chapter included in the right part 174 of documentation. This is done by including the file's name in 175 the file <filename>index.xml</filename> that's located in the current part's folder. 176 <xref linkend="write_docbook_doc.examples.include_chapter"/> 177 shows how the chapter that was created above is included in 178 the user documentation part. 179 <example id="write_docbook_doc.examples.include_chapter"> 180 <title>Include a chapter</title> 181 <programlisting> 199 Next and last step is to get the new chapter included in the documentation. This is done by including the file's name in 200 the file 201 <filename>index.xml</filename> 202 that's located in the current part's folder. 203 <xref linkend="write_docbook_doc.examples.include_chapter" /> 204 shows how the chapter that was created above is included in the user 205 documentation part. 206 </para> 207 <example id="write_docbook_doc.examples.include_chapter"> 208 <title>Include a chapter</title> 209 <programlisting> 182 210 <part id="userdoc"> 183 211 <title>User documentation</title> … … 199 227 <include file="import_export_data.xml"/> 200 228 </part> 201 202 203 204 205 206 The chapters will come in the same order as they are included in the index file207 </para>208 </ note>209 </ para>229 </programlisting> 230 </example> 231 <note> 232 <title>Order of chapters</title> 233 <para> 234 The chapters will come in the same order as they are included in 235 the index file. 236 </para> 237 </note> 210 238 </listitem> 211 239 </orderedlist> 212 Now it's only to go ahead with the writing of this new chapter.240 Now it's only to go ahead with the documentation writing. 213 241 </para> 214 242 </sect3> … … 221 249 </title> 222 250 <para> 223 All elements hasan id attribute that can have an unique value to identify the224 element with. Most of the elements that are used inside BASE2 documentation don't251 Common to all elements is that they have an id attribute that can have an unique value to identify the 252 element with. Most of the elements that are used inside the BASE2 documentation don't 225 253 need to have an id if they don't are used in any cross references from other part of 226 254 the text. 227 255 </para> 228 256 <para> 229 There are however some elements that always should have an257 There are however some elements that always should have the 230 258 <sgmltag class="attribute">id</sgmltag> 231 . Which these elements are and how the259 set. Which these elements are and how the 232 260 <sgmltag class="attribute">id</sgmltag> 233 261 should look like for each one of those is described below. All ids should be as 234 262 short as possible and associated to the current element. The 235 263 <sgmltag class="attribute">id</sgmltag> 236 shouldn't consist of other characters then lowercase a-z, 237 <userinput>_</userinput> 238 instead of blank spaces and 239 <userinput>.</userinput> 240 to symbolize the different levels in the document. 264 value should only consist of the lowercase characters a-z, '_' instead of blank 265 spaces and '.' to symbolize the different levels in the document. 241 266 <variablelist> 242 267 <varlistentry> … … 257 282 The creation of a section's id is done by using the upper level's id 258 283 and add the section's title or a part of the title. For 259 <sect2> it should be like 284 <sect2> it should be like this; 260 285 <synopsis>chapter_title.sect1_title.sect2_title</synopsis> 261 .262 286 </para> 263 287 </listitem> … … 294 318 <title>Mark help texts</title> 295 319 <para> 296 It is possible to tag those parts of the text in documentation source that also 297 should be used as help texts in the web client.The tagged parts will be 298 exported to a XML-file at the same time as the html-documentation is generated.This 299 generated XML-file is compatible with the help text importer in BASE2 and will be 300 imported when running the update script or installation script. 320 The parts of the text that also should be used as help texts in the web must be 321 inside 322 <sgmltag>helptext</sgmltag> 323 tags.These texts will be exported to a XML-file at the same time as the 324 HTML-documentation is generated.The generated XML-file is compatible with the help 325 text importer in BASE2 and will be imported when running the update script or 326 installation script. 301 327 </para> 302 328 <note> … … 316 342 <varlistentry> 317 343 <term> 318 <sgmltag class="attribute"> id</sgmltag>344 <sgmltag class="attribute">external_id</sgmltag> 319 345 </term> 320 346 <listitem> 321 347 <para> 322 is used to identify and find a help text in the web client. BASE2's 323 web client already has a several of help texts that are defined, it 324 could therefore be a good idea to have a look in the program to see if 325 there already is an external id to use. 348 is used to identify and to find a help text in the web client. 349 BASE2's web client already has a several of IDs to help texts that 350 are defined, it could therefore be a good idea to have a look in the 351 program to see if there already is an external id to use for the 352 particular help text. 326 353 </para> 327 354 </listitem> … … 329 356 <varlistentry> 330 357 <term> 331 <sgmltag class="attribute"> id</sgmltag>358 <sgmltag class="attribute">title</sgmltag> 332 359 </term> 333 360 <listitem> … … 345 372 <sect1> 346 373 <helptext external_id="<replaceable>helptexts.external.id</replaceable>" title="<replaceable>The title</replaceable>"> 347 <replaceable>The text that should also be used as a helptext in the program</replaceable>374 <replaceable>The text that also should be used as a helptext in the program.</replaceable> 348 375 </helptext> 349 376 </sect1> … … 361 388 <para> 362 389 There are two different types of format that is generated from the documentation 363 source. The format to view the documentation on line will be the one with chunked390 source. The format to view the documentation on-line will be the one with chunked 364 391 HTML pages where each chapter and section of first level are on separate 365 392 pages/files. The other format is a PDF-file that are most useful for printing and … … 373 400 <sect1 id="write_docbook_doc.usedtags"> 374 401 <title>Elements to use</title> 375 <para>Which docbook tags are used in the documentation and when to use what......</para>376 402 <para> 377 There will not be any detailed explanation of the tags, instead the reader is 403 The purpose with this section is to give an overview of those docbook elements that are 404 most common in this documentation and to give some example on how they should be used. 405 There will not be any detailed explanation of the tags here, instead the reader is 378 406 recommended to get more information from 379 407 <ulink url="http://www.docbook.org/tdg/en/html/docbook.html"> 380 docbook's documentation408 Docbook's documentation 381 409 </ulink> 382 410 or other references. 383 411 </para> 384 412 <sect2 id="write_docbook_doc.usedtags.text"> 385 <title>Text</title> 386 <para> 387 Here are the most common elements that are used in the current documentation source 388 to give the text a layout in some kind. 389 </para> 390 <variablelist> 391 <varlistentry> 392 <term> 393 <sgmltag class="starttag">chapter</sgmltag> 394 </term> 395 <listitem> 396 <para> 397 Define a chapter. Read more about chapters in this document in the 398 <xref linkend="write_docbook_doc.begin" /> 399 </para> 400 </listitem> 401 </varlistentry> 402 <varlistentry> 403 <term> 404 <sgmltag class="starttag">sect1</sgmltag> 405 , 406 <sgmltag class="starttag">sect2</sgmltag> 407 , 408 <sgmltag class="starttag">sect3</sgmltag> 409 </term> 410 <listitem> 411 <para> 412 Different levels of subsections in the document, see 413 <xref linkend="write_docbook_doc.begin" /> 414 for more information how to implement them right. 415 </para> 416 </listitem> 417 </varlistentry> 418 <varlistentry> 419 <term> 420 <sgmltag class="starttag">title</sgmltag> 421 </term> 422 <listitem> 423 <para> 424 Define title-node in those elements that can have a title. 425 </para> 426 </listitem> 427 </varlistentry> 428 <varlistentry> 429 <term> 430 <sgmltag class="starttag">para</sgmltag> 431 </term> 432 <listitem> 433 <para> 434 Define a paragraph in the text. Required as a child node in many 435 different elements. 436 </para> 437 </listitem> 438 </varlistentry> 439 <varlistentry> 440 <term> 441 <sgmltag class="starttag">ulink</sgmltag> 442 </term> 443 <listitem> 444 <para> 445 Define an external link to the URL that is set in it's 446 <sgmltag class="attribute">url</sgmltag> 447 attribute. 448 </para> 449 </listitem> 450 </varlistentry> 451 <varlistentry> 452 <term> 453 <sgmltag class="starttag">xref</sgmltag> 454 </term> 455 <listitem> 456 <para> 457 Define a link inside this document. The 458 <sgmltag class="attribute">linkend</sgmltag> 459 attribute holds the id to the target element. 460 </para> 461 </listitem> 462 </varlistentry> 463 </variablelist> 413 <title>Text elements</title> 414 <para> 415 416 </para> 417 <informaltable frame="none"> 418 <tgroup cols="3" rowsep="1" colsep="1"> 419 <colspec align="left" /> 420 <colspec align="center" /> 421 <colspec align="left" /> 422 <thead> 423 <row> 424 <entry>Define</entry> 425 <entry>Element to use</entry> 426 <entry>Comments</entry> 427 </row> 428 </thead> 429 <tbody> 430 <row> 431 <entry>Chapter</entry> 432 <entry> 433 <sgmltag class="starttag">chapter</sgmltag> 434 </entry> 435 <entry> 436 <para> 437 See 438 <xref linkend="write_docbook_doc.examples.chapterbody" /> 439 </para> 440 </entry> 441 </row> 442 <row> 443 <entry>Title</entry> 444 <entry> 445 <sgmltag class="starttag">title</sgmltag> 446 </entry> 447 <entry> 448 <xref linkend="write_docbook_doc.examples.chapterbody" /> 449 shows how this can be implemented 450 </entry> 451 </row> 452 <row> 453 <entry>Paragraph</entry> 454 <entry> 455 <sgmltag class="starttag">para</sgmltag> 456 </entry> 457 <entry></entry> 458 </row> 459 <row> 460 <entry>Top-level subsection</entry> 461 <entry> 462 <sgmltag class="starttag">sect1</sgmltag> 463 </entry> 464 <entry> 465 See 466 <xref linkend="write_docbook_doc.begin.id" /> 467 </entry> 468 </row> 469 <row> 470 <entry>Second level section</entry> 471 <entry> 472 <sgmltag class="starttag">sect2</sgmltag> 473 </entry> 474 <entry> 475 See 476 <xref linkend="write_docbook_doc.begin.id" /> 477 </entry> 478 </row> 479 <row> 480 <entry>Third level section</entry> 481 <entry> 482 <sgmltag class="starttag">sect3</sgmltag> 483 </entry> 484 <entry> 485 See 486 <xref linkend="write_docbook_doc.begin.id" /> 487 </entry> 488 </row> 489 <row> 490 <entry>Fourth level section</entry> 491 <entry> 492 <sgmltag class="starttag">sect3</sgmltag> 493 </entry> 494 <entry></entry> 495 </row> 496 <row> 497 <entry>Fith level section</entry> 498 <entry> 499 <sgmltag class="starttag">sect3</sgmltag> 500 </entry> 501 <entry></entry> 502 </row> 503 </tbody> 504 </tgroup> 505 </informaltable> 464 506 465 507 <sect3 id="write_docbook_doc.usedtags.text.keywords"> … … 467 509 <para> 468 510 These elements should be used to mark up words and phrases that have a special 469 meaning, like method names, class names and user inputs just to mention some 470 examples. 511 meaning, like method names, class names and user inputs just to mention some. 471 512 </para> 472 <variablelist><varlistentry><term><sgmltag class="starttag">methodsynopsis</sgmltag></term><listitem><para></para></listitem></varlistentry> 473 <varlistentry><term><sgmltag class="starttag">modifier</sgmltag></term><listitem><para></para></listitem></varlistentry> 474 <varlistentry><term><sgmltag class="starttag">methodname</sgmltag></term><listitem><para></para></listitem></varlistentry> 475 <varlistentry><term><sgmltag class="starttag">methodparam</sgmltag></term><listitem><para></para></listitem></varlistentry> 476 <varlistentry><term><sgmltag class="starttag">type</sgmltag></term><listitem><para></para></listitem></varlistentry> 477 <varlistentry><term><sgmltag class="starttag">parameter</sgmltag></term><listitem><para></para></listitem></varlistentry> 478 <varlistentry><term><sgmltag class="starttag">classname</sgmltag></term><listitem><para></para></listitem></varlistentry> 479 <varlistentry><term><sgmltag class="starttag">userinput</sgmltag></term><listitem><para></para></listitem></varlistentry> 480 <varlistentry><term><sgmltag class="starttag">varname</sgmltag></term><listitem><para></para></listitem></varlistentry> 481 <varlistentry><term><sgmltag class="starttag">constant</sgmltag></term><listitem><para></para></listitem></varlistentry></variablelist> 513 <informaltable frame="none"> 514 <tgroup cols="3" rowsep="1" colsep="1"> 515 <colspec align="left" /> 516 <colspec align="center" /> 517 <colspec align="left" /> 518 <thead> 519 <row> 520 <entry>Define</entry> 521 <entry>Element to use</entry> 522 <entry>Comment</entry> 523 </row> 524 </thead> 525 <tbody> 526 <row> 527 <entry>Class name</entry> 528 <entry> 529 <sgmltag class="starttag">classname</sgmltag> 530 </entry> 531 <entry></entry> 532 </row> 533 <row> 534 <entry>User input</entry> 535 <entry> 536 <sgmltag class="starttag">userinput</sgmltag> 537 </entry> 538 <entry></entry> 539 </row> 540 <row> 541 <entry>Variable name</entry> 542 <entry> 543 <sgmltag class="starttag">varname</sgmltag> 544 </entry> 545 <entry></entry> 546 </row> 547 <row> 548 <entry>Constant</entry> 549 <entry> 550 <sgmltag class="starttag">constant</sgmltag> 551 </entry> 552 <entry></entry> 553 </row> 554 <row> 555 <entry>Method definition</entry> 556 <entry> 557 <sgmltag class="starttag">methodsynopsis</sgmltag> 558 </entry> 559 <entry> 560 See 561 <xref linkend="write_docbook_doc.examples.methodimpl" /> 562 </entry> 563 </row> 564 <row> 565 <entry>Modifier of a method</entry> 566 <entry> 567 <sgmltag class="starttag">modifier</sgmltag> 568 </entry> 569 <entry> 570 See 571 <xref linkend="write_docbook_doc.examples.methodimpl" /> 572 </entry> 573 </row> 574 <row> 575 <entry>Classification of return value</entry> 576 <entry> 577 <sgmltag class="starttag">type</sgmltag> 578 </entry> 579 <entry> 580 See 581 <xref linkend="write_docbook_doc.examples.methodimpl" /> 582 </entry> 583 </row> 584 <row> 585 <entry>Method name</entry> 586 <entry> 587 <sgmltag class="starttag">methodname</sgmltag> 588 </entry> 589 <entry> 590 See 591 <xref linkend="write_docbook_doc.examples.methodimpl" /> 592 </entry> 593 </row> 594 <row> 595 <entry>No parameter/type</entry> 596 <entry> 597 <sgmltag class="starttag">void</sgmltag> 598 </entry> 599 <entry> 600 See 601 <xref linkend="write_docbook_doc.examples.methodimpl" /> 602 </entry> 603 </row> 604 <row> 605 <entry>Define a parameter</entry> 606 <entry> 607 <sgmltag class="starttag">methodparam</sgmltag> 608 </entry> 609 <entry> 610 See 611 <xref linkend="write_docbook_doc.examples.methodimpl1" /> 612 </entry> 613 </row> 614 <row> 615 <entry>Parameter type</entry> 616 <entry> 617 <sgmltag class="starttag">type</sgmltag> 618 </entry> 619 <entry> 620 See 621 <xref linkend="write_docbook_doc.examples.methodimpl1" /> 622 </entry> 623 </row> 624 <row> 625 <entry>Parameter name</entry> 626 <entry> 627 <sgmltag class="starttag">parameter</sgmltag> 628 </entry> 629 <entry> 630 See 631 <xref linkend="write_docbook_doc.examples.methodimpl1" /> 632 </entry> 633 </row> 634 </tbody> 635 </tgroup> 636 </informaltable> 637 <para> 638 Follow one of the examples below to insert a method definition in the document. 639 </para> 640 <example id="write_docbook_doc.examples.methodimpl"> 641 <title> 642 Method with no arguments and a return value 643 </title> 644 <programlisting> 645 … 646 <methodsynopsis language="java"> 647 <modifier>public</modifier> 648 <type>Plugin.MainType</type> 649 <methodname>getMainType</methodname> 650 <void /> 651 </methodsynopsis> 652 … 653 </programlisting> 654 </example> 655 <example id="write_docbook_doc.examples.methodimpl1"> 656 <title> 657 Method with arguments and no return value 658 </title> 659 <programlisting> 660 … 661 <methodsynopsis language="java"> 662 <modifier>public</modifier> 663 <void /> 664 <methodname>init</methodname> 665 <methodparam> 666 <type>SessionControl</type> 667 <parameter>sc</parameter> 668 </methodparam> 669 <methodparam> 670 <type>ParameterValues</type> 671 <parameter>configuration</parameter> 672 </methodparam> 673 <methodparam> 674 <type>ParameterValues</type> 675 <parameter>job</parameter> 676 </methodparam> 677 </methodsynopsis> 678 … 679 </programlisting> 680 </example> 681 482 682 </sect3> 483 683 <sect3 id="write_docbook_doc.usedtags.text.gui"> 484 684 <title>Gui elements</title> 485 685 <para> 486 There are alot of elements that symbolize the gui in a program. Following487 list contains those which are usedin this document.686 Docbook has some elements that can be used to symbolize gui items in a program. 687 Following list contains the ones that are most common in this document. 488 688 </para> 489 <variablelist><varlistentry><term><sgmltag class="starttag">guibutton</sgmltag></term><listitem><para></para></listitem></varlistentry> 490 <varlistentry><term><sgmltag class="starttag">guilabel</sgmltag></term><listitem><para></para></listitem></varlistentry> 491 <varlistentry><term><sgmltag class="starttag">menuchoice</sgmltag></term><listitem><para></para></listitem></varlistentry> 492 <varlistentry><term><sgmltag class="starttag">guimenu</sgmltag></term><listitem><para></para></listitem></varlistentry> 493 <varlistentry><term><sgmltag class="starttag">guisubmenu</sgmltag></term><listitem><para></para></listitem></varlistentry> 494 <varlistentry><term><sgmltag class="starttag">guimenuitem</sgmltag></term><listitem><para></para></listitem></varlistentry> 495 <varlistentry><term><sgmltag class="starttag">guicon</sgmltag></term><listitem><para></para></listitem></varlistentry> 496 </variablelist> 689 <informaltable frame="none"> 690 <tgroup cols="3" rowsep="1" colsep="1"> 691 <colspec align="left" /> 692 <colspec align="center" /> 693 <colspec align="left" /> 694 <thead> 695 <row> 696 <entry>Define</entry> 697 <entry>Element to use</entry> 698 <entry>Comment</entry> 699 </row> 700 </thead> 701 <tbody> 702 <row> 703 <entry>Button</entry> 704 <entry> 705 <sgmltag class="starttag">guibutton</sgmltag> 706 </entry> 707 <entry></entry> 708 </row> 709 <row> 710 <entry>Label</entry> 711 <entry> 712 <sgmltag class="starttag">guilabel</sgmltag> 713 </entry> 714 <entry></entry> 715 </row> 716 <row> 717 <entry>Menu choice</entry> 718 <entry> 719 <sgmltag class="starttag">menuchoice</sgmltag> 720 </entry> 721 <entry></entry> 722 </row> 723 <row> 724 <entry>Menu</entry> 725 <entry> 726 <sgmltag class="starttag">guimenu</sgmltag> 727 </entry> 728 <entry></entry> 729 </row> 730 <row> 731 <entry>Submenu</entry> 732 <entry> 733 <sgmltag class="starttag">guisubmenu</sgmltag> 734 </entry> 735 <entry></entry> 736 </row> 737 <row> 738 <entry>Menu item</entry> 739 <entry> 740 <sgmltag class="starttag">guimenuitem</sgmltag> 741 </entry> 742 <entry></entry> 743 </row> 744 <row> 745 <entry>Icon</entry> 746 <entry> 747 <sgmltag class="starttag">guiicon</sgmltag> 748 </entry> 749 <entry></entry> 750 </row> 751 </tbody> 752 </tgroup> 753 </informaltable> 754 <para> 755 <xref linkend="write_docbook_doc.examples.guielements" /> 756 shows how the menu choice in figure 757 <xref linkend="write_docbook_doc.figures.menuchoice" /> 758 can be described. 759 </para> 760 <figure id="write_docbook_doc.figures.menuchoice"> 761 <title>Menu choice</title> 762 <screenshot> 763 <mediaobject> 764 <imageobject> 765 <imagedata fileref="figures/menuchoice.png" format="PNG" /> 766 </imageobject> 767 </mediaobject> 768 </screenshot> 769 </figure> 770 <example id="write_docbook_doc.examples.guielements"> 771 <title>Describe a menu choice</title> 772 <programlisting> 773 … 774 <menuchoice> 775 <guimenu>Administrate</guimenu> 776 <guisubmenu>Plugins</guisubmenu> 777 <guimenuitem>Types</guimenuitem> 778 </menuchoice> 779 … 780 </programlisting> 781 <para> 782 In the text it will look like this: 783 <menuchoice> 784 <guimenu>Administrate</guimenu> 785 <guisubmenu>Plugins</guisubmenu> 786 <guimenuitem>Types</guimenuitem> 787 </menuchoice> 788 </para> 789 </example> 497 790 </sect3> 498 791 </sect2> … … 500 793 <title>Images and figures</title> 501 794 <para> 502 Images and figures are normally implemented like the following example. The image-file must be located in 795 Images and figures are normally implemented like the following example. The 796 image-file must be located in 503 797 <filename class="directory">doc/src/docbook/figures</filename> 504 798 ,otherwise the image won't be visible in the generated output files. 505 799 </para> 506 </sect2> 507 <sect2 id="write_docbook_doc.usedtags.examples"> 508 <title>Examples and programlisting</title> 509 <para> 510 Following describes how to insert an example and programlisting. In this 511 documentation the examples are often some kind of programlisting but they can still 512 be examples of something else. 513 </para> 514 <example id="write_docbook_doc.examples.example"> 515 <title>How to insert an example of program listing</title> 800 <example id="write_docbook_doc.examples.screenshot"> 801 <title>Screen-shot in the documentation</title> 802 <para> 803 <xref linkend="write_docbook_doc.figures.menuchoice" /> 804 is implemented with the following code 805 </para> 516 806 <programlisting> 517 <example id="<replaceable>chapterId</replaceable>.examples.<replaceable>exampleId</replaceable>"> 518 <title><replaceable>The title of the example</replaceable></title> 519 <programlisting> 520 <replaceable>The example code. Can not be indented like the source code that surrounds it 521 if the layout should have a correct look.</replaceable> 522 </programlisting> 523 </example> 807 <figure id="write_docbook_doc.figures.menuchoice"> 808 <title>Menu choice</title> 809 <screenshot> 810 <mediaobject> 811 <imageobject> 812 <imagedata fileref="figures/menuchoice.png" format="PNG" /> 813 </imageobject> 814 </mediaobject> 815 </screenshot> 816 </figure> 524 817 </programlisting> 525 818 </example> 526 819 </sect2> 820 <sect2 id="write_docbook_doc.usedtags.examples"> 821 <title>Examples and program listing</title> 822 <para> 823 Following describes how to insert an example in the documentation.The examples in 824 this document are often some kind of program listing but they can still be examples 825 of something else. 826 </para> 827 <example id="write_docbook_doc.examples.example"> 828 <title>Example in the documentation</title> 829 <para> 830 This shows how 831 <xref linkend="net.sf.basedb.core.plugin.Plugin.getAbout" /> 832 is written in the corresponding XML-file. 833 </para> 834 <programlisting> 835 … 836 <example id="net.sf.basedb.core.plugin.Plugin.getAbout"> 837 <title>A typical implementation stores this information in a static field</title> 838 <programlisting> 839 private static final About about = new AboutImpl 840 ( 841 "Spot images creator", 842 "Converts a full-size scanned image into smaller preview jpg " + 843 "images for each individual spot.", 844 "2.0", 845 "2006, Department of Theoretical Physics, Lund University", 846 null, 847 "base@thep.lu.se", 848 "http://base.thep.lu.se" 849 ); 850 851 public About getAbout() 852 { 853 return about; 854 } 855 </programlisting> 856 </example> 857 … 858 </programlisting> 859 </example> 860 </sect2> 527 861 <sect2 id="write_docbook_doc.usedtags.admonitions"> 528 862 <title>Admonitions</title> 529 <para></para> 530 <variablelist> 531 <varlistentry> 532 <term> 533 <sgmltag class="starttag">note</sgmltag> 534 </term> 535 <listitem> 536 <para>Define a notification for the reader.</para> 537 </listitem> 538 </varlistentry> 539 <varlistentry> 540 <term> 541 <sgmltag class="starttag">warning</sgmltag> 542 </term> 543 <listitem> 544 <para>Define the text as a warning for the reader look up with.</para> 545 </listitem> 546 </varlistentry> 547 <varlistentry> 548 <term> 549 <sgmltag class="starttag">tip</sgmltag> 550 </term> 551 <listitem> 552 <para>Define something that can be useful for the reader to know.</para> 553 </listitem> 554 </varlistentry> 555 <varlistentry> 556 <term> 557 <sgmltag class="starttag">important</sgmltag> 558 </term> 559 <listitem> 560 <para> 561 Define a text to be important, something the reader should pay certain 562 attention to. 563 </para> 564 </listitem> 565 </varlistentry> 566 <varlistentry> 567 <term> 568 <sgmltag class="starttag">caution</sgmltag> 569 </term> 570 <listitem> 571 <para> 572 Define a text about something the reader should be cautious with. 573 </para> 574 </listitem> 575 </varlistentry> 576 </variablelist> 863 <para> 864 The admonitions that are used in this document can be found in the table below. 865 </para> 866 <informaltable frame="none"> 867 <tgroup cols="3" rowsep="1" colsep="1"> 868 <colspec align="left" /> 869 <colspec align="center" /> 870 <colspec align="left" /> 871 <thead> 872 <row> 873 <entry>Define</entry> 874 <entry>Element to use</entry> 875 <entry>Comment</entry> 876 </row> 877 </thead> 878 <tbody> 879 <row> 880 <entry>Warning text</entry> 881 <entry> 882 <sgmltag class="starttag">warning</sgmltag> 883 </entry> 884 <entry></entry> 885 </row> 886 <row> 887 <entry>Notification text</entry> 888 <entry> 889 <sgmltag class="starttag">note</sgmltag> 890 </entry> 891 <entry></entry> 892 </row> 893 <row> 894 <entry>A tip</entry> 895 <entry> 896 <sgmltag class="starttag">tip</sgmltag> 897 </entry> 898 <entry></entry> 899 </row> 900 <row> 901 <entry>Important text</entry> 902 <entry> 903 <sgmltag class="starttag">important</sgmltag> 904 </entry> 905 <entry></entry> 906 </row> 907 <row> 908 <entry>Something to be cautious about</entry> 909 <entry> 910 <sgmltag class="starttag">caution</sgmltag> 911 </entry> 912 <entry></entry> 913 </row> 914 </tbody> 915 </tgroup> 916 </informaltable> 577 917 </sect2> 578 918 <sect2 id="write_docbook_doc.usedtags.lists"> … … 582 922 Some common elements for the lists are also described here. 583 923 </para> 584 <variablelist> 585 <varlistentry> 586 <term> 587 <sgmltag class="starttag">listitem</sgmltag> 588 </term> 589 <listitem> 590 <para>Define an item in one of the three lists below.</para> 591 </listitem> 592 </varlistentry> 593 <varlistentry> 594 <term> 595 <sgmltag class="starttag">itemizedlist</sgmltag> 596 </term> 597 <listitem> 598 <para>Define a list where each item is marked with a bullet.</para> 599 </listitem> 600 </varlistentry> 601 <varlistentry> 602 <term> 603 <sgmltag class="starttag">varlist</sgmltag> 604 </term> 605 <listitem> 606 <para> 607 Define a variable list. Beside variables, this type is also being used 608 to describe different kind of items.This list type needs to have some 609 more child items to work correctly.See the 610 <ulink url="http://www.docbook.org/tdg/en/html/variablelist.html"> 611 docbook documentation 612 </ulink> 613 for more information. 614 </para> 615 </listitem> 616 </varlistentry> 617 <varlistentry> 618 <term> 619 <sgmltag class="starttag">orderedlist</sgmltag> 620 </term> 621 <listitem> 622 <para> 623 Define an ordered list with each item marked with an incremented label. 624 </para> 625 </listitem> 626 </varlistentry> 627 </variablelist> 924 <informaltable frame="none"> 925 <tgroup cols="3" rowsep="1" colsep="1"> 926 <colspec align="left" /> 927 <colspec align="center" /> 928 <colspec align="left" /> 929 <thead> 930 <row> 931 <entry>Define</entry> 932 <entry>Element</entry> 933 <entry>Comment</entry> 934 </row> 935 </thead> 936 <tbody> 937 <row> 938 <entry>None-ordered list</entry> 939 <entry> 940 <sgmltag class="starttag">itemizedlist</sgmltag> 941 </entry> 942 <entry></entry> 943 </row> 944 <row> 945 <entry>Term definition list</entry> 946 <entry> 947 <sgmltag class="starttag">variablelist</sgmltag> 948 </entry> 949 <entry></entry> 950 </row> 951 <row> 952 <entry>Ordered list</entry> 953 <entry> 954 <sgmltag class="starttag">orderedlist</sgmltag> 955 </entry> 956 <entry></entry> 957 </row> 958 <row> 959 <entry>List item</entry> 960 <entry> 961 <sgmltag class="starttag">listitem</sgmltag> 962 </entry> 963 <entry></entry> 964 </row> 965 </tbody> 966 </tgroup> 967 </informaltable> 968 <para>The example below shows how to create a list for term definition in the text.</para> 969 <example id="write_docbook_doc.examples.variablelist"> 970 <title>Example how to write a variable list</title> 971 <programlisting> 972 … 973 <variablelist> 974 <varlistentry> 975 <term>Term1</term> 976 <listitem> 977 <para> 978 Definition/explanation of the term 979 </para> 980 </listitem> 981 </varlistentry> 982 983 <varlistentry> 984 <term>Term2</term> 985 <listitem> 986 <para> 987 Definition/explanation of the term 988 </para> 989 </listitem> 990 </varlistentry> 991 </variablelist> 992 </programlisting> 993 </example> 628 994 </sect2> 629 995 </sect1>
Note: See TracChangeset
for help on using the changeset viewer.