From 5ae5e518bc7edc7177fc1f49fda59f1e5892d282 Mon Sep 17 00:00:00 2001 From: eeintech Date: Thu, 24 Sep 2020 11:56:02 -0500 Subject: [PATCH] Now opening external links in new tab (added little icon), started build documentation --- docs/assets/open-in-new-custom.svg | 3 +++ docs/build/build.md | 23 +++++++++++++++++++++++ docs/javascripts/extra.js | 7 +++++++ docs/stylesheets/extra.css | 10 +++++++++- mkdocs.yml | 6 +++++- 5 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 docs/assets/open-in-new-custom.svg create mode 100644 docs/javascripts/extra.js diff --git a/docs/assets/open-in-new-custom.svg b/docs/assets/open-in-new-custom.svg new file mode 100644 index 0000000..f78ecd6 --- /dev/null +++ b/docs/assets/open-in-new-custom.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/docs/build/build.md b/docs/build/build.md index 2b3baa0..f5c7127 100644 --- a/docs/build/build.md +++ b/docs/build/build.md @@ -5,5 +5,28 @@ layout: page ## Building Parts +Build management can be accessed via the *Build* navigation tab. + +A "basic" build flow is as follow: + +1. create a part with the [*Assembly option*](/part/views/#part-options) turned-on +0. add a Bill of Material (BOM) +0. create a "Build Order" for this part +0. allocate stocks from your inventory +0. update build status and notes +0. complete the build. + +##### Future Features + +| Feature | Status | +| ----------- | ------------------------------------ | +| Edit completed build | :material-progress-clock: [Work In Progress](https://github.com/inventree/InvenTree/pull/993) | +| Track subparts | :material-progress-clock: [Work In Progress](https://github.com/inventree/InvenTree/pull/991) | +| Partial builds | :material-close: Not yet supported | + +### Part BOM + +Read through the [Bill of Materials documentation](/build/bom) to setup a part BOM before creating a "Build Order". + !!! missing "TODO" This section requires further work diff --git a/docs/javascripts/extra.js b/docs/javascripts/extra.js new file mode 100644 index 0000000..ccacf7b --- /dev/null +++ b/docs/javascripts/extra.js @@ -0,0 +1,7 @@ +/* Add target="_blank" to external links */ +/* Source: https://html.com/attributes/a-target/#:~:text=browser */ +function externalLinks() { + for(var c = document.getElementsByTagName("a"), a = 0;a < c.length;a++) { + var b = c[a]; b.getAttribute("href") && b.hostname !== location.hostname && (b.target = "_blank") + } +} ; externalLinks(); diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index a9be42e..138eb37 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -44,4 +44,12 @@ .overlay:target img { transform: scale(1); -} \ No newline at end of file +} + +/* Add icon after external links */ +/* Ignore auto-generated material theme links */ +a[target="_blank"]:not([class*="md-"]):after { +/* content: " " url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='rgb(123,136,204)' d='M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z' /%3E%3C/svg%3E%0A");*/ + content: " " url('../assets/open-in-new-custom.svg'); +} + diff --git a/mkdocs.yml b/mkdocs.yml index d07c89e..21d742f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -19,10 +19,11 @@ theme: icon: repo: fontawesome/brands/github features: - - instant - tabs extra_css: - stylesheets/extra.css +extra_javascript: + - javascripts/extra.js # Navigation nav: @@ -79,6 +80,9 @@ markdown_extensions: - admonition - pymdownx.details - markdown.extensions.codehilite + - pymdownx.emoji: + emoji_index: !!python/name:materialx.emoji.twemoji + emoji_generator: !!python/name:materialx.emoji.to_svg - toc: permalink: ⚓