From 84c3b21720477e6c555add4bf2548d29aec1270e Mon Sep 17 00:00:00 2001 From: Volker Schukai <volker.schukai@schukai.com> Date: Fri, 23 Dec 2022 12:57:19 +0100 Subject: [PATCH] chore: complete documentation --- README.md | 71 +++++++++++++++- application/web/index.html | 82 +++++++++++++++++++ .../makefiles/directories-go-utilities.mk | 2 + 3 files changed, 151 insertions(+), 4 deletions(-) create mode 100644 application/web/index.html diff --git a/README.md b/README.md index aba8a96..1d35405 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Bob -bob is a html and html fragment builder +bob is an HTML and HTML fragment builder ## Documentation @@ -8,6 +8,9 @@ To check out docs and examples, visit [gitlab.schukai.com/oss/bob](https://gitla ## Installation +```bash +wget -O ~/.local/bin/bob http://download.schukai.com/tools/bob/bob-$( uname -s | tr [:upper:] [:lower:])-$(echo `uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/`) && chmod u+x ~/.local/bin/bob +``` ## Usage @@ -19,11 +22,11 @@ To check out docs and examples, visit [gitlab.schukai.com/oss/bob](https://gitla bob template prepare --input ./templates/ --output ./output/ ``` -This will create a `./output/` directory with all parsed templates from `./templates/` directory. +This will create files in the `./output/` directory with all parsed templates from `./templates/` directory. Also, a data YAML. This data YAML is used to generate the final files. This command prepares the title, description, keywords, and other metadata for the templates. -Also, it will parse the templates for images, anchors, and text. +Furthermore, it will parse the templates for images, anchors, and text. | Original | Parsed | |-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------| @@ -35,9 +38,69 @@ Also, it will parse the templates for images, anchors, and text. | `<p>Bob is a html and html fragment builder</p>` | `<p><span data-attributes="text path:p.id1005.text">Bob is a html and html fragment builder</span></p>` | +#### HTML + +##### Generate +This will generate HTML files from the prepared templates. + +```bash +bob template generate --input ./output/ --output ./output/ +``` + +##### Sync + +This will sync HTML nodes from a source to a destination. + +```bash +bob template sync --specification ./specification.yaml +``` +The structure of the specification file is as follows: + +```yaml +sync: + - source: + path: './source.html' + selector: '#mainscript' + destination: + path: './' + exclude: + - ./source.html +``` + +The `source` is the source file and the `selector` is the selector to find the node to sync. +The `destination` is the destination directory and the `exclude` is a list of files to exclude. + +Relative paths are relative to the specification file. + +#### Cut + +This will cut a node from a source file and save it to a destination template file. + +```bash +bob template cut --specification ./specification.yaml +``` + +The structure of the specification file is as follows: + +```yaml +snippet: + - + source: ./test.html + selector: 'head' + destination: ./snippets/container.html + attribute: + - selector: 'li' + name: 'class' + value: 'list-item' + replacement: + - + selector: '#myid' + content: 'replacement content' +``` +Relative paths are relative to the specification file. ## Questions @@ -52,7 +115,7 @@ issue. Issues not conforming to the guidelines may be closed immediately. ## License -© schukai GmbH, Released under the AGPL 3.0 License. +© schukai GmbH, released under the AGPL 3.0 License. [AGPL](https://www.gnu.org/licenses/agpl-3.0.de.html) diff --git a/application/web/index.html b/application/web/index.html new file mode 100644 index 0000000..fb4e4fe --- /dev/null +++ b/application/web/index.html @@ -0,0 +1,82 @@ +<!doctype html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" + integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> + + <style> + + body { + background-color: #ffffff; + } + + </style> + <title>Download Portal schukai GmbH</title> +</head> +<body> + + +<div class="d-flex flex-column align-items-center justify-content-center" + style="height:100vh;"> + + <div class="text-center"> + <a href="https://www.schukai.com" class="text-decoration-none text-white text-decoration"><img + src="https://cdn.alvine.io/image/logo/schukai-rot.svg" width="300px"></a> + <br> + + <div class="card mt-5"> + <div class="card-header"> + bob + </div> + <ul class="list-group"> + <li class="list-group-item"><a class="text-decoration-none link-danger" href="./bob-linux-386">bob-linux-386</a></li> + <li class="list-group-item"><a class="text-decoration-none link-danger" href="./bob-linux-amd64">bob-linux-amd64</a></li> + <li class="list-group-item"><a class="text-decoration-none link-danger" href="./bob-linux-arm">bob-linux-arm</a></li> + <li class="list-group-item"><a class="text-decoration-none link-danger" href="./bob-linux-arm64">bob-linux-arm64</a></li> + <li class="list-group-item"><a class="text-decoration-none link-danger" href="./bob-windows">bob-windows</a></li> + </ul> + </div> + + <p class="mt-5"> + <a href="https://about.schukai.com/de/impressum/" class="text-decoration-none text-decoration" + style="color:#c10000">Imprint</a></p> + + </div> + + +</div> + + +<!-- +<div class="d-flex flex-column align-items-center justify-content-center" + style="height:100vh;"> + +<div class="d-block"> + +<div><img src="signet.svg" height="10%"></div> +<div> + +</div> +</div> +</div> + + + +<div class="text-center mb-2 fixed-bottom"> + <div class="row"> + <div class="col"> + + </div> + </div> +</div> --> + + +<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" + integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" + crossorigin="anonymous"></script> + +</body> +</html> diff --git a/development/makefiles/directories-go-utilities.mk b/development/makefiles/directories-go-utilities.mk index d70ae18..a1d28a5 100644 --- a/development/makefiles/directories-go-utilities.mk +++ b/development/makefiles/directories-go-utilities.mk @@ -14,6 +14,8 @@ DOCUMENTATION_PATH ?= $(PROJECT_ROOT)documentation/ RESOURCE_PATH ?= $(APPLICATION_PATH)resource/ SOURCE_PATH ?= $(APPLICATION_PATH)source/ +WEB_PATH ?= $(APPLICATION_PATH)web/ + ## SCRIPTS_PATH IS DEPRECATED SCRIPTS_PATH ?= $(DEVELOPMENT_PATH)script/ -- GitLab