Skip to content

Commit

Permalink
Merge pull request #1 from nymea/restructure
Browse files Browse the repository at this point in the history
Restructure repositiry and adjust paths
  • Loading branch information
t-mon authored Oct 2, 2019
2 parents f82f186 + 6eb9b9c commit fb60f26
Show file tree
Hide file tree
Showing 46 changed files with 111 additions and 24 deletions.
File renamed without changes.
6 changes: 6 additions & 0 deletions docs/index.md → index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ If you want to get information about nymea GPIO library, please visit nymea-gpio

[nymea GPIO](nymea-gpio/index.html)

## libnymea-networkmanager
If you want to get information about libnymea-networkmanager library, please visit libnymea-networkmanager docs.

[nymea GPIO](libnymea-networkmanager/index.html)


## Example

This is an example link for showing the link possibilities
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md → tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ For building the documentation you just need to run `generate-docs.sh`.

## Install build dependencies

apt install qt5-default python3 python3-bs4
apt install qt5-default python3 python3-bs4 markdown
4 changes: 2 additions & 2 deletions doc-tools.py → tools/doc-tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def buildMainDocs():
header = loadFileToSoap(os.path.dirname(os.path.realpath(sys.argv[0])) + '/html-templates/header')
footer = loadFileToSoap(os.path.dirname(os.path.realpath(sys.argv[0])) + '/html-templates/footer')

docsDirectory = os.path.dirname(os.path.realpath(sys.argv[0])) + '/docs/'
docsDirectory = os.path.dirname(os.path.realpath(sys.argv[0])) + '/../'
docFiles = []

for docPage in os.listdir(docsDirectory):
Expand All @@ -110,7 +110,7 @@ def buildMainDocs():
mainContentDiv = BeautifulSoup('<div class="content mainPageContent">%s</div>' % (docSoup.prettify()), 'html.parser')
page = generatePage(mainContentDiv, '/html-templates/header-main')
print(page)
saveXmlToFile(page, os.path.dirname(os.path.realpath(sys.argv[0])) + ('/output/docs/%s.html' % docFileBaseName))
saveXmlToFile(page, os.path.dirname(os.path.realpath(sys.argv[0])) + ('/output/nymea-docs/%s.html' % docFileBaseName))


#--------------------------------------------------------------------------
Expand Down
76 changes: 55 additions & 21 deletions generate-docs → tools/generate-docs
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,31 @@ NYMEA_PLUGINS_BRANCH=master
NYMEA_COAP_BRANCH=master
NYMEA_MQTT_BRANCH=master
NYMEA_GPIO_BRANCH=master
LIBNYMEA_NETWORKMANAGER_BRANCH=master


#------------------------------------------------------------
function usage() {
cat <<EOF
Usage: $(basename $0) [OPTIONS]
This tool generates a common documentation out of different projects:
- nymea: https://github.com/guh/nymea
- nymea-plugins: https://github.com/guh/nymea-plugins
- nymea-mqtt: https://github.com/guh/nymea-mqtt
- nymea-coap: https://github.com/guh/nymea-coap
- nymea-gpio: https://github.com/guh/nymea-gpio
This tool generates a common documentation out of different projects and the overall developer documentation:
- nymea: https://github.com/guh/nymea
- nymea-plugins: https://github.com/guh/nymea-plugins
- nymea-mqtt: https://github.com/guh/nymea-mqtt
- nymea-coap: https://github.com/guh/nymea-coap
- nymea-gpio: https://github.com/guh/nymea-gpio
- libnymea-networkmanager: https://github.com/nymea/libnymea-networkmanager
OPTIONS:
--nymea-branch [branch] The repository branch to use for building nymea documentation. Default is master.
--nymea-plugins-branch [branch] The repository branch to use for building nymea-plugins documentation. Default is master.
--nymea-mqtt-branch [branch] The repository branch to use for building nymea-mqtt documentation. Default is master.
--nymea-coap-branch [branch] The repository branch to use for building nymea-coap documentation. Default is master.
--nymea-gpio-branch [branch] The repository branch to use for building nymea-gpio documentation. Default is master.
-h, --help Show this message
--nymea-branch [branch] The repository branch to use for building nymea documentation. Default is master.
--nymea-plugins-branch [branch] The repository branch to use for building nymea-plugins documentation. Default is master.
--nymea-mqtt-branch [branch] The repository branch to use for building nymea-mqtt documentation. Default is master.
--nymea-coap-branch [branch] The repository branch to use for building nymea-coap documentation. Default is master.
--nymea-gpio-branch [branch] The repository branch to use for building nymea-gpio documentation. Default is master.
--libnymea-networkmanager-branch [branch] The repository branch to use for building nymea-gpio documentation. Default is master.
-h, --help Show this message
EOF
}
Expand All @@ -53,15 +56,11 @@ function printRed() {
#------------------------------------------------------------
function create-main-docs() {
printGreen "Create main docs"
if [ -d ${OUTPUT_DIR}/docs ]; then rm -rf ${OUTPUT_DIR}/docs; fi
mkdir -p ${OUTPUT_DIR}/docs

if [ -d ${OUTPUT_DIR}/nymea-docs ]; then rm -rf ${OUTPUT_DIR}/nymea-docs; fi
mkdir -p ${OUTPUT_DIR}/nymea-docs

printGreen "Create nymea-plugins docs"
${CURRENT_DIR}/doc-tools.py -m -o ${OUTPUT_DIR}/docs



${CURRENT_DIR}/doc-tools.py -m -o ${OUTPUT_DIR}/nymea-docs
}


Expand Down Expand Up @@ -229,8 +228,38 @@ function create-nymea-gpio-docs() {
cp -rv ${TEMPLATE_DIR}/images/ ${OUTPUT_DIR}/nymea-gpio/
cp -rv ${TEMPLATE_DIR}/scripts ${OUTPUT_DIR}/nymea-gpio/
cp -rv ${TEMPLATE_DIR}/styles ${OUTPUT_DIR}/nymea-gpio/
}

#------------------------------------------------------------
function create-libnymea-networkmanager-docs() {
printGreen "Clean libnymea-networkmanager source"
if [ -d ${SOURCE_DIR}/libnymea-networkmanager ]; then rm -rf ${SOURCE_DIR}/libnymea-networkmanager; fi
if [ -d ${OUTPUT_DIR}/libnymea-networkmanager ]; then rm -rf ${OUTPUT_DIR}/libnymea-networkmanager; fi
if [ -d ${OUTPUT_DIR}/libnymea-networkmanager-raw ]; then rm -rf ${OUTPUT_DIR}/libnymea-networkmanager-raw; fi
mkdir -p ${SOURCE_DIR}
mkdir -p ${OUTPUT_DIR}/libnymea-networkmanager

printGreen "Get libnymea-networkmanager source from branch ${LIBNYMEA_NETWORKMANAGER_BRANCH}"
cd ${SOURCE_DIR}
git clone -b ${LIBNYMEA_NETWORKMANAGER_BRANCH} --depth 1 https://github.com/nymea/libnymea-networkmanager.git

printGreen "Create libnymea-networkmanager docs"
cd ${CONFIG_DIR}/libnymea-networkmanager
qdoc config.qdocconf

printGreen "Migrate html files"
for htmlFile in "${OUTPUT_DIR}/libnymea-networkmanager-raw/"*.html; do
printGreen "--> $htmlFile"
htmlFileName=`basename $htmlFile`
${CURRENT_DIR}/doc-tools.py -i ${htmlFile} -o ${OUTPUT_DIR}/libnymea-networkmanager/${htmlFileName} -q -g /html-templates/header-networkmanager.html
done

printGreen "Copy common data"
cp -rv ${TEMPLATE_DIR}/favicons/ ${OUTPUT_DIR}/libnymea-networkmanager/
cp -rv ${TEMPLATE_DIR}/images/ ${OUTPUT_DIR}/libnymea-networkmanager/
cp -rv ${TEMPLATE_DIR}/scripts ${OUTPUT_DIR}/libnymea-networkmanager/
cp -rv ${TEMPLATE_DIR}/styles ${OUTPUT_DIR}/libnymea-networkmanager/

printGreen "Copy nymea-gpio images"
}


Expand All @@ -255,6 +284,9 @@ while [ "$1" != "" ]; do
--nymea-gpio-branch )
NYMEA_GPIO_BRANCH=$2
shift;;
--libnymea-networkmanager-branch )
LIBNYMEA_NETWORKMANAGER_BRANCH=$2
shift;;
-h | --help )
usage && exit 0;;
* )
Expand All @@ -269,11 +301,12 @@ create-nymea-plugins-docs
create-nymea-coap-docs
create-nymea-mqtt-docs
create-nymea-gpio-docs
create-libnymea-networkmanager-docs

printGreen "Build html directory ${HTML_DIR}"
if [ -d ${HTML_DIR} ]; then rm -rf ${HTML_DIR}; fi
mkdir -p ${HTML_DIR} || true
cp ${OUTPUT_DIR}/docs/*.html ${HTML_DIR}
cp ${OUTPUT_DIR}/nymea-docs/*.html ${HTML_DIR}

cp -r ${TEMPLATE_DIR}/scripts ${HTML_DIR}
cp -r ${TEMPLATE_DIR}/styles ${HTML_DIR}
Expand All @@ -285,3 +318,4 @@ cp -r ${OUTPUT_DIR}/nymea-plugins ${HTML_DIR}
cp -r ${OUTPUT_DIR}/nymea-coap ${HTML_DIR}
cp -r ${OUTPUT_DIR}/nymea-mqtt ${HTML_DIR}
cp -r ${OUTPUT_DIR}/nymea-gpio ${HTML_DIR}
cp -r ${OUTPUT_DIR}/libnymea-networkmanager ${HTML_DIR}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions tools/html-templates/header-networkmanager.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="header-plugins">
<a href="../index.html"> <img src="images/main-logo.svg" class="nymea-main-logo-mainpage"/></a>
<div class="plugins-title">
<h1>libnymea-networkmanager</h1>
</div>
<div class=plugins-themeswitch>
<label class="switch">
<input id="themeSwitch" onclick="onSwitchChanged(this)" type="checkbox"/>
<span class="slider round"></span>
</label>
</div>
</div>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions tools/qdoc-configs/libnymea-networkmanager/config.qdocconf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
include(../common/html-template.qdocconf)

project = libnymea-networkmanager
description = libnymea-networkmanager documentation

dita.metadata.default.author = Simon Stürz
dita.metadata.default.permissions = all
dita.metadata.default.publisher = guh GmbH
dita.metadata.default.copyryear = 2019
dita.metadata.default.copyrholder = Simon Stürz
dita.metadata.default.audience = programmer

outputdir = ../../output/libnymea-networkmanager-raw
outputformats = HTML

language = Cpp

naturallanguage = en_US
outputencoding = UTF-8
sourceencoding = UTF-8

syntaxhighlighting = true

headerdirs = ../../source/libnymea-networkmanager/libnymea-networkmanager/
sourcedirs = ../../source/libnymea-networkmanager/libnymea-networkmanager/ \
../../source/libnymea-networkmanager/docs/

headers.fileextensions = "*.h"
sources.fileextensions = "*.cpp *.qdoc"

Cpp.ignoredirectives = Q_DECLARE_METATYPE \
Q_LOGGING_CATEGORY \
Q_DECLARE_LOGGING_CATEGORY \
Q_ENUM \

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit fb60f26

Please sign in to comment.