Skip to content

Commit 636fc00

Browse files
committed
ci: add auto doc generation with html_of_wiki
1 parent e5306b7 commit 636fc00

File tree

3 files changed

+135
-0
lines changed

3 files changed

+135
-0
lines changed

.howdocgen

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
set -x
3+
4+
wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/master/.travis-ocaml.sh
5+
export OCAML_VERSION=4.06
6+
bash -ex .travis-ocaml.sh
7+
8+
eval $(opam env)
9+
10+
git clone https://github.com/ocsigen/html_of_wiki.git
11+
opam pin add -y html_of_wiki html_of_wiki
12+
13+
# wget https://raw.githubusercontent.com/ocsigen/ocsigen.github.io/master/template.wiki
14+
# TODO when every project's CI will run HOW for its docs, uncomment the line above,
15+
# remove the 5 following lines and `git rm' the file doc/template.wiki.
16+
wget https://raw.githubusercontent.com/ocsigen/ocsigen.github.io/e6b93e987b75be99e8ef30601460f60028c615fd/css/style.css
17+
wget https://raw.githubusercontent.com/ocsigen/ocsigen.github.io/e6b93e987b75be99e8ef30601460f60028c615fd/img/search.svg
18+
mkdir tmp
19+
mv style.css tmp
20+
mv search.svg tmp
21+
22+
f=$(mktemp)
23+
cat >$f <<EOF
24+
{
25+
"project": "ocsigen-toolkit",
26+
"api": "api",
27+
"menu": true,
28+
"csw": true,
29+
"templates": ["doc/template.wiki"],
30+
"manual": "manual"
31+
}
32+
EOF
33+
quickdop -f doc _doc -t json -c $f -viu
34+
35+
# TODO Also remove that line.
36+
mv tmp _doc

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: c
2+
3+
install:
4+
- true
5+
6+
script:
7+
- ./.howdocgen
8+
9+
deploy:
10+
provider: pages
11+
keep-history: true
12+
skip-cleanup: true
13+
github-token: $GHP_TOKEN
14+
local-dir: _doc
15+
on:
16+
branch: master

doc/template.wiki

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<<head-css href="https://ocsigen.org/ocsigen-toolkit/tmp/style.css">>
2+
<<head-css href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.9.0/themes/prism.min.css">>
3+
<<head-script src="https://ocsigen.org/js/client.js">>
4+
<<head-script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.9.0/components/prism-core.min.js">>
5+
<<head-script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.9.0/components/prism-ocaml.min.js">>
6+
<<head-script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.9.0/components/prism-clike.min.js">>
7+
<<head-script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.9.0/components/prism-reason.min.js">>
8+
<<head-script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.9.0/components/prism-javascript.min.js">>
9+
10+
<<div class="project-page"|
11+
<<div class="page-header"|
12+
13+
@@class="logo-ocsigen"@@[[site:/|{{site:/img/ocsigen-white.svg|Ocsigen}}]]
14+
15+
<<when-project when="eliom" | @@class="logo-subproject"@@Eliom>>
16+
<<when-project when="js_of_ocaml" | @@class="logo-subproject"@@Js_of_ocaml>>
17+
<<when-project when="ocsigenserver" | @@class="logo-subproject"@@Server>>
18+
<<when-project when="lwt" | @@class="logo-subproject"@@Lwt>>
19+
<<when-project when="tyxml" | @@class="logo-subproject"@@Tyxml>>
20+
<<when-project when="ocsigen-toolkit"| @@class="logo-subproject"@@Toolkit>>
21+
<<when-project when="ocsigen-start" | @@class="logo-subproject"@@Start>>
22+
<<when-project when="ocsimore" | @@class="logo-subproject"@@Ocsimore>>
23+
24+
<<div class="mainmenu"|
25+
<<span class="mainmenu-home"|[[site:/|Home]]>>
26+
<<span class="mainmenu-doc" |[[wiki("tuto"):|Doc]]>>
27+
<<when-project when="eliom" | @@class="mainmenu-current"@@[[wiki("eliom"):|Eliom]]>>
28+
<<when-project unless="eliom" | [[wiki("eliom"):|Eliom]]>>
29+
<<when-project when="js_of_ocaml" | @@class="mainmenu-current"@@[[wiki("js_of_ocaml"):|Js_of_ocaml]]>>
30+
<<when-project unless="js_of_ocaml" | [[wiki("js_of_ocaml"):|Js_of_ocaml]]>>
31+
<<when-project when="lwt" | @@class="mainmenu-current"@@[[wiki("lwt"):|Lwt]]>>
32+
<<when-project unless="lwt" | [[wiki("lwt"):|Lwt]]>>
33+
<<when-project when="tyxml" | @@class="mainmenu-current"@@[[wiki("tyxml"):|Tyxml]]>>
34+
<<when-project unless="tyxml" | [[wiki("tyxml"):|Tyxml]]>>
35+
<<when-project when="ocsigen-start"| @@class="mainmenu-current"@@[[wiki("ocsigen-start"):|Start]]>>
36+
<<when-project unless="ocsigen-start"| [[wiki("ocsigen-start"):|Start]]>>
37+
>>
38+
39+
<<when-local |<<googlesearch icon="https://ocsigen.org/img/search.svg" domain="ocsigen.org">>>>
40+
<<unless-local|<<googlesearch icon="https://ocsigen.org/ocsigen-toolkit/tmp/search.svg" domain="ocsigen.org">>>>
41+
42+
<<drawer|
43+
*@@class="drawermainmenu"@class="drawermainmenu-home"@@[[site:/|Home]]
44+
*@@class="drawermainmenu-doc"@@[[wiki("tuto"):|Doc]]
45+
*@@class="drawermainmenu-project"@@[[wiki("eliom"):|Eliom]]
46+
*@@class="drawermainmenu-project"@@[[wiki("js_of_ocaml"):|Js_of_ocaml]]
47+
*@@class="drawermainmenu-project"@@[[wiki("ocsigenserver"):|Server]]
48+
*@@class="drawermainmenu-project"@@[[wiki("lwt"):|Lwt]]
49+
*@@class="drawermainmenu-project"@@[[wiki("tyxml"):|Tyxml]]
50+
*@@class="drawermainmenu-project"@@[[wiki("ocsigen-toolkit"):|Toolkit]]
51+
*@@class="drawermainmenu-project"@@[[wiki("ocsigen-start"):|Start]]
52+
*@@class="drawermainmenu-project"@@[[wiki("ocsimore"):|Ocsimore (//deprecated//)]]
53+
*@@class="drawermainmenu-page"@@[[site:/projects|Other projects]]
54+
*@@class="drawermainmenu-page"@@[[site:/papers|Research papers]]
55+
*@@class="drawermainmenu-page"@@[[site:/credits|Who does Ocsigen?]]
56+
*@@class="drawermainmenu-page"@@[[site:/blog|Blog]]
57+
*@@class="drawermainmenu-page"@@[[https://github.com/ocsigen|Source code]]
58+
59+
<<doctree>>
60+
61+
62+
>> <<|drawer>>
63+
64+
>> <<|page-header>>
65+
66+
@@class="reasonwarning"@@Warning: Reason support is experimental.
67+
We are looking for beta-tester and contributors.
68+
69+
<<reason-switch>>
70+
71+
<<div class="twocols" |
72+
<<nav class="leftcol" |
73+
<<docversion>>
74+
75+
<<doctree>>
76+
>> <<|leftcol>>
77+
78+
<<article class="rightcol" |
79+
<<client-server-switch|>>
80+
<<content>>
81+
>> <<|rightcol>>
82+
>> <<|twocols>>
83+
>> <<|project-page>>

0 commit comments

Comments
 (0)