mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-10-02 12:23:17 +08:00
[doc] Add doxygen action, and fix python doc generators. (#2818)
This commit is contained in:
@@ -0,0 +1,64 @@
|
|||||||
|
name: Doxygen
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master, v5.14, v5.16, v5.18, v6.1 ]
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
path: ./paparazzi
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: 'paparazzi/paparazzi.github.com'
|
||||||
|
path: ./site
|
||||||
|
token: ${{ secrets.PUSH_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set env
|
||||||
|
run: |
|
||||||
|
BRANCH_NAME=${GITHUB_REF_NAME/master/latest}
|
||||||
|
echo "build doc for $BRANCH_NAME..."
|
||||||
|
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y doxygen graphviz doxygen-latex
|
||||||
|
|
||||||
|
- name: Generate doc for modules and messages from XML files
|
||||||
|
run: |
|
||||||
|
export PAPARAZZI_HOME=$(realpath -e paparazzi)
|
||||||
|
export PAPARAZZI_SRC=$(realpath -e paparazzi)
|
||||||
|
./paparazzi/sw/tools/doxygen_gen/gen_modules_doc.py -pv
|
||||||
|
./paparazzi/sw/tools/doxygen_gen/gen_messages_doc.py -pv
|
||||||
|
|
||||||
|
- name: prepare doxygen conf
|
||||||
|
run: |
|
||||||
|
echo "OUTPUT_DIRECTORY=$(realpath output)" >> paparazzi/Doxyfile
|
||||||
|
echo "HTML_OUTPUT=./" >> paparazzi/Doxyfile
|
||||||
|
echo "PROJECT_NUMBER=$(./paparazzi/paparazzi_version)" >> paparazzi/Doxyfile
|
||||||
|
echo "QUIET=YES" >> paparazzi/Doxyfile
|
||||||
|
|
||||||
|
- name: build doxygen
|
||||||
|
run: cd paparazzi && doxygen
|
||||||
|
|
||||||
|
- name: copy and commit changes
|
||||||
|
run: |
|
||||||
|
rm -rf site/$BRANCH_NAME
|
||||||
|
cp -r output site/$BRANCH_NAME
|
||||||
|
cd site
|
||||||
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git config --local user.name "github-actions[bot]"
|
||||||
|
git add -A
|
||||||
|
git commit -m "Generated doxygen docs for $BRANCH_NAME."
|
||||||
|
git push https://$USERNAME:$REPO_KEY@github.com/paparazzi/paparazzi.github.com.git
|
||||||
|
env:
|
||||||
|
REPO_KEY: ${{secrets.PUSH_TOKEN}}
|
||||||
|
USERNAME: github-actions[bot]
|
||||||
|
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ def print_field(field):
|
|||||||
# if values are given, put those in the unit column
|
# if values are given, put those in the unit column
|
||||||
if not unit:
|
if not unit:
|
||||||
values = field.get('values', '')
|
values = field.get('values', '')
|
||||||
unit = string.replace(values, '|', ', ')
|
unit = values.replace('|', ', ')
|
||||||
return u"{name} | {type} | {unit} | {desc} |\n".format(name=name, type=type, desc=desc, unit=unit)
|
return u"{name} | {type} | {unit} | {desc} |\n".format(name=name, type=type, desc=desc, unit=unit)
|
||||||
|
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ if __name__ == '__main__':
|
|||||||
messages = read_messages_file(messages_file)
|
messages = read_messages_file(messages_file)
|
||||||
|
|
||||||
# generate string containing markdown page
|
# generate string containing markdown page
|
||||||
outstring = messages_page(messages).encode('utf-8')
|
outstring = messages_page(messages)
|
||||||
|
|
||||||
#print(outstring)
|
#print(outstring)
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ def get_xml_example(filename, module):
|
|||||||
e = copy.deepcopy(o)
|
e = copy.deepcopy(o)
|
||||||
if 'description' in e.attrib:
|
if 'description' in e.attrib:
|
||||||
del e.attrib['description']
|
del e.attrib['description']
|
||||||
s += " " + string.strip(ET.tostring(e)) + "\n"
|
s += " " + str(ET.tostring(e)).strip() + "\n"
|
||||||
s += "</module>\n"
|
s += "</module>\n"
|
||||||
else:
|
else:
|
||||||
s += '<module name="{0}"/>\n'.format(module_name)
|
s += '<module name="{0}"/>\n'.format(module_name)
|
||||||
|
|||||||
Reference in New Issue
Block a user