[Docs] Generate nntrainer docs
authorGichan Jang <gichan2.jang@samsung.com>
Wed, 27 Jan 2021 06:39:22 +0000 (15:39 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Wed, 27 Jan 2021 08:22:00 +0000 (17:22 +0900)
Generate nntrainer docs.
See: https://nntrainer.github.io/

 - Sub-documents such as Application/* need to be added
 - The table and others need to be modified according to the hotdoc rule.

Signed-off-by: Gichan Jang <gichan2.jang@samsung.com>
14 files changed:
Applications/KNN/README.md
Applications/README.md [new file with mode: 0644]
docs/coding-convention.md
docs/configuration-ini.md
docs/contributing.md
docs/getting-started.md
docs/hotdoc/gen-hotdoc.sh [new file with mode: 0755]
docs/hotdoc/index.md [new file with mode: 0644]
docs/hotdoc/sitemap.txt [new file with mode: 0644]
docs/hotdoc/theme/extra/css/extra_frontend.css [new file with mode: 0644]
docs/hotdoc/theme/extra/templates/navbar_links.html [new file with mode: 0644]
docs/how-to-run-examples.md
docs/how-to-use-testcases.md
index.md [new file with mode: 0644]

index d4cce9d..785c713 100644 (file)
@@ -1,26 +1,29 @@
+---
+title: KNN
+...
+
 # Learning with Feature Extractor (KNN)
 
 Here is some toy example which is distinguish simple images.
 The Mobile ssd V2 tensor flow lite model is used for the feature extractor and Nearest Neighbor is used for the classifier. All the training and testing is done on the Galaxy S8.
 
-![image](/docs/images/08b09a80-ef29-11e9-8303-475fd75f4b83.png?raw=true)
+<img src="../../docs/images/08b09a80-ef29-11e9-8303-475fd75f4b83.png" width="640">
 
 Happy(^^), sad(TT), soso(ㅡㅡ) classes are used and prepare 5 images for the training and two images for the test set each as below.
 
-![image](/docs/images/a73cfb80-ef29-11e9-9ae9-0d6531538eaf.png?raw=true)
+<img src="../..//docs/images/a73cfb80-ef29-11e9-9ae9-0d6531538eaf.png" width="640">
 
 After remove the fully connected layer of mobile ssd v2, 128 features are extracted. The features from first training set data is below.
 
-![image](/docs/images/0997fb00-ef2e-11e9-90a3-51c27bf4013f.png?raw=true)
-
+<img src="../../docs/images/0997fb00-ef2e-11e9-90a3-51c27bf4013f.png" width="640">
 
 Simple euclidean distance is calculated and the result is quite good. All the test set is collected.
 
-![image](/docs/images/87103b00-ef2f-11e9-9c1a-83da0faafb63.png?raw=true)
+<img src="../../docs/images/87103b00-ef2f-11e9-9c1a-83da0faafb63.png" width="640">
 
 Due to the simplicity of this toy example, all the test results are collect.
 
 There are two more random pictures which little bit differ from right image. As you can see, it is little bit hard to tell which class it is. First image could be classified as "happy" but the red zone is across with sad and the variance is quite small. Second image is more confused. Cause the smallest distance is all over the classes.
 May be should be define the threshold which is not implemented yet.
 
-![image](/docs/images/33552000-ef36-11e9-88f6-ea6a35ccdf6b.png?raw=true)
+<img src="../../docs/images/33552000-ef36-11e9-88f6-ea6a35ccdf6b.png" width="640">
diff --git a/Applications/README.md b/Applications/README.md
new file mode 100644 (file)
index 0000000..94128a9
--- /dev/null
@@ -0,0 +1,5 @@
+---
+title: Applications
+...
+
+# Applications
index d6507b6..d76cbe8 100644 (file)
@@ -1,3 +1,7 @@
+---
+title: Coding Convention
+...
+
 # Coding Convention
 
 ## C headers (.h)
@@ -9,7 +13,7 @@ Except the two, you are required to follow the general coding styles mandated by
 ## C/C++ files (.cpp, .c)
 
 Use .h for headers and .cpp / .c for source.
-You have to use clang-format with the given [.clang-format](../.clang-format) file
+You have to use clang-format with the given [.clang-format](https://github.com/nnstreamer/nntrainer/blob/main/.clang-format) file
 
 
 ## Other files
index cf1b621..c8f1cde 100644 (file)
@@ -1,3 +1,7 @@
+---
+title: Configuration ini
+...
+
 # Writing Configuration File
 
 NNTrainer requires network configuration file which includes network layers and hyper-parameters. The format of configuration file is iniparser format which is commonly used. Keywords are not case sensitive and the line start with '#' will be ignored.
index 45e3f6e..4d0667d 100644 (file)
@@ -1,3 +1,7 @@
+---
+title: Contribution
+...
+
 # How to Contribute
 
 ## Coding Convention
@@ -6,9 +10,9 @@ Consistent code conventions are important for several reasons:
 * To make it easy to debug the code, with both a system call tracer and GNU debuggers. It should be easy to set breakpoints, view locals, and display and view data structures.
 * To attempt to improve code quality through consistency, and requiring patterns that are less likely to result in bugs either initially, or after code modification.
 
-For more information, please refer to [coding-convention.md](coding-convention.md).
+For more information, please refer to [coding-convention.md](docs/coding-convention.md).
 
-For C/C++ code, you may apply clang-format with the given [.clang-format](../.clang-format) file.
+For C/C++ code, you may apply clang-format with the given [.clang-format](https://github.com/nnstreamer/nntrainer/blob/main/.clang-format) file.
 For C/C++ header files, we do not require strict style rules, but it is recommended to apply such rules.
 
 We do not have explicit and strict styling rules for other programming languages, yet.
@@ -36,7 +40,7 @@ The submitter has the first responsibility of keeping the created PR clean and n
 A PR is required to meet the following criteria.
 * It has passed all the tests defined for TAOS-CI.
     - This includes unit tests and integration tests in various platforms and different static analysis tools.
-    - Note that one of the tests includes the "Signed-off-by" check, which means that the author has agreed with [Code of Conduct](../CODE_OF_CONDUCT.md). You may need to refer to later section.
+    - Note that one of the tests includes the "Signed-off-by" check, which means that the author has agreed with [Code of Conduct](CODE_OF_CONDUCT.md). You may need to refer to later section.
 * At least TWO committers (reviewers with voting rights) have approved the PR.
     - This is a necessary condition, not sufficient.
     - If the PR touches sensitive codes or may affect wide ranges of components, reviewers will wait for other reviewers to back them up.
index f1eb286..92168ee 100644 (file)
@@ -1,3 +1,7 @@
+---
+title: Getting Started
+...
+
 # Getting Started
 
 ## Prerequisites
diff --git a/docs/hotdoc/gen-hotdoc.sh b/docs/hotdoc/gen-hotdoc.sh
new file mode 100755 (executable)
index 0000000..8c8dfc6
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+# This is to create the nntrainer documents (https://nntrainer.github.io/).
+# Our documentation uses hotdoc, you should usually refer to here: http://hotdoc.github.io/ .
+# Run this script on the root path of the NNTrainer.
+
+echo "Generate NNTrainer documents"
+
+v=$( grep -w version: meson.build | perl -pe 'if(($v)=/([0-9]+([.][0-9]+)+)/){print"$v\n";exit}$_=""' )
+deps_file_path="$(pwd)/docs/NNTrainer.deps"
+
+echo "NNTrainer version: $v"
+echo "Dependencies file path: $deps_file_path"
+
+hotdoc run -i index.md -o docs/NNTrainer-doc --sitemap=docs/hotdoc/sitemap.txt --deps-file-dest=$deps_file_path \
+           --html-extra-theme=docs/hotdoc/theme/extra --project-name=NNTrainer --project-version=$v
diff --git a/docs/hotdoc/index.md b/docs/hotdoc/index.md
new file mode 100644 (file)
index 0000000..3d3cfc0
--- /dev/null
@@ -0,0 +1,8 @@
+---\r
+title: Documents\r
+...\r
+\r
+# NNTrainer Documents\r
+\r
+The following sections introduce a series of tutorials designed to help\r
+you learn how to use NNtrainer.\r
diff --git a/docs/hotdoc/sitemap.txt b/docs/hotdoc/sitemap.txt
new file mode 100644 (file)
index 0000000..191c807
--- /dev/null
@@ -0,0 +1,11 @@
+index.md
+       docs/hotdoc/index.md
+               docs/getting-started.md
+               docs/how-to-run-examples.md
+               docs/how-to-use-testcases.md
+               docs/configuration-ini.md
+               docs/coding-convention.md
+               docs/contributing.md
+               CODE_OF_CONDUCT.md
+       Applications/README.md
+               Applications/KNN/README.md
diff --git a/docs/hotdoc/theme/extra/css/extra_frontend.css b/docs/hotdoc/theme/extra/css/extra_frontend.css
new file mode 100644 (file)
index 0000000..937de5c
--- /dev/null
@@ -0,0 +1,52 @@
+h1, h2, h2, h3, h4, h5 {
+       font-weight: 300;
+}
+
+.hotdoc-navbar-brand {
+       font-weight: 700;
+       text-transform: uppercase;
+       font-size: 70%;
+       color: black;
+}
+
+.page-header {
+       text-align: center;
+       font-weight: 300;
+       padding: 100px 15px;
+}
+
+.page-header h1, .page-header h2 {
+       margin-bottom: 1em;
+}
+
+.page-header p {
+       margin-left: auto;
+       margin-right: auto;
+       max-width: 80%;
+       font-size: 18px;
+}
+
+.btn-xl {
+       padding: 15px 30px;
+}
+
+.toned-row {
+       background-color: #dfdfdf;
+       margin: 3em -15px 3em -15px;
+       padding: 3em;
+       text-align: center;
+
+}
+
+.toned-row a.icon {
+       display: inline-block;
+       width: 92px;
+       height: 92px;
+       background-repeat: no-repeat;
+       background-position: center;
+       background-size: 64px;
+       padding-top: 92px;
+       cursor: pointer;
+       font-size: 90%;
+       transition: 500ms color ease-in-out;
+}
diff --git a/docs/hotdoc/theme/extra/templates/navbar_links.html b/docs/hotdoc/theme/extra/templates/navbar_links.html
new file mode 100644 (file)
index 0000000..44d6bd6
--- /dev/null
@@ -0,0 +1,18 @@
+@require(page)
+
+<li class="dropdown">
+    <a class="dropdown-toggle" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+        API References<span class="caret"></span>
+    </a>
+       <ul class="dropdown-menu" id="modules-menu">
+               @for tup in (("docs/hotdoc/index.html","NNTrainer doc"),):
+                       <li>
+                               <a href="@tup[0]">@tup[1]</a>
+                       </li>
+               @end
+</li>
+
+<li>
+       <a href="docs/hotdoc/index.html">Documents</a>
+</li>
+
index d17e3a7..85cc3d7 100644 (file)
@@ -1,3 +1,7 @@
+---
+title: How to run examples
+...
+
 # How to run examples
 
 ## Preparing NNTrainer for execution
index 6c9e8fe..1cda76a 100644 (file)
@@ -1,3 +1,8 @@
+---
+title: How to run Test Cases
+...
+
+
 # How to run Test Cases
 
 - Use the built library
diff --git a/index.md b/index.md
new file mode 100644 (file)
index 0000000..824ed9b
--- /dev/null
+++ b/index.md
@@ -0,0 +1,17 @@
+---\r
+full-width: true\r
+title: NNTrainer\r
+render-subpages: false\r
+...\r
+\r
+<div class="container">\r
+<div class="page-header">\r
+    <h1>NNTrainer: Software Framework for training Neural Network models on devices.</h1>\r
+    <p>\r
+NNTrainer is an Open Source Project. The aim of the NNtrainer is to develop a Software Framework to train neural network models on embedded devices which have relatively limited resources.\r
+\r
+Rather than training whole layers of a network, NNtrainer trains only one or a few layers of the layers added after a feature extractor.\r
+    </p>\r
+    <a class="btn btn-default btn-xl page-scroll" href="docs/hotdoc/index.html" data-hotdoc-relative-link=true>Get Started</a>\r
+</div>\r
+</div>\r