Skip to content

Commit

Permalink
edit following convince_docu_example for c++
Browse files Browse the repository at this point in the history
Signed-off-by: SofiaFaraci <[email protected]>
  • Loading branch information
SofiaFaraci committed May 21, 2024
1 parent 45b2566 commit 55504d7
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 37 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,15 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/


CMakeCache.txt
CMakeFiles/
cmake_install.cmake
.vscode
*.egg-info/
*/build/
*.pyc

# Sphinx
API/
14 changes: 7 additions & 7 deletions CMakeLists.txt → code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ project(model2code)

find_package(tinyxml2 CONFIG REQUIRED)

add_executable(${PROJECT_NAME} code/src/main.cpp)
add_executable(${PROJECT_NAME} src/main.cpp)

target_include_directories(${PROJECT_NAME} PRIVATE
${TinyXML2_INCLUDE_DIRS} # Include TinyXML2 directories
${CMAKE_CURRENT_SOURCE_DIR}/code/include/
${CMAKE_CURRENT_SOURCE_DIR}/include/
)


Expand All @@ -22,11 +22,11 @@ install(
)

target_sources( ${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/code/src/main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/code/src/utils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/code/src/Generator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/code/src/ExtractFromXML.cpp
${CMAKE_CURRENT_SOURCE_DIR}/code/src/ExtractFromElement.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/utils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Generator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ExtractFromXML.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ExtractFromElement.cpp
)

set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "Command Line Tools")
Expand Down
3 changes: 2 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build


# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Expand All @@ -17,4 +18,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2 changes: 1 addition & 1 deletion docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ goto end
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
popd
6 changes: 3 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sphinx==7.1.2
sphinx-rtd-theme==1.3.0rc1
sphinxcontrib-mermaid==0.9.2
sphinxcontrib-plantuml==0.29

# sphinx-autodoc2==0.5.0
myst-parser==3.0.1
# myst-parser==3.0.1
breathe==4.35.0
exhale==0.3.7
10 changes: 5 additions & 5 deletions docs/source/Doxyfile → docs/source/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY = ./documentation
OUTPUT_DIRECTORY = ../build/doxygen

# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
Expand Down Expand Up @@ -485,7 +485,7 @@ NUM_PROC_THREADS = 1
# normally produced when WARNINGS is set to YES.
# The default value is: NO.

EXTRACT_ALL = YES
EXTRACT_ALL = NO

# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
# be included in the documentation.
Expand Down Expand Up @@ -864,7 +864,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = code/src code/include
INPUT = ../../code

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down Expand Up @@ -2094,7 +2094,7 @@ MAN_LINKS = NO
# captures the structure of the code including all documentation.
# The default value is: NO.

GENERATE_XML = NO
GENERATE_XML = YES

# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
Expand Down Expand Up @@ -2254,7 +2254,7 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

PREDEFINED =
PREDEFINED =

# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
Expand Down
4 changes: 4 additions & 0 deletions docs/source/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
.wy-side-nav-search {
background-color: darkgray;
}
/* Top Navigation (relevant e.g. on mobile) */
.wy-nav-top {
background-color: darkgray;
}

/* Link on top of logo */
.wy-side-nav-search a {
Expand Down
9 changes: 9 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
API
===

.. autosummary::
:toctree: API
:template: custom-module-template.rst
:recursive:

demopkg
41 changes: 22 additions & 19 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Configuration file for the Sphinx documentation builder.

from cgitb import html
# -- Project information

project = 'MODEL2CODE'
Expand All @@ -10,29 +10,32 @@
version = '0.1.0'

# -- General configuration
# Breathe/exhale configuration
breathe_projects = {"model2code":"../build/doxygen/xml"}
breathe_default_project = "model2code"

exhale_args = {
"containmentFolder" : "./API",
"rootFileName" : "api.rst",
"rootFileTitle" : "API",
"doxygenStripFromPath" : "..",
"createTreeView": True
}

# Tell sphinx what the primary language being documented is.
primary_domain = 'cpp'

# Tell sphinx what the pygments highlight language should be.
highlight_language = 'cpp'

extensions = [
# 'sphinx.ext.autosummary',
# 'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
"sphinx.ext.napoleon",
"autoapi.extension",
# 'myst_parser',
# 'sphinxcontrib.mermaid',
# 'sphinxcontrib.plantuml',
# 'autodoc2',
'breathe',
'exhale'
]

autoapi_options = [
"members",
"undoc-members",
"show-inheritance",
"show-module-summary",
"imported-members",
]

autoapi_dirs = ["../../src"]

# intersphinx_mapping = {
# 'python': ('https://docs.python.org/3/', None),
# 'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Contents
:maxdepth: 2

tutorials
api
API/api

0 comments on commit 55504d7

Please sign in to comment.