Kaynağa Gözat

add documentation on doc generation; clean up push_doc script

Julius Pfrommer 8 yıl önce
ebeveyn
işleme
c42a2f167e
2 değiştirilmiş dosya ile 20 ekleme ve 14 silme
  1. 9 0
      tools/c2rst.py
  2. 11 14
      tools/travis_push_doc.sh

+ 9 - 0
tools/c2rst.py

@@ -3,6 +3,15 @@ import os
 import binascii
 import re
 
+# Converts a header file to restructured text documentation
+#
+# All text in /** */ comments becomes restructured text. Everything else is
+# included as a code-block with C syntax highlighting.
+#
+# The beginning and end of the header are removed.
+# - Find the first /** */ comment -> start of the documentation
+# - Find the last line beginning with "#ifdef" -> end of the documentation
+
 remove_keyword = [" UA_EXPORT", " UA_FUNC_ATTR_WARN_UNUSED_RESULT",
                   " UA_FUNC_ATTR_MALLOC"]
 

+ 11 - 14
tools/travis_push_doc.sh

@@ -1,17 +1,14 @@
 #!/bin/bash
 
-BRANCH="$(git rev-parse --abbrev-ref HEAD)"
-if [ "$BRANCH" == "master" ]; then
-    git clone --depth=5 -b gh-pages https://$GITAUTH@github.com/open62541/open62541-www
-    cd open62541-www
+git clone --depth=5 -b gh-pages https://$GITAUTH@github.com/open62541/open62541-www
+cd open62541-www
 
-    git rm -r -f ./doc/current/*
-    cp -r ../../doc_html/* ./doc/current/
-    git add -A ./doc/current
-    git config --global user.email "open62541-travis-ci@users.noreply.github.com"
-    git config --global user.name "Open62541 travis-ci"
-    git config --global push.default simple
-    git commit -am "updated generated documentation on webpage by travis-ci [ci skip]"
-    git push https://$GITAUTH@github.com/open62541/open62541-www
-    cd .. && rm -rf open62541-www
-fi
+git rm -r -f ./doc/current/*
+cp -r ../../doc_html/* ./doc/current/
+git add -A ./doc/current
+git config --global user.email "open62541-travis-ci@users.noreply.github.com"
+git config --global user.name "Open62541 travis-ci"
+git config --global push.default simple
+git commit -am "updated generated documentation on webpage by travis-ci [ci skip]"
+git push https://$GITAUTH@github.com/open62541/open62541-www
+cd .. && rm -rf open62541-www