Skip to content

Commit ace051e

Browse files
authored
Merge pull request #64 from thehajime/readthedoc
doc infra update: generate doxygen on readthedocs.io servers
2 parents 7c34d9b + ef2207d commit ace051e

File tree

6 files changed

+29
-64
lines changed

6 files changed

+29
-64
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[![Build status](https://circleci.com/gh/direct-code-execution/ns-3-dce.svg?style=shield&circle-token=a9cf0c7e5e7a1d1a7ff2e2e5b341706fba3ccfb2)](https://circleci.com/gh/direct-code-execution/ns-3-dce)
2+
[![Documentation Status](https://readthedocs.org/projects/ns-3-dce/badge/?version=latest)](http://ns-3-dce.readthedocs.io/en/latest/?badge=latest)
23
[![License](https://img.shields.io/badge/license-GPL-brightgreen.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
34

45
What is Direct Code Execution (DCE) ?

doc/doxygen.conf

Lines changed: 7 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ PROJECT_NAME = "ns-3-dce"
3232
# This could be handy for archiving the generated documentation or
3333
# if some version control system is used.
3434

35-
PROJECT_NUMBER = "1.9"
35+
PROJECT_NUMBER = DCE_VERSION
3636

3737
# Using the PROJECT_BRIEF tag one can provide an optional one line description
3838
# for a project that appears at the top of each page and should give viewer
@@ -45,7 +45,7 @@ PROJECT_BRIEF = "A Direct Code Execution for ns-3 Network Simulator"
4545
# exceed 55 pixels and the maximum width should not exceed 200 pixels.
4646
# Doxygen will copy the logo to the output directory.
4747

48-
PROJECT_LOGO = ./doc/ns3_html_theme/static/ns-3-inverted-notext-small.png
48+
PROJECT_LOGO =
4949

5050
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
5151
# base path where the generated documentation will be put.
@@ -321,22 +321,6 @@ INLINE_SIMPLE_STRUCTS = NO
321321

322322
TYPEDEF_HIDES_STRUCT = YES
323323

324-
# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
325-
# determine which symbols to keep in memory and which to flush to disk.
326-
# When the cache is full, less often used symbols will be written to disk.
327-
# For small to medium size projects (<1000 input files) the default value is
328-
# probably good enough. For larger projects a too small cache size can cause
329-
# doxygen to be busy swapping symbols to and from disk most of the time
330-
# causing a significant performance penalty.
331-
# If the system has enough physical memory increasing the cache will improve the
332-
# performance by keeping more symbols in memory. Note that the value works on
333-
# a logarithmic scale so increasing the size by one will roughly double the
334-
# memory usage. The cache size is given by this formula:
335-
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
336-
# corresponding to a cache size of 2^16 = 65536 symbols.
337-
338-
SYMBOL_CACHE_SIZE = 0
339-
340324
# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
341325
# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
342326
# their name and scope. Since this can be an expensive process and often the
@@ -769,7 +753,7 @@ EXAMPLE_RECURSIVE = NO
769753
# directories that contain image that are included in the documentation (see
770754
# the \image command).
771755

772-
IMAGE_PATH = doc/ns3_html_theme/static
756+
IMAGE_PATH =
773757

774758
# The INPUT_FILTER tag can be used to specify a program that doxygen should
775759
# invoke to filter for each input file. Doxygen will invoke the filter program
@@ -918,13 +902,13 @@ HTML_FILE_EXTENSION = .html
918902
# have to redo this when upgrading to a newer version of doxygen or when
919903
# changing the value of configuration settings such as GENERATE_TREEVIEW!
920904

921-
HTML_HEADER = doc/ns3_html_theme/ns3_doxy_header.html
905+
HTML_HEADER =
922906

923907
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
924908
# each generated HTML page. If it is left blank doxygen will generate a
925909
# standard footer.
926910

927-
HTML_FOOTER = doc/ns3_html_theme/ns3_doxy_footer.html
911+
HTML_FOOTER =
928912

929913
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
930914
# style sheet that is used by each HTML page. It can be used to
@@ -933,7 +917,7 @@ HTML_FOOTER = doc/ns3_html_theme/ns3_doxy_footer.html
933917
# the style sheet file to the HTML output directory, so don't put your own
934918
# style sheet in the HTML output directory as well, or it will be erased!
935919

936-
HTML_STYLESHEET = doc/ns3_html_theme/static/ns3_stylesheet.css
920+
HTML_STYLESHEET =
937921

938922
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
939923
# other source files which should be copied to the HTML output directory. Note
@@ -942,14 +926,7 @@ HTML_STYLESHEET = doc/ns3_html_theme/static/ns3_stylesheet.css
942926
# files. In the HTML_STYLESHEET file, use the file name only. Also note that
943927
# the files will be copied as-is; there are no commands or markers available.
944928

945-
HTML_EXTRA_FILES = doc/ns3_html_theme/static/doxygen.css \
946-
doc/ns3_html_theme/static/bar-top.png \
947-
doc/ns3_html_theme/static/drop-down-menu.js \
948-
doc/ns3_html_theme/static/favicon.ico \
949-
doc/ns3_html_theme/static/menu-bgr-400.png \
950-
doc/ns3_html_theme/static/ns3_version.js \
951-
doc/ns3_html_theme/static/ns3_links.js \
952-
doc/ns3_html_theme/static/ver.png
929+
HTML_EXTRA_FILES =
953930

954931
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
955932
# Doxygen will adjust the colors in the style sheet and background images
@@ -1435,18 +1412,6 @@ GENERATE_XML = NO
14351412

14361413
XML_OUTPUT = xml
14371414

1438-
# The XML_SCHEMA tag can be used to specify an XML schema,
1439-
# which can be used by a validating XML parser to check the
1440-
# syntax of the XML files.
1441-
1442-
XML_SCHEMA =
1443-
1444-
# The XML_DTD tag can be used to specify an XML DTD,
1445-
# which can be used by a validating XML parser to check the
1446-
# syntax of the XML files.
1447-
1448-
XML_DTD =
1449-
14501415
# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
14511416
# dump the program listings (including syntax highlighting
14521417
# and cross-referencing information) to the XML output. Note that
@@ -1653,15 +1618,6 @@ HAVE_DOT = YES
16531618

16541619
DOT_NUM_THREADS = 0
16551620

1656-
# By default doxygen will use the Helvetica font for all dot files that
1657-
# doxygen generates. When you want a differently looking font you can specify
1658-
# the font name using DOT_FONTNAME. You need to make sure dot is able to find
1659-
# the font, which can be done by putting it in a standard location or by setting
1660-
# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
1661-
# directory containing the font.
1662-
1663-
DOT_FONTNAME = FreeSans
1664-
16651621
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
16661622
# The default size is 10pt.
16671623

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ns3_version.js: automatically generated
22
// public urls
33
var ns3_host = "/";
4-
var ns3_version = "Release <a href=\"http://www.nsnam.org/overview/projects/direct-code-execution/dce-1.9\">dce-1.9</a>";
4+
var ns3_version = "Release <a href=\"http://www.nsnam.org/overview/projects/direct-code-execution/dce-1.9\">DCE_VERSION</a>";
55
var ns3_release = "docs/dce/release/1.9/";
66
var ns3_local = "";
77
var ns3_doxy = "doxygen/";

doc/source/conf.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14-
import sys, os
14+
import sys, os, subprocess
15+
import re
1516

1617
# If extensions (or modules to document with autodoc) are in another directory,
1718
# add these directories to sys.path here. If the directory is relative to the
@@ -47,10 +48,9 @@
4748
# |version| and |release|, also used in various other places throughout the
4849
# built documents.
4950
#
50-
# The short X.Y version.
51-
version = '1.9'
5251
# The full version, including alpha/beta/rc tags.
53-
release = '1.9'
52+
release = re.sub('^dce-', '', os.popen('git describe --tags').read().strip())
53+
version = release
5454

5555
# The language for content autogenerated by Sphinx. Refer to documentation
5656
# for a list of supported languages.
@@ -91,11 +91,11 @@
9191

9292
# The theme to use for HTML and HTML Help pages. See the documentation for
9393
# a list of builtin themes.
94-
#html_theme = 'default'
94+
html_theme = 'default'
9595
#html_theme = 'agogo'
9696
#html_theme = 'traditional'
9797
#html_theme = 'scrolls'
98-
html_theme = 'sphinxdoc'
98+
#html_theme = 'sphinxdoc'
9999

100100

101101
# Theme options are theme-specific and customize the look and feel of a theme
@@ -221,3 +221,11 @@
221221
# One entry per manual page. List of tuples
222222
# (source start file, name, description, authors, manual section).
223223

224+
225+
## For doxygen generation at readthedocs.io
226+
read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
227+
228+
if read_the_docs_build:
229+
subprocess.call('sed -i "s/doc$/doc\/source\/_build\/html\/doxygen/" ../doxygen.conf', shell=True)
230+
subprocess.call('sed -i "s/DCE_VERSION/dce-%s"/ ../doxygen.conf' % release, shell=True)
231+
subprocess.call('cd ../../ ; doxygen doc/doxygen.conf', shell=True)

doc/source/getting-started.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ then you must to create a directory for DCE and install it using bake:
4444
4545
mkdir dce
4646
cd dce
47-
bake.py configure -e dce-ns3-|version|
47+
bake.py configure -e dce-ns3-$version
4848
bake.py download
4949
bake.py build
5050
51-
note that dce-ns3-|version| is the DCE version |version| module. If you would like to use the development version of DCE module, you can specify **dce-ns3-dev** as a module name for bake.
51+
note that dce-ns3-$version is the DCE module with a version number. If you would like to use the development version of DCE module, you can specify **dce-ns3-dev** as a module name for bake.
5252

5353
the output should look likes this:
5454

@@ -84,11 +84,11 @@ The difference to build the advanced mode is the different module name *dce-linu
8484
8585
mkdir dce
8686
cd dce
87-
bake.py configure -e dce-linux-|version|
87+
bake.py configure -e dce-linux-$version
8888
bake.py download
8989
bake.py build
9090
91-
note that dce-linux-|version| is the DCE version |version| module. If you would like to use the development version of DCE module, you can specify **dce-linux-dev** as a module name for bake.
91+
note that dce-linux-$version is the DCE module with a version number. If you would like to use the development version of DCE module, you can specify **dce-linux-dev** as a module name for bake.
9292

9393

9494
Building DCE using WAF

doc/source/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Direct Code Execution (DCE) Manual
55

66
This is the manual of Direct Code Execution (DCE).
77

8-
* `Doxygen <http://www.nsnam.org/docs/dce/doxygen/index.html>`_: Documentation of the public APIs of the DCE
9-
* Manual *(this document)* for the `latest release <http://www.nsnam.org/docs/dce/release/latest/manual/html/index.html>`_ and `development tree <http://www.nsnam.org/docs/dce/manual/html/index.html>`_
8+
* `Doxygen <./doxygen/html/>`_: Documentation of the public APIs of the DCE
9+
* Manual *(this document)* for the `latest release <../latest/>`_ and `development tree <../latest/>`_
1010

1111
This document is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ for `Sphinx <http://sphinx.pocoo.org/>`_ and is maintained in the
1212
``doc/`` directory of ns-3-dce's source code.

0 commit comments

Comments
 (0)