README.md 2.96 KB
Newer Older
yozgatsi's avatar
yozgatsi committed
1

tavit ohanian's avatar
tavit ohanian committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# DMS3 Draft documentation

To add support diagrams in markdown documents, add Atom packages: "Markdown Preview Enhanced".

Use mkdocs to generate documentation site using markdown.

mkdocs setup:

References:
- https://www.mkdocs.org/
- https://www.mkdocs.org/user-guide/configuration/
- https://github.com/mkdocs/mkdocs/
- https://github.com/shd101wyy/markdown-preview-enhanced/blob/master/docs/diagrams.md

Use mkdocs pymdown-extensions with superfences and custom fences to support diagrams in mkdocs:
- https://facelessuser.github.io/pymdown-extensions/
- https://facelessuser.github.io/pymdown-extensions/extensions/superfences/
- https://mermaidjs.github.io/#/
- https://github.com/squidfunk/mkdocs-material/issues/693
- https://cdnjs.com/
- https://github.com/mermaid-https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-programming-environment-on-debian-10js/mermaid/
yozgatsi's avatar
yozgatsi committed
23

tavit ohanian's avatar
tavit ohanian committed
24
```bash
yozgatsi's avatar
yozgatsi committed
25
mkdir -p ~/Work/dapp/dms3
tavit ohanian's avatar
tavit ohanian committed
26
mkdir -p ~/Work/dapp/dms3/dms3-docs
yozgatsi's avatar
yozgatsi committed
27
cd ~/Work/dapp/dms3
tavit ohanian's avatar
tavit ohanian committed
28
```
yozgatsi's avatar
yozgatsi committed
29

tavit ohanian's avatar
tavit ohanian committed
30 31 32 33 34
Initial install was via cloning the repo as below.

Use clone of repo mermaid - cdnjs version has bad css that when a style is added to flowchart svg, the page is disabled. To build mermaid locally after cloning repo:

```bash
yozgatsi's avatar
yozgatsi committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
git clone https://github.com/mermaid-js/mermaid.git
cd mermaid/
nvm list
nvm use stable
npm install webpack
npm install yarn
npm run build
npm run release
ls -alg dist/
cp -v dist/mermaid.min.js* ../mkdocs-docs/docs/js/
cp -v dist/mermaid.js* ../mkdocs-docs/docs/js/

cd ../
python --version
pip --version
tavit ohanian's avatar
tavit ohanian committed
50 51 52 53
#sudo apt-get install python-pip
#
#wget https://bootstrap.pypa.io/get-pip.py
#sudo python get-pip.py
tavit ohanian's avatar
tavit ohanian committed
54 55 56 57 58 59 60
```

Later install followed this instead to setup a virtual python environment
- https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-
set-up-a-programming-environment-on-debian-10

```bash
tavit ohanian's avatar
tavit ohanian committed
61 62 63 64 65 66 67 68 69 70 71 72 73 74
sudo apt update
sudo apt -y upgrade
python3 -V
sudo apt install -y python3-pip
sudo apt install build-essential libssl-dev libffi-dev python3-dev
sudo apt install -y python3-venv
mkdir python_env
cd python_env
python3.7 -m venv mkdocs_env
ls mkdocs_env
source mkdocs_env/bin/activate
nano hello.py
  print("Hello, World!")
python hello.py
yozgatsi's avatar
yozgatsi committed
75

tavit ohanian's avatar
tavit ohanian committed
76
pip install mkdocs
yozgatsi's avatar
yozgatsi committed
77 78 79 80
mkdocs --version
mkdocs new mkdocs-docs
cd mkdocs-docs
mkdocs serve
tavit ohanian's avatar
tavit ohanian committed
81 82 83 84 85
pip install pymdown-extensions
pip install mkdocs-rtd-dropdown

mkdocs build
mkdocs serve
tavit ohanian's avatar
tavit ohanian committed
86 87 88 89 90
```
To support math rendering:
- https://stackoverflow.com/questions/27882261/mkdocs-and-mathjax/31926644
- https://squidfunk.github.io/mkdocs-material/extensions/pymdown/
- https://facelessuser.github.io/pymdown-extensions/extensions/arithmatex/
yozgatsi's avatar
yozgatsi committed
91

tavit ohanian's avatar
tavit ohanian committed
92 93 94
- roboto-slab fonts were downloaded from:
- Free download fonts at http://sharefonts.net
- unzip and move missing fonts into mkdocs-docs/docs/fonts/
yozgatsi's avatar
yozgatsi committed
95

tavit ohanian's avatar
tavit ohanian committed
96
## Usage
yozgatsi's avatar
yozgatsi committed
97

tavit ohanian's avatar
tavit ohanian committed
98
```bash
yozgatsi's avatar
yozgatsi committed
99 100 101 102 103 104 105 106
cd ~/Work/dapp/dms3-docs

# build
mkdocs build

# local live reload server
mkdocs serve # defaults to 127.0.0.1:8000
mkdocs serve --dev-addr=192.168.0.7:8000
tavit ohanian's avatar
tavit ohanian committed
107 108

# deploy
tavit ohanian's avatar
tavit ohanian committed
109
rsync -rv site/* gitlab.dms3.io:~/dms3-docs/site/
tavit ohanian's avatar
tavit ohanian committed
110
/sbin/apache2ctl restart
tavit ohanian's avatar
tavit ohanian committed
111
```