Skip to content

Commit f17a47e

Browse files
committed
update script and conf.py
1 parent 64c1cdb commit f17a47e

2 files changed

Lines changed: 18 additions & 80 deletions

File tree

docs/api_doc_script.sh

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/bash
22

33
doxygen_build()
44
{
55
VTAG=$1
66
echo $VTAG
7-
git checkout $VTAG
7+
git checkout $VTAG || {
8+
echo "Failed to checkout tag $VTAG";
9+
exit 1;
10+
}
811
doxygen docs.doxygen > /dev/null 2>&1
912
if [ "$VTAG" = master ]; then
1013
mkdir -p docs/api_docs/versions
@@ -13,30 +16,36 @@ doxygen_build()
1316
mv docs/html docs/api_docs/versions/$VTAG
1417
}
1518

19+
# get current branch
1620
branch=$(git rev-parse --abbrev-ref HEAD)
17-
echo "$branch"
1821

19-
rm -r api_docs/versions
2022
mkdir build
2123
cd ../
24+
25+
# Build latest version
2226
doxygen_build master
23-
crit_ver=0.9.5
27+
28+
smallest_ver=0.7.3
29+
# Get all version latest than smallest_ver
2430
versions=($(git tag \
2531
| sed 's/^v//' \
2632
| sed 's/[A-Za-z].*$//' \
2733
| sort -V \
28-
| awk -F. -v cv="$crit_ver" '
34+
| awk -F. -v cv="$smallest_ver" '
2935
BEGIN { split(cv,c,"."); min=c[1]*10000+c[2]*100+c[3] }
3036
{ val=$1*10000+$2*100+$3; if(val>=min) print }
3137
'))
3238

39+
# Build older version latest from smallest_ver
3340
for i in "${!versions[@]}"; do
3441
ver="v${versions[i]}"
3542
doxygen_build $ver
3643
done
3744

45+
# checkout original version
3846
git checkout $branch
3947

48+
# Create index.rst
4049
cd ./docs/api_docs/home_source
4150
cat > index.rst <<'EOF'
4251
.. image:: Icon_small.png
@@ -56,8 +65,11 @@ for ((i=${#versions[@]}-1; i>=0; i--)); do
5665
ver="v${versions[i]}"
5766
echo ' * `'$ver' <versions/'$ver'/index.html>`__.' >> index.rst
5867
done
68+
69+
# build API documentation index.
5970
cd ../
6071
make html
6172

73+
# move the api_build under build
6274
mv versions ./build_home/html/
6375
mv build_home ../build/api_build

docs/source/conf.py

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
project = 'Cytnx'
3030
copyright = '2019-, Kai-Hsin Wu'
3131
author = 'Kai-Hsin Wu'
32-
#_version = 'v0.9.7'
33-
#version = 'v0.5.5a'
3432

3533
# -- General configuration ---------------------------------------------------
3634

@@ -92,75 +90,3 @@
9290
# so a file named "default.css" will overwrite the builtin "default.css".
9391
html_static_path = ['_static']
9492

95-
96-
97-
html_theme_options = {
98-
# Navbar style.
99-
# Values: 'fixed-top', 'full' (Default: 'fixed-top')
100-
'navbar_style' : 'fixed-top',
101-
102-
# Navbar link color modifier class.
103-
# Values: 'dark', 'light' (Default: 'dark')
104-
'navbar_color_class' : 'dark',
105-
106-
# Navbar background color class.
107-
# Values: 'inverse', 'primary', 'faded', 'success',
108-
# 'info', 'warning', 'danger' (Default: 'inverse')
109-
#'navbar_bg_class' : 'inverse',
110-
111-
# Show global TOC in navbar.
112-
# To display up to 4 tier in the drop-down menu.
113-
# Values: True, False (Default: True)
114-
'navbar_show_pages' : True,
115-
116-
# Link name for global TOC in navbar.
117-
# (Default: 'Pages')
118-
'navbar_pages_title' : 'Pages',
119-
120-
# Specify a list of menu in navbar.
121-
# Tuples forms:
122-
# ('Name', 'external url or path of pages in the document', boolean)
123-
# Third argument:
124-
# True indicates an external link.
125-
# False indicates path of pages in the document.
126-
'navbar_links' : [
127-
('API Doc', 'https://kaihsinwu.gitlab.io/cytnx_api', True),
128-
("Github", "https://github.com/Cytnx-dev/Cytnx", True),
129-
],
130-
131-
# Total width(%) of the document and the sidebar.
132-
# (Default: 80%)
133-
'main_width' : '80%',
134-
135-
# Render sidebar.
136-
# Values: True, False (Default: True)
137-
'show_sidebar' : True,
138-
139-
# Render sidebar in the right of the document.
140-
# Values:True, False (Default: False)
141-
'sidebar_right': False,
142-
143-
# Fix sidebar.
144-
# Values: True, False (Default: True)
145-
'sidebar_fixed': False,
146-
147-
# Html table header class.
148-
# Values: 'inverse', 'light' (Deafult: 'inverse')
149-
'table_thead_class' : 'inverse',
150-
151-
}
152-
"""
153-
# -- Breathe configuration -------------------------------------------------
154-
155-
breathe_projects = {
156-
"Cyc": "/home/kaihsinwu/Dropbox/Cytnx/docs/xml/"
157-
}
158-
159-
breathe_default_project = "Cyc"
160-
breathe_default_members = ('members', 'undoc-members')
161-
#breathe_default_members = ('members')
162-
"""
163-
## ablog
164-
#import ablog
165-
#templates_path.append(ablog.get_html_templates_path())
166-
#disqus_shortname='kaihsinwu'

0 commit comments

Comments
 (0)