Skip to content

Commit 44cb9fc

Browse files
authored
utf-8 encoding for doc/usersguide (#10570)
- Fixes for building User's Guide in devcontainer using build-deps:v1.16.4 - Updating Readme of User's Guide on how to build it.
1 parent 22e142a commit 44cb9fc

File tree

6 files changed

+102
-80
lines changed

6 files changed

+102
-80
lines changed

doc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
There are different documentations available for OpenModelica.
44

55
- The User's Guide, see [UsersGuide/README.md](https://github.com/OpenModelica/OpenModelica/blob/master/doc/UsersGuide/README.md)
6-
- Doxygen documentation for parts of the C, C++ and OMSI documentation
6+
- Doxygen documentation for parts of the C, C++ and OMSI documentation

doc/UsersGuide/.gitignore

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,2 @@
11
/build
2-
source/*.pyc
3-
source/logo.pdf
42
/tmp
5-
source/LotkaVolterra*.*
6-
source/dcmotor.*
7-
source/ProfilingTest_prof*
8-
source/VanDerPol.pdf
9-
source/VanDerPol.png
10-
source/VanDerPol.svg
11-
source/bouncingball_fmu.pdf
12-
source/bouncingball_fmu.png
13-
source/bouncingball_fmu.svg
14-
source/externallibraries.pdf
15-
source/externallibraries.png
16-
source/externallibraries.svg
17-
source/helloworld-detailed.pdf
18-
source/helloworld-detailed.png
19-
source/helloworld-detailed.svg
20-
source/helloworld-euler.pdf
21-
source/helloworld-euler.png
22-
source/helloworld-euler.svg
23-
source/helloworld.pdf
24-
source/helloworld.png
25-
source/helloworld.svg
26-
source/nmpc-input.pdf
27-
source/nmpc-input.png
28-
source/nmpc-input.svg
29-
source/nmpc-states.pdf
30-
source/nmpc-states.png
31-
source/nmpc-states.svg
32-
source/openmodelica.bib
33-
source/switch.pdf
34-
source/switch.png
35-
source/switch.svg
36-
source/interface.inc
37-
source/tmp.rst
38-
source/tmp.wiki
39-
source/media/omedit-icons
40-
source/media/mathematica-notebooks.pdf
41-
source/media/omoptim-icons/
42-
source/omchelptext.rst
43-
source/omreleaselink.inc
44-
source/simoptions.inc
45-
source/testmodel.pdf
46-
source/testmodel.png
47-
source/testmodel.svg
48-
source/__pycache__/
49-
source/media/mdt-build-prompt.pdf
50-
source/media/mdt-create-project.pdf
51-
source/media/systemoverview.pdf
52-
source/omnotebook-closed-loop.pdf
53-
source/omnotebook-closed-loop.png
54-
source/omnotebook-closed-loop.svg
55-
source/omnotebook-drcontrol-imgposroots.pdf
56-
source/omnotebook-drcontrol-imgposroots.png
57-
source/omnotebook-drcontrol-imgposroots.svg
58-
source/omnotebook-drcontrol-negroots.pdf
59-
source/omnotebook-drcontrol-negroots.png
60-
source/omnotebook-drcontrol-negroots.svg
61-
source/omnotebook-open-loop.pdf
62-
source/omnotebook-open-loop.png
63-
source/omnotebook-open-loop.svg
64-
source/testmodel-plotall.pdf
65-
source/testmodel-plotall.png
66-
source/testmodel-plotall.svg
67-
source/omsimulator-help.inc
68-

doc/UsersGuide/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ help:
6060

6161
clean:
6262
rm -rf $(BUILDDIR)/*
63+
git clean -fX source/
6364

6465
html: all-dep
6566
$(SPHINXBUILD) -b html -t nomathjax $(ALLSPHINXOPTS) $(BUILDDIR)/html

doc/UsersGuide/README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,35 @@
1-
# Users Guide
2-
OpenModelica users guide using Sphinx (Python Documentation Generator).
1+
# User's Guide
2+
3+
OpenModelica User's Guide using Sphinx (Python Documentation Generator).
34

45
## Dependencies
6+
7+
Getting all dependencies right is a nightmare. Just use the dev container
8+
`build-deps:v1.16.4` from [.devcontainer/README.md](./../../.devcontainer/README.md) and
9+
set `GITHUB_AUTH`.
10+
11+
- omc, omc-diff and omsimulator
512
- Inkscape
613
- Sphinx
714
- Python3 and packages from [requirements.txt](https://raw.githubusercontent.com/OpenModelica/OpenModelica-doc/master/UsersGuide/source/requirements.txt)
15+
- Python PyGithub package
16+
17+
### GITHUB_AUTH
18+
19+
Create a read-only personal access token (API token) on GitHub.com and define an
20+
environment variable `GITHUB_AUTH` with your secret API token.
21+
```bash
22+
export GITHUB_AUTH=XXXXXXXXXXX
23+
```
24+
This is needed to read release information from
25+
https://github.com/OpenModelica/OpenModelica with the PyGithub package.
826

927
### Unix
28+
1029
- Install the Python dependencies using `pip3 install -r source/requirements.txt`
1130

1231
### Windows MinGW
32+
1333
- Install `Python 2.7`.
1434
- Install `pip 7.1.2`.
1535
- Install `bibtexparser` using `pip install bibtexparser`.
@@ -18,9 +38,9 @@ OpenModelica users guide using Sphinx (Python Documentation Generator).
1838
- Install `sphinxcontrib-bibtex` using `pip install sphinxcontrib-bibtex`.
1939
- Install `sphinxcontrib-inlinesyntaxhighlight` using `pip install sphinxcontrib-inlinesyntaxhighlight`.
2040
- Install `ompython`. See [OpenModelica OMPython instructions](https://github.com/OpenModelica/OMPython#installation) on how to install OMPython.
21-
- Install `pandoc` and make sure its in PATH.
22-
- Install `gnuplot` and make sure its in PATH.
23-
- Install `inkscape` and make sure its in PATH.
41+
- Install `pandoc` and make sure it's in PATH.
42+
- Install `gnuplot` and make sure it's in PATH.
43+
- Install `inkscape` and make sure it's in PATH.
2444

2545
## Build instructions
2646
```bash

doc/UsersGuide/source/.gitignore

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,77 @@
1+
__pycache__/
2+
*.pyc
3+
api
4+
bouncingball_fmu.pdf
5+
bouncingball_fmu.png
6+
bouncingball_fmu.svg
7+
dcmotor.*
8+
externallibraries.pdf
9+
externallibraries.png
10+
externallibraries.svg
11+
githubreleases.md
12+
githubreleases.rst
13+
githubreleases.tmp.rst
14+
helloworld-detailed.pdf
15+
helloworld-detailed.png
16+
helloworld-detailed.svg
17+
helloworld-euler.pdf
18+
helloworld-euler.png
19+
helloworld-euler.svg
20+
helloworld.pdf
21+
helloworld.png
22+
helloworld.svg
23+
images
24+
interface.inc
25+
logo.pdf
26+
LotkaVolterra*.*
27+
media/mathematica-notebooks.pdf
28+
media/mdt-build-prompt.pdf
29+
media/mdt-create-project.pdf
30+
media/omedit-icons
31+
media/omoptim-icons/
32+
media/systemoverview.pdf
133
Modelica.Mechanics.*
34+
nmpc-input.pdf
35+
nmpc-input.png
36+
nmpc-input.svg
37+
nmpc-states.pdf
38+
nmpc-states.png
39+
nmpc-states.svg
40+
omchelptext.rst
241
OMCScripting.inc
42+
omnotebook-closed-loop.pdf
43+
omnotebook-closed-loop.png
44+
omnotebook-closed-loop.svg
45+
omnotebook-drcontrol-imgposroots.pdf
46+
omnotebook-drcontrol-imgposroots.png
47+
omnotebook-drcontrol-imgposroots.svg
48+
omnotebook-drcontrol-negroots.pdf
49+
omnotebook-drcontrol-negroots.png
50+
omnotebook-drcontrol-negroots.svg
51+
omnotebook-open-loop.pdf
52+
omnotebook-open-loop.png
53+
omnotebook-open-loop.svg
54+
omreleaselink.inc
55+
omsimulator
56+
omsimulator-help.inc
357
OMSimulatorLib.inc
458
OMSimulatorLua.inc
559
OMSimulatorPython.inc
6-
api
7-
images
8-
omsimulator
60+
openmodelica.bib
61+
ProfilingTest_prof*
962
releaselink.inc
10-
63+
simoptions.inc
64+
switch.pdf
65+
switch.png
66+
switch.svg
67+
testmodel-plotall.pdf
68+
testmodel-plotall.png
69+
testmodel-plotall.svg
70+
testmodel.pdf
71+
testmodel.png
72+
testmodel.svg
73+
tmp.rst
74+
tmp.wiki
75+
VanDerPol.pdf
76+
VanDerPol.png
77+
VanDerPol.svg

doc/UsersGuide/source/githubreleases.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
gh_auth = os.environ["GITHUB_AUTH"]
88
g = Github(gh_auth)
99
om = g.get_repo("OpenModelica/OpenModelica")
10-
fout = open("githubreleases.md","w")
10+
fout = open("githubreleases.md", "w", encoding="utf-8")
1111

1212
for release in om.get_releases():
1313
if release.draft:
@@ -25,8 +25,8 @@
2525
print(release.title)
2626
fout.close()
2727
call(["pandoc", "--wrap=none", "-f", "gfm", "-t", "rst", "--base-header-level=2", "-o", "githubreleases.tmp.rst", "githubreleases.md"])
28-
with open("githubreleases.tmp.rst") as fin:
29-
with open("githubreleases.tmp2.rst", "w") as fout:
28+
with open("githubreleases.tmp.rst", "r", encoding="utf-8") as fin:
29+
with open("githubreleases.tmp2.rst", "w", encoding="utf-8") as fout:
3030
fout.write('''Major OpenModelica Releases
3131
"""""""""""""""""""""""""""
3232
@@ -37,4 +37,4 @@
3737
fout.write(fin.read())
3838
fout.write("\n")
3939
fout.write(".. include :: tracreleases.inc")
40-
os.rename("githubreleases.tmp2.rst", "githubreleases.rst")
40+
os.rename("githubreleases.tmp2.rst", "githubreleases.rst")

0 commit comments

Comments
 (0)