Skip to content
Snippets Groups Projects
Commit 185c1626 authored by Abdussalam SALEH MGHIR's avatar Abdussalam SALEH MGHIR
Browse files

ENH : Update creation of the wiki

parent 99f477a2
No related branches found
No related tags found
2 merge requests!52Merge for v1.1.0,!44Simplify and Boost generation of the wiki
......@@ -9,3 +9,4 @@
*.pyc
.\#*
\#*\#
/doc_cookbook/rst_tmp/*
......@@ -22,10 +22,16 @@ cd <diapotb_root_path>/doc_cookbook
```
<diapotb_root_path> : root path of the repository diapotb
- The temporary repertory used to store all the source files is created:
```shell
mkdir -p rst_tmp
cp -R rst/* rst_tmp
```
- Then, the rst files are generated:
```shell
python otbGenerateWrappersRstDoc.py rst
python otbGenerateWrappersRstDoc.py rst_tmp
```
3. The new wiki is generated:
......
#!/bin/bash
# Output Path where the wiki for the diapotb will be generated
wiki_output_path=$1
#check number of arguments
if [[ $# -ne 1 ]]
then
echo "Illegal number of parameters" >&2
exit 2
fi
# Path directory of the current script
path_dir=$(dirname $0)
# Creation if non existant of the repository used to generate the wiki
mkdir -p rst_tmp
mkdir -p $path_dir/rst_tmp
# Copy of the C++ source files and the static files to the temporary repository from which will be generated the wiki
cp -R rst/* rst_tmp
cp -R $path_dir/rst/* $path_dir/rst_tmp
# Generate the source files for the python scripts of the processing chains
sphinx-apidoc -f -o ./rst_API_Python/ ../python_src/
sphinx-apidoc -f -o $path_dir/rst_API_Python/ $path_dir/../python_src/
# Copy of the interesting source files to rst_tmp
# Deletion of some lines uninteresting inside utils.rst
line_submodule_utils_start=$(grep -wn 'Submodules' ./rst_API_Python/utils.rst | cut -d: -f1)
line_submodule_utils_start=$(grep -wn 'Submodules' $path_dir/rst_API_Python/utils.rst | cut -d: -f1)
line_submodule_utils_end=$(($line_submodule_utils_start + 1))
line_modcont_utils_start=$(grep -wn 'Module contents' ./rst_API_Python/utils.rst | cut -d: -f1)
line_modcont_utils_start=$(grep -wn 'Module contents' $path_dir/rst_API_Python/utils.rst | cut -d: -f1)
line_modcont_utils_end=$(($line_modcont_utils_start + 6))
# Copy of the modified utils.rst to rst_tmp
sed "${line_submodule_utils_start},${line_submodule_utils_end}d;${line_modcont_utils_start},${line_modcont_utils_end}d" rst_API_Python/utils.rst > rst_tmp/PythonAPI/utils.rst
sed "${line_submodule_utils_start},${line_submodule_utils_end}d;${line_modcont_utils_start},${line_modcont_utils_end}d" $path_dir/rst_API_Python/utils.rst > $path_dir/rst_tmp/PythonAPI/utils.rst
# Deletion of some lines uninteresting inside processings.rst
line_submodule_processing_start=$(grep -wn 'Submodules' ./rst_API_Python/processings.rst | cut -d: -f1)
line_submodule_processing_start=$(grep -wn 'Submodules' $path_dir/rst_API_Python/processings.rst | cut -d: -f1)
line_submodule_processing_end=$(($line_submodule_processing_start + 1))
line_modcont_processing_start=$(grep -wn 'Module contents' ./rst_API_Python/processings.rst | cut -d: -f1)
line_modcont_processing_start=$(grep -wn 'Module contents' $path_dir/rst_API_Python/processings.rst | cut -d: -f1)
line_modcont_processing_end=$(($line_modcont_processing_start + 6))
# Copy of the modified processings.rst to rst_tmp
sed "${line_submodule_processing_start},${line_submodule_processing_end}d;${line_modcont_processing_start},${line_modcont_processing_end}d" rst_API_Python/processings.rst > rst_tmp/PythonAPI/processings.rst
sed "${line_submodule_processing_start},${line_submodule_processing_end}d;${line_modcont_processing_start},${line_modcont_processing_end}d" $path_dir/rst_API_Python/processings.rst > $path_dir/rst_tmp/PythonAPI/processings.rst
# Generate the wiki repository from the source repository
sphinx-build -M markdown ./rst_tmp/ $wiki_output_path/diapotb_wiki/ -c .
#sphinx-build -b html ./rst_tmp/ $wiki_output_path/diapotb_wiki_html/ -c .
rm -r rst_tmp
sphinx-build -M markdown $path_dir/rst_tmp/ $wiki_output_path/diapotb_wiki/ -c $path_dir
#sphinx-build -b html $path_dir/rst_tmp/ $wiki_output_path/diapotb_wiki_html/ -c $path_dir
if [[ -d "${path_dir}/rst_tmp" ]]
then
rm -r $path_dir/rst_tmp
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment