summaryrefslogtreecommitdiff
path: root/doc/pjsip-book/breathe.rst
blob: ea6d351679088486fe1edad14510cb0a8e477e41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
Appendix: Generating This Documentation
=======================================

Requirements
------------

This documentation is created with `Sphinx <http://sphinx-doc.org>`_ and `Breathe <http://michaeljones.github.io/breathe/index.html>`_. Here are the required tools:

1. Doxygen is required. `Install <http://www.stack.nl/~dimitri/doxygen/download.html#srcbin>`_ it for your platform.

2. The easiest way to install all the tools is with `Python Package Index (PyPI) <http://pypi.python.org>`_. Just run this and it will install Sphinx, Breathe, and all the required tools if they are not installed::

   $ sudo pip install breathe

3. Otherwise if PyPI is not available, consult Sphinx and Breathe sites for installation instructions and you may need to install these manually:

  - `Sphinx <http://sphinx-doc.org>`_
  - `Breathe <http://michaeljones.github.io/breathe/index.html>`_
  - docutils
  - Pygments


Rendering The Documentation
------------------------------
The main source of the documentation is currently the '''Trac''' pages at https://trac.pjsip.org/repos/wiki/pjsip-doc/index. The copies in SVN are just copies for backup.

To render the documentation as HTML in `_build/html` directory::

  $ cd $PJDIR/doc/pjsip-book
  $ python fetch_trac.py
  $ make
  
To build PDF, run::

  $ make latexpdf


How to Use Integrate Book with Doxygen
--------------------------------------
Quick sample::

  will be rendered like this:
  +++++++++++++++++++++++++++

  This is how to quote a code with syntax coloring:

  .. code-block:: c++

       pj::AudioMediaPlayer *player = new AudioMediaPlayer;
       player->createPlayer("announcement.wav");

  There are many ways to refer a symbol: 

  * A method: :cpp:func:`pj::AudioMediaPlayer::createPlayer()`
  * A method with alternate display: :cpp:func:`a method <pj::AudioMediaPlayer::createPlayer()>`
  * A class :cpp:class:`pj::AudioMediaPlayer`
  * A class with alternate display: :cpp:class:`a class <pj::AudioMediaPlayer>`

  For that links to work, we need to display the link target declaration (a class or method) 
  somewhere in the doc, like this:
  
  .. doxygenclass:: pj::AudioMediaPlayer
        :path: xml
        :members:

  Alternatively we can display a single method declaration like this:

  .. doxygenfunction:: pj::AudioMediaPlayer::createPlayer()
        :path: xml
        :no-link:

  We can also display class declaration with specific members.
  
  For more info see `Breathe documentation <http://michaeljones.github.io/breathe/domains.html>`_

     
.. default-domain:: cpp

will be rendered like this:
+++++++++++++++++++++++++++

This is how to quote a code with syntax coloring:

.. code-block:: c++

       pj::AudioMediaPlayer *player = new AudioMediaPlayer;
       player->createPlayer("announcement.wav");

There are many ways to refer a symbol: 

* A method: :cpp:func:`pj::AudioMediaPlayer::createPlayer()`
* A method with alternate display: :cpp:func:`a method <pj::AudioMediaPlayer::createPlayer()>`
* A class :cpp:class:`pj::AudioMediaPlayer`
* A class with alternate display: :cpp:class:`a class <pj::AudioMediaPlayer>`

For that links to work, we need to display the link target declaration (a class or method) somewhere in the doc, like this:
  
   .. doxygenclass:: pj::AudioMediaPlayer
        :path: xml
        :members:

Alternatively we can display a single method declaration like this:

   .. doxygenfunction:: pj::AudioMediaPlayer::createPlayer()
        :path: xml
        :no-link:

We can also display class declaration with specific members.

For more info see `Breathe documentation <http://michaeljones.github.io/breathe/domains.html>`_