From e92a07b740238c0b1db4bd5e5ea7a755892e1698 Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 24 Aug 2020 15:48:53 +0200 Subject: [PATCH] improved working of development Combined the development pages into the stable docs with additional blocks --- content/firmwareapi/pycom/machine/adc.md | 32 ++++++++++++++++++++--- layouts/_default/baseof.html | 20 +++++++++++--- layouts/shortcodes/development.html | 9 +++++-- layouts/shortcodes/hint.html | 1 + themes/doc-theme/static/css/doc-theme.css | 4 +-- 5 files changed, 54 insertions(+), 12 deletions(-) diff --git a/content/firmwareapi/pycom/machine/adc.md b/content/firmwareapi/pycom/machine/adc.md index a9a351c..24f25a9 100644 --- a/content/firmwareapi/pycom/machine/adc.md +++ b/content/firmwareapi/pycom/machine/adc.md @@ -9,11 +9,35 @@ aliases: ## class ADC – Analog to Digital Conversion -{{< development style="dev" >}} -hi +{{% development version="1.20.2.rc10" style="dev" %}} + +## header +```python +print('hello world') +``` + +> hi + +* one +* two + * tab + 3. three + +{{% /development %}} + + -{{< /development >}} ### Quick Usage Example +{{% development version="1.20.3.b0" style="dev" %}} + +## Function(var) + +Takes var as an input. Output can be: +* `One`: One thing +* `Two`: Second thing + +{{% /development %}} + ```python import machine @@ -35,7 +59,7 @@ Create an ADC object; associate a channel with a pin. For more info check the ha Enable the ADC block. This method is automatically called on object creation. -* `Bits` can take values between 9 and 12 and selects the number of bits of resolution of the ADC block. +* `bits` can take values between 9 and 12 and selects the number of bits of resolution of the ADC block. ### adc.deinit() diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 4157364..86db8c9 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -48,8 +48,12 @@ drawer2: true, toc: 0, branches: [ - { value: 'https://docs.pycom.io', text: 'version stable', }, - { value: 'https://development.pycom.io', text: 'version development'}, + { value: '1', text: 'version stable'}, + { value: '2', text: 'version development'}, + /*{ value: '1', text: 'version 1.20.2.r0'}, + { value: '2', text: 'version 1.20.3.b0'}, + { value: '3', text: 'version 1.20.2.rc10'}, + { value: '4', text: 'version 1.20.2.rc9'},*/ ], branch: "" }, @@ -81,9 +85,17 @@ development = !development; console.log("switch") if (!development){ - document.getElementById('development').style='display:none'; + var x = document.getElementsByClassName('development') + var i; + for (i = 0; i < x.length; i++) { + x[i].style.display = 'none'; + } }else{ - document.getElementById('development').style='display:block'; + var x = document.getElementsByClassName('development') + var i; + for (i = 0; i < x.length; i++) { + x[i].style.display = 'block'; + } } //window.location = newb + window.location.pathname } diff --git a/layouts/shortcodes/development.html b/layouts/shortcodes/development.html index bcbdce1..6147c6e 100644 --- a/layouts/shortcodes/development.html +++ b/layouts/shortcodes/development.html @@ -1,8 +1,13 @@ -
+{{ $_hugo_config := `{ "version": 1 }` }} +
+ Development version {{.Get "version" }} {{ .Inner }} -
\ No newline at end of file +
+ + + diff --git a/layouts/shortcodes/hint.html b/layouts/shortcodes/hint.html index 0029d56..0eb5999 100644 --- a/layouts/shortcodes/hint.html +++ b/layouts/shortcodes/hint.html @@ -1,3 +1,4 @@ +{{ $_hugo_config := `{ "version": 1 }` }} {{ .Inner }} diff --git a/themes/doc-theme/static/css/doc-theme.css b/themes/doc-theme/static/css/doc-theme.css index 9fcc193..014389a 100644 --- a/themes/doc-theme/static/css/doc-theme.css +++ b/themes/doc-theme/static/css/doc-theme.css @@ -224,12 +224,12 @@ li.hot { Added shortcode for development markings */ -#development { +.development { display:none; } .dev { - background-color: #EF9A9A !important; + background-color: #F6E6D6 !important; } .v-card__text > h3, h4{