Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
2feb4bd5
Commit
2feb4bd5
authored
13 years ago
by
Gigg, Martyn Anthony
Browse files
Options
Downloads
Patches
Plain Diff
Refs #4411. Add a latex (for a pdf) target to sphinx.
The output PDF is not ideal at the moment but it is a start.
parent
301f0b8d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Mantid/MantidPlot/docs/python/CMakeLists.txt
+33
-7
33 additions, 7 deletions
Code/Mantid/MantidPlot/docs/python/CMakeLists.txt
Code/Mantid/MantidPlot/docs/python/runsphinx.py.in
+3
-3
3 additions, 3 deletions
Code/Mantid/MantidPlot/docs/python/runsphinx.py.in
with
36 additions
and
10 deletions
Code/Mantid/MantidPlot/docs/python/CMakeLists.txt
+
33
−
7
View file @
2feb4bd5
...
@@ -8,8 +8,16 @@ find_package ( Sphinx )
...
@@ -8,8 +8,16 @@ find_package ( Sphinx )
if
(
SPHINX_FOUND
)
if
(
SPHINX_FOUND
)
# Fill in the config file and autogen file with build information
# Fill in the config file and autogen file with build information
configure_file
(
source/conf.py.in source/conf.py @ONLY
)
configure_file
(
source/conf.py.in source/conf.py @ONLY
)
configure_file
(
autogen_api.py.in autogen_api.py @ONLY
)
configure_file
(
autogen_api.py.in autogen_api.py @ONLY
)
configure_file
(
runsphinx.py.in runsphinx.py @ONLY
)
# Two builders are required
set
(
TARGET_NAME sphinx
)
set
(
SPHINX_BUILD
${
CMAKE_CURRENT_BINARY_DIR
}
/../../../
${
TARGET_NAME
}
)
set
(
BUILDER html
)
configure_file
(
runsphinx.py.in runsphinx_html.py @ONLY
)
set
(
BUILDER latex
)
configure_file
(
runsphinx.py.in runsphinx_latex.py @ONLY
)
# Sphinx seems to require the config file to be next to the rest of the source
# Sphinx seems to require the config file to be next to the rest of the source
# files meaning we need to copy everything over to the build directory
# files meaning we need to copy everything over to the build directory
...
@@ -34,13 +42,31 @@ if ( SPHINX_FOUND )
...
@@ -34,13 +42,31 @@ if ( SPHINX_FOUND )
set
(
SPHINX_CONF_FILES
${
SPHINX_CONF_FILES
}
${
out_file
}
)
set
(
SPHINX_CONF_FILES
${
SPHINX_CONF_FILES
}
${
out_file
}
)
endforeach
()
endforeach
()
set
(
SPHINX_HTML_BUILD
${
CMAKE_CURRENT_BINARY_DIR
}
/../../../python-sphinx/html
)
# Sphinx is run as '${SPHINX_EXECUTABLE} -b sourcedir builddir'
add_custom_target
(
python-sphinx
# Both depend on the autogenerated API files
add_custom_target
(
${
TARGET_NAME
}
-generateapi
COMMAND
${
CMAKE_RUNTIME_OUTPUT_DIRECTORY
}
/MantidPlot -xq autogen_api.py
COMMAND
${
CMAKE_RUNTIME_OUTPUT_DIRECTORY
}
/MantidPlot -xq autogen_api.py
COMMAND
${
CMAKE_RUNTIME_OUTPUT_DIRECTORY
}
/MantidPlot -xq runsphinx.py
DEPENDS
${
SPHINX_CONF_FILES
}
DEPENDS
${
SPHINX_CONF_FILES
}
COMMENT
"Build Python Sphinx API documentation"
COMMENT
"Generating Python API for sphinx"
)
# HTML target
set
(
SPHINX_HTML_BUILD
${
SPHINX_BUILD
}
/html
)
add_custom_target
(
${
TARGET_NAME
}
-html
COMMAND
${
CMAKE_RUNTIME_OUTPUT_DIRECTORY
}
/MantidPlot -xq runsphinx_html.py
COMMENT
"Build Sphinx html documentation"
)
add_dependencies
(
${
TARGET_NAME
}
-html
${
TARGET_NAME
}
-generateapi
)
# Latex target
set
(
SPHINX_LATEX_BUILD
${
SPHINX_BUILD
}
/latex
)
add_custom_target
(
${
TARGET_NAME
}
-latex
COMMAND
${
CMAKE_RUNTIME_OUTPUT_DIRECTORY
}
/MantidPlot -xq runsphinx_latex.py
COMMENT
"Build Python Sphinx latex documentation"
)
)
add_dependencies
(
${
TARGET_NAME
}
-latex
${
TARGET_NAME
}
-generateapi
)
endif
()
endif
()
This diff is collapsed.
Click to expand it.
Code/Mantid/MantidPlot/docs/python/runsphinx.py.in
+
3
−
3
View file @
2feb4bd5
...
@@ -9,13 +9,13 @@ import os
...
@@ -9,13 +9,13 @@ import os
from pkg_resources import load_entry_point
from pkg_resources import load_entry_point
mantidplot = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@/MantidPlot"
mantidplot = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@/MantidPlot"
builder = "
html
"
builder = "
@BUILDER@
"
src_dir = "@CMAKE_CURRENT_BINARY_DIR@/source"
src_dir = "@CMAKE_CURRENT_BINARY_DIR@/source"
output_dir =
"@CMAKE_CURRENT_BINARY_DIR@/../../../python-sphinx/" +
builder
output_dir =
os.path.join("@SPHINX_BUILD@",
builder
)
argv = [mantidplot,'-b', builder, src_dir, output_dir]
argv = [mantidplot,'-b', builder, src_dir, output_dir]
if __name__ == '__main__':
if __name__ == '__main__':
sys.exit(
sys.exit(
load_entry_point('Sphinx==1.1.2', 'console_scripts', 'sphinx-build')(argv)
load_entry_point('Sphinx==1.1.2', 'console_scripts', 'sphinx-build')(argv)
)
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment