From: CorentinLGS Date: Fri, 31 Aug 2018 07:39:04 +0000 (+0200) Subject: app-framework-binder doc: Changed doc to fit new format. X-Git-Tag: 5.99.5^0 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fapp-framework-binder.git;a=commitdiff_plain;h=408acbdce381f1e70985eae9f96d036689f3d0aa app-framework-binder doc: Changed doc to fit new format. -Split book.json in 2. -Deleted unwanted files. -Changed all links to .html files to .md files in the SUMMARY.md, it is used by gitbook to build the pdf and as gitbook doesn't handle .html files I had to change it. Change-Id: I15705ef0f0d9143971c046ccb72a4eee04b98890 Signed-off-by: CorentinLGS --- diff --git a/book.json b/book.json index e7127c49..e65dd835 100644 --- a/book.json +++ b/book.json @@ -7,88 +7,5 @@ "website": "http://iot.bzh", "published": "February 2018", "version": "5.99-FFRC1", - - "gitbook": "3.2.2", - "root": "docs", - "pdf": { - "fontFamily": "Verdana", - "fontSize": 12, - "paperSize": "a4", - "pageBreaksBefore": "//h:div[@class=\"page-break\"]" - }, - "styles": { - "website": "resources/ebook.css", - "ebook": "resources/ebook.css", - "pdf": "resources/ebook.css" - }, - - "hidepageheaders": [], - "hidepagefooters": [], - - "plugins": [ - "regexplace" - ], - "pluginsConfig": { - "regexplace": { - "removeFirstPartsInSectionNumber": true, - "substitutes": [{ - "pattern": "", - "flags": "g", - "substitute": "
" - }, - { - "pattern": "", - "flags": "g", - "substitute": "
" - }, - { - "pattern": "", - "flags": "g", - "substitute": "
" - }, - { - "pattern": "", - "flags": "g", - "substitute": "
" - }, - { - "pattern": "", - "flags": "g", - "substitute": "
" - }, - { - "pattern": "", - "flags": "g", - "substitute": "
" - }, - { - "pattern": "!\\[(.*?)\\]\\((.*?)(?:\\s+\"(.*)\")?\\){0,}{caption=1([^\\}]*)}", - "flags": "gmi", - "substitute": "
\"$1\"
", - "decode": true - }, - { - "pattern": "]*) {0,}\/{0,}> {0,}{caption=1([^\\}]*)}", - "flags": "g", - "substitute": "
", - "decode": true - }, - { - "pattern": "
", - "flags": "g", - "substitute": "
Picture _PAGE_LEVEL_._INDEX_: $2
", - "store": { - "substitute": "Pic. _PAGE_LEVEL_._INDEX_ $2", - "variable_name": "pictures" - } - }, - { - "pattern": "]*)> {0,}{style {1,}([^}]*)}", - "flags": "g", - "substitute": "", - "decode": true - } - ] - } - } + "pdf_filename": "Application-Framework-Binder-Guide" } diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index faf440a2..10722f9f 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -1,24 +1,24 @@ # Summary -* [Binder Overview](afb-introduction.html) -* [Binder daemon vocabulary](afb-daemon-vocabulary.html) -* [How to write a binding ?](afb-binding-writing.html) -* [Binding references](afb-binding-references.html) - * [Types and globals](reference-v3/types-and-globals.html) - * [Macros for logging](reference-v3/macro-log.html) - * [Functions of class afb_api](reference-v3/func-api.html) - * [Functions of class afb_req](reference-v3/func-req.html) - * [Functions of class afb_event](reference-v3/func-event.html) - * [Functions of class afb_daemon](reference-v3/func-daemon.html) - * [Functions of class afb_service](reference-v3/func-service.html) -* [Binder events guide](afb-events-guide.html) -* [Binder Application writing guide](afb-application-writing.html) -* [Annexes](annexes.html) - * [Migration to binding v3](afb-migration-to-binding-v3.html) - * [WebSocket protocol x-afb-ws-json1](protocol-x-afb-ws-json1.html) - * [Installing the binder on a desktop](afb-desktop-package.html) - * [Options of afb-daemon](afb-daemon-options.html) - * [Debugging binder and bindings](afb-daemon-debugging.html) - * [LEGACY Guide to migrate bindings from v1 to v2](legacy/afb-migration-v1-to-v2.html) - * [LEGACY Binding V2 references](legacy/afb-binding-v2-references.html) -* [Document revisions](REVISIONS.html) +* [Binder Overview](afb-introduction.md) +* [Binder daemon vocabulary](afb-daemon-vocabulary.md) +* [How to write a binding ?](afb-binding-writing.md) +* [Binding references](afb-binding-references.md) + * [Types and globals](reference-v3/types-and-globals.md) + * [Macros for logging](reference-v3/macro-log.md) + * [Functions of class afb_api](reference-v3/func-api.md) + * [Functions of class afb_req](reference-v3/func-req.md) + * [Functions of class afb_event](reference-v3/func-event.md) + * [Functions of class afb_daemon](reference-v3/func-daemon.md) + * [Functions of class afb_service](reference-v3/func-service.md) +* [Binder events guide](afb-events-guide.md) +* [Binder Application writing guide](afb-application-writing.md) +* [Annexes](annexes.md) + * [Migration to binding v3](afb-migration-to-binding-v3.md) + * [WebSocket protocol x-afb-ws-json1](protocol-x-afb-ws-json1.md) + * [Installing the binder on a desktop](afb-desktop-package.md) + * [Options of afb-daemon](afb-daemon-options.md) + * [Debugging binder and bindings](afb-daemon-debugging.md) + * [LEGACY Guide to migrate bindings from v1 to v2](legacy/afb-migration-v1-to-v2.md) + * [LEGACY Binding V2 references](legacy/afb-binding-v2-references.md) +* [Document revisions](REVISIONS.md) diff --git a/docs/_layouts/ebook/page.html b/docs/_layouts/ebook/page.html deleted file mode 100644 index bf325e9b..00000000 --- a/docs/_layouts/ebook/page.html +++ /dev/null @@ -1,36 +0,0 @@ -{% extends "layout.html" %} - -{% block title %}{{ page.title }}{% endblock %} -{% block description %}{{ page.description }}{% endblock %} - -{% block style %} - {### Include theme css before plugins css ###} - {% if not fileExists(config.styles.print) %} - {% if options.format %} - - {% else %} - - {% endif %} - {% endif %} - - {{ super() }} - - {### Custom stylesheets for the book ###} - - {% for type, style in config.styles %} - {% if fileExists(style) and (type == "ebook" or type == "print" or type == options.format) %} - - {% endif %} - {% endfor %} -{% endblock %} - -{% block body %} -
- {% block page %} -

{{ page.title }}

-
- {{ page.content|safe }} -
- {% endblock %} -
-{% endblock %} diff --git a/docs/_layouts/ebook/pdf_footer.html b/docs/_layouts/ebook/pdf_footer.html deleted file mode 100644 index 679e5628..00000000 --- a/docs/_layouts/ebook/pdf_footer.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "./page.html" %} -{% block body %} - - - - -{% endblock %} diff --git a/docs/_layouts/ebook/pdf_header.html b/docs/_layouts/ebook/pdf_header.html deleted file mode 100644 index ef496410..00000000 --- a/docs/_layouts/ebook/pdf_header.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "./page.html" %} -{% block body %} -
- IoT.Bzh - {{ config.title }} -
- - - - -{% endblock %} \ No newline at end of file diff --git a/docs/_layouts/ebook/summary.html b/docs/_layouts/ebook/summary.html deleted file mode 100644 index be328a42..00000000 --- a/docs/_layouts/ebook/summary.html +++ /dev/null @@ -1,58 +0,0 @@ -{% extends "./page.html" %} - -{% block title %}{{ "SUMMARY"|t }}{% endblock %} - -{% macro articles(_articles) %} - {% for article in _articles %} -
  • - - {% if article.path or article.url %} - {% if article.path %} - {{ article.title }} - {% else %} - {{ article.title }} - {% endif %} - {% else %} - {{ article.title }} - {% endif %} - {% if 1 %} - {{ article.level }} - {% endif %} - - {% if article.articles.length > 0 %} -
      - {{ articles(article.articles) }} -
    - {% endif %} -
  • - {% endfor %} -{% endmacro %} - -{% block page %} -
    -

    {{ "SUMMARY"|t }}

    -
      - {% for part in summary.parts %} - {% if part.title %} -
    1. -

      {{ part.title }}

      -
    2. - {% endif %} - {{ articles(part.articles) }} - - {% if not loop.last %} -
    3. - {% endif %} - {% endfor %} - - {% if glossary.path %} -
    4. - - {{ "GLOSSARY"|t }} - -
    5. - {% endif %} -
    -
    -{% endblock %} - diff --git a/docs/_layouts/layout.html b/docs/_layouts/layout.html deleted file mode 100644 index 3d5aca60..00000000 --- a/docs/_layouts/layout.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - {% block title %}{{ config.title|d("GitBook", true) }}{% endblock %} - - - - {% if config.author %}{% endif %} - {% if config.isbn %}{% endif %} - {% block style %} - {% for resource in plugins.resources.css %} - {% if resource.url %} - - {% else %} - - {% endif %} - {% endfor %} - {% endblock %} - - {% block head %}{% endblock %} - - - {% block body %}{% endblock %} - {% block javascript %}{% endblock %} - - diff --git a/docs/cover.jpg b/docs/cover.jpg deleted file mode 100755 index db50cabb..00000000 Binary files a/docs/cover.jpg and /dev/null differ diff --git a/docs/cover_small.jpg b/docs/cover_small.jpg deleted file mode 100644 index 5b0481bc..00000000 Binary files a/docs/cover_small.jpg and /dev/null differ diff --git a/docs/resources/cover.svg b/docs/resources/cover.svg deleted file mode 100644 index 21e9e9f2..00000000 --- a/docs/resources/cover.svg +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - {title} {subtitle} {version} {date} - diff --git a/docs/resources/ebook.css b/docs/resources/ebook.css deleted file mode 100644 index 39f126c2..00000000 --- a/docs/resources/ebook.css +++ /dev/null @@ -1,386 +0,0 @@ -/* IoT.Bzh theaming */ - -h1 { - color: #330066; - border-bottom: 2px solid #330066; -} - -h2 { - color: #330066; -} - -h3 { - color: #330066; -} - -h4 { - color: #330066; -} - - -/* GENERAL ELEMENTS */ - -/* clear both */ - -.clear { - clear: both; -} - -.section> :last-child { - margin-bottom: 0 !important; -} - -.section> :first-child { - margin-top: 0 !important; -} - - -/* SPECIAL ELEMENTS */ - - -/* page break always after element on pdf/print definition */ - -div.pagebreak { - page-break-after: always; -} - - -/* no page break inside element on pdf/print definition */ - -div.nopb { - page-break-inside: avoid !important; - margin: 4px 0 4px 0; -} - - -/* note blocks */ - -div.note { - background: #FCF8E3 none repeat scroll 0% 0%; - color: #8A6D3B; - padding: 15px; - margin-bottom: 10px; - border-bottom: 5px solid #DDD; - border-color: #FAEBCC; - page-break-inside: avoid; -} - -div.note p { - padding-bottom: 0; - margin-bottom: 0; -} - - -/* images, figures and captions */ - -p img { - /* center all images */ - display: block; - margin: 0 auto; - padding: 10px 0; -} - -figure { - margin: 1.0em 0px; - padding: 10px 0; - text-align: center; - page-break-inside: avoid; - display: block; -} - -figure img { - display: block; - margin: 0 auto; -} - -figcaption { - clear: left; - margin: 1.0em 0 0 0; - text-align: center; - font-style: italic; - line-height: 1.5em; - font-size: 80%; - color: #666; - display: block; -} - -.page .section p img { - margin-top: 10px; -} - - -/* ul, ol list margin fix */ - -.page .section ol, -.page .section ul { - margin-bottom: 10px; -} - - -/* blockquotes */ - -.page .section blockquote { - margin: 0 0 0 5%; - font-style: italic; -} - - -/* PAGE SPECIFIC */ - - -/* set summary page to right side of the paper */ - -.page .toc h1 { - page-break-before: right; -} - -.page .section.toc { - page-break-inside: always; -} - -/* table headers */ - -div#README\.md table { - margin-top: 30px; - font-size: 95%; -} - -div#README\.md table thead { - display: none; -} - - - -/* CITATION AND IMAGES */ - - -/* math image styles */ - -.page .section p img.svg, -.page .section p img.png { - margin-top: 0px; - margin-bottom: -2px; -} - -.page .section p img.math { - vertical-align: middle; - height: auto; - width: auto; - margin-top: -4px; - max-height: 15px; -} - -.page .section p img.math.line1 { - margin-top: -7px; - max-height: 19px; -} - -.page .section p img.math.line2 { - margin-top: -1px; - max-height: 30px; -} - - -/* credits page */ - -.page .section ul.pictures { - margin-left: -30px; -} - -.page .section ul.pictures li { - list-style: outside none none; -} - -.page .section ul.pictures li a { - float: left; -} - -.page .section ul.pictures li span { - display: block; - margin-left: 100px; -} - - - -/* sub and super script */ - -.page .section sub { - font-size: 80%; - margin-left: 1px; -} - - -/* citations and references */ - -.page .section sup { - margin-left: -1px; - margin-right: 2px; - font-size: 80%; -} - -.page .section sup:before { - content: " "; -} - -.page .section ul.citations, -.page .section ul.references { - margin-left: -30px; -} - - -.page .section ul.citations li:nth-child(1) { - margin-top: 20px; - padding-top: 20px; - border-top: 1px solid #BBB; -} - -.page .section ul.citations li, -.page .section ul.references li { - list-style: outside none none; -} - -.page .section ul.citations li { - font-size: 80%; -} - -.page .section ul.citations li>span:nth-child(1), -.page .section ul.references li>span:nth-child(1) { - display: block; - float: left; - text-align: left; - width: 70px -} - -.page .section ul.citations li>span:nth-child(1) { - width: 50px -} - -.page .section ul.references li div { - margin-left: 70px; -} - -.page .section ul.citations li div { - margin-left: 50px; -} - -.page .section a[href="#"], -.page .section a[href="#"]:link, -.page .section a[href="#"]:visited, -.page .section a[href="#"]:hover, -.page .section a[href="#"]:focus { - text-decoration: none; - color: inherit; - cursor: text; - font-style: italic; -} - - -/* self referential footnotes */ - -.page .section div[type="selfref"] a[href="#"], -.page .section div[type="selfref"] a[href="#"]:link, -.page .section div[type="selfref"] a[href="#"]:visited, -.page .section div[type="selfref"] a[href="#"]:hover, -.page .section div[type="selfref"] a[href="#"]:focus { - font-style: normal; -} - -.page .section div[type="selfref"] span:nth-child(1) { - display: none; -} - - -/* page break always after element on pdf/print definition */ - -div.page-break { - page-break-inside: always; -} - -div.page-break:before { - content: ' '; -} - - -/* no page break inside element on pdf/print definition */ - -div.nopb { - page-break-inside: avoid; -} - -/* justify text */ -p { - text-align: justify; -} - -/* page header and footer */ - -.pdf-footer, -.pdf-header { - margin-top: 20px; - color: #aaa; -} - -.pdf-header .header-left { - float: left; - margin-left: 2em; - margin-right: auto; -} - -.pdf-header .header-right { - display: table; - margin-left: auto; - margin-right: 2em; -} - -.pdf-footer .sub { - padding-top: 8px; - font-size: 70%; -} - -.pdf-header .sub { - padding-top: 2px; - font-size: 70%; -} - -.pdf-footer { - padding-top: 10px; - border-top: 1px solid #eee; -} - -.pdf-footer .footer-left { - float: left; - margin-left: 2em; - margin-right: auto; -} - -.pdf-footer .footer-center { - display: table; - margin-left: auto; - margin-right: auto; -} - -.pdf-footer .footer-right { - float: right; - margin-left: auto; - margin-right: 2em; -} - -.pdf-header { - padding-bottom: 10px; - border-bottom: 1px solid #eee; -} - -.pdf-header .header-pages-count { - float: right; - text-align: right; -} - -.pdf-header .header-pages-count a, -.pdf-header .header-pages-count a:visited, -.pdf-header .header-pages-count a:active, -.pdf-header .header-pages-count a:focus, -.pdf-header .header-pages-count a:link { - text-decoration: none; - color: #aaa; - cursor: text; -} diff --git a/docs/resources/make_cover.sh b/docs/resources/make_cover.sh deleted file mode 100755 index 1026ecbd..00000000 --- a/docs/resources/make_cover.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -DOCS_DIR=$(cd $(dirname $0)/.. && pwd) -BOOKFILE=$DOCS_DIR/../book.json - -TITLE=$(grep '"title":' $BOOKFILE | cut -d'"' -f 4) -SUBTITLE=$(grep '"subtitle":' $BOOKFILE | cut -d'"' -f 4) -VERSION="Version $(grep '"version":' $BOOKFILE | cut -d'"' -f 4)" -DATE=$(grep '"published":' $BOOKFILE | cut -d'"' -f 4) - -[ -z "$TITLE" ] && { echo "Error TITLE not set!" ; exit 1; } -[ -z "$VERSION" ] && { echo "Error VERSION not set!" ; exit 1; } -[ -z "$DATE" ] && { echo "Error DATE not set!" ; exit 1; } - - -cat $(dirname $0)/cover.svg | sed -e "s/{title}/$TITLE/g" \ - -e "s/font-size:87.5px/font-size:54px/g" \ - -e "s/{subtitle}/$SUBTITLE/g" \ - -e "s/font-size:62.5px/font-size:40px/g" \ - -e "s/{version}/$VERSION/g" \ - -e "s/{date}/$DATE/g" \ - > /tmp/cover.svg - -# use imagemagick convert tool (cover size must be 1800x2360) -convert -resize "1600x2160!" -border 100 -bordercolor white -background white \ - -flatten -quality 100 /tmp/cover.svg $DOCS_DIR/cover.jpg - -convert -resize "200x262!" $DOCS_DIR/cover.jpg $DOCS_DIR/cover_small.jpg diff --git a/gendocs.sh b/gendocs.sh deleted file mode 100755 index 0052748d..00000000 --- a/gendocs.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -OUTFILENAME="Application-Framework-Binder-Guide" - -SCRIPT=$(basename $BASH_SOURCE) - -VERSION=$(grep '"version":' $(dirname $BASH_SOURCE)/book.json | cut -d'"' -f 4) -[ "$VERSION" != "" ] && OUTFILENAME="${OUTFILENAME}_${VERSION}" - - -function usage() { - cat <&2 -Usage: $SCRIPT [options] [pdf|serve|doxygen] - -Options: - --debug - enable debug when generating pdf or html documentation - -d|--dry - dry run - -h|--help - get this help - -Example: - $SCRIPT pdf - -EOF - exit 1 -} - -function info() { - echo "$@" >&2 -} - -#default values -DEBUG_FLAG="" -DRY="" -DO_ACTION="" -OUT_DIR=./build - -[[ $? != 0 ]] && usage -while [ $# -gt 0 ]; do - case "$1" in - --debug) DEBUG_FLAG="--log=debug --debug";; - -d|--dry) DRY=echo;; - -h|--help) usage;; - pdf | serve | doxygen) DO_ACTION=$1;; - --) break;; - esac - shift -done - -cd $(dirname $0) -ROOTDIR=`pwd -P` - -# Create out dir if needed -[ -d $OUT_DIR ] || mkdir -p $OUT_DIR - -if [ "$DO_ACTION" = "pdf" -o "$DO_ACTION" = "serve" ]; then - GITBOOK=`which gitbook` - [ "$?" = "1" ] && { echo "You must install gitbook first, using: sudo npm install -g gitbook-cli"; exit 1; } - - EBCONV=`which ebook-convert` - [ "$?" = "1" ] && { echo "You must install calibre first, using: 'sudo apt install calibre' or refer to https://calibre-ebook.com/download"; exit 1; } - - if [ "$DO_ACTION" = "pdf" ]; then - - # Update cover when book.json has been changed - [[ $ROOTDIR/book.json -nt $ROOTDIR/docs/cover.jpg ]] && { echo "Update cover files"; $ROOTDIR/docs/resources/make_cover.sh || exit 1; } - - OUTFILE=$OUT_DIR/$OUTFILENAME.pdf - $DRY $GITBOOK pdf $ROOTDIR $OUTFILE $DEBUG_FLAG - [ "$?" = "0" ] && echo "PDF has been successfully generated in $OUTFILE" - else - $DRY $GITBOOK serve $DEBUG_FLAG - fi - -elif [ "$DO_ACTION" = "doxygen" ]; then - $DRY cd $OUT_DIR && cmake .. && make doxygen $ROOTDIR/Doxyfile - -else - echo "Unknown action !" - usage -fi