Skip to content

Commit

Permalink
Include OMSimulator documentation in OM User's Guide (#6791)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Oct 2, 2020
1 parent 389c4e4 commit 5580cb6
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 8 deletions.
4 changes: 3 additions & 1 deletion doc/UsersGuide/.gitignore
Expand Up @@ -41,7 +41,7 @@ source/media/omedit-icons
source/media/mathematica-notebooks.pdf
source/media/omoptim-icons/
source/omchelptext.rst
source/releaselink.inc
source/omreleaselink.inc
source/simoptions.inc
source/testmodel.pdf
source/testmodel.png
Expand All @@ -66,3 +66,5 @@ source/omnotebook-open-loop.svg
source/testmodel-plotall.pdf
source/testmodel-plotall.png
source/testmodel-plotall.svg
source/omsimulator-help.inc

15 changes: 13 additions & 2 deletions doc/UsersGuide/Makefile
Expand Up @@ -5,14 +5,16 @@ OPENMODELICA_ROOT = $(CURDIR)/../../
# OMPython needs this
OPENMODELICAHOME := $(OPENMODELICA_ROOT)/build/

OMSUSERSGUIDE = $(OPENMODELICA_ROOT)/OMSimulator/doc/UsersGuide

# You can set these variables from the command line.

SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build

ALLDEP = source/openmodelica.bib source/interface.inc $(OMEDIT_ICONS) $(OMOPTIM_ICONS)
ALLDEP = source/openmodelica.bib source/interface.inc $(OMEDIT_ICONS) $(OMOPTIM_ICONS) omsimulatorstuff

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
Expand All @@ -26,7 +28,7 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) sou
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source

.PHONY: help clean html htmlmathpng dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext readme
.PHONY: help clean html htmlmathpng dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext readme omsimulatorstuff

help:
@echo "Please use \`make <target>' where <target> is one of"
Expand Down Expand Up @@ -270,3 +272,12 @@ source/omchelptext.rst:
mv "$@.tmp" "$@"
source/tracreleases.rst: source/tracreleases.py
cd source && ./tracreleases.py
source/omsimulator-help.inc:
$(OPENMODELICAHOME)/bin/OMSimulator --help > "$@.tmp"
mv "$@.tmp" "$@"
$(OMSUSERSGUIDE)/source/OMSimulatorPython.inc: $(OMSUSERSGUIDE)/source/conf.py
(cd $(OMSUSERSGUIDE)/source && python3 "conf.py")
omsimulatorstuff:
$(MAKE) $(OMSUSERSGUIDE)/source/OMSimulatorPython.inc source/omsimulator-help.inc
test -e source/omsimulator || ln -s "$(OMSUSERSGUIDE)/source" "source/omsimulator"
for f in api images OMCScripting.inc OMSimulatorLib.inc OMSimulatorLua.inc OMSimulatorPython.inc releaselink.inc; do test -e "source/$$f" || ln -s "$(OMSUSERSGUIDE)/source/$$f" "source/$$f"; done
9 changes: 9 additions & 0 deletions doc/UsersGuide/source/.gitignore
@@ -1 +1,10 @@
Modelica.Mechanics.*
OMCScripting.inc
OMSimulatorLib.inc
OMSimulatorLua.inc
OMSimulatorPython.inc
api
images
omsimulator
releaselink.inc

4 changes: 2 additions & 2 deletions doc/UsersGuide/source/conf.py
Expand Up @@ -118,7 +118,7 @@
release = '1.9.3-dev'
releaselink = "*Version:* %s" % release

open("releaselink.inc", "w").write(releaselink)
open("omreleaselink.inc", "w").write(releaselink)


# The language for content autogenerated by Sphinx. Refer to documentation
Expand All @@ -136,7 +136,7 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
exclude_patterns = ['omsimulator/*.rst','omsimulator/api/*.rst','api/*.rst','tmp.rst']

# The reST default role (used for this markup: `text`) to use for all
# documents.
Expand Down
2 changes: 1 addition & 1 deletion doc/UsersGuide/source/index.rst
Expand Up @@ -8,7 +8,7 @@ Generated on |date| at |time|

.. only :: html or epub
.. include :: releaselink.inc
.. include :: omreleaselink.inc
.. only :: latex
Expand Down
20 changes: 18 additions & 2 deletions doc/UsersGuide/source/omsimulator.rst
@@ -1,4 +1,20 @@
OMSimulator
===========
~~~~~~~~~~~

`OMSimulator <https://github.com/OpenModelica/OMSimulator>`_ has its own `documentation <https://openmodelica.org/doc/OMSimulator/master/html/>`_.
.. include :: releaselink.inc
.. include:: omsimulator/introduction.rst

.. include:: omsimulator/OMSimulator.rst

.. include:: omsimulator/OMSimulatorLib.rst

.. include:: omsimulator/OMSimulatorLua.rst

.. include:: omsimulator/OMSimulatorPython.rst

.. include:: omsimulator/OpenModelicaScripting.rst

.. include:: omsimulator/OMEdit.rst

.. include:: omsimulator/SSP.rst

0 comments on commit 5580cb6

Please sign in to comment.