fix component documentation

This commit is contained in:
aleks
2023-06-19 16:14:31 +02:00
parent e2faf18099
commit e62985c55d
4 changed files with 30 additions and 8 deletions

View File

@@ -194,7 +194,7 @@ build_docs:
script:
- cd docs
- pip install -r requirements.txt
- build-docs -l en -t esp32
- ./generate_docs
.deploy_docs_template:
stage: deploy

View File

@@ -1,11 +1,6 @@
var DOCUMENTATION_VERSIONS = {
DEFAULTS: { has_targets: true,
supported_targets: [ "esp32", "esp32s2", "esp32s3", "esp32c2", "esp32c3", "esp32c6", "esp32h2" ]
},
VERSIONS: [
{ name: "latest" },
{ name: "v1.0.10", old:false },
{ name: "v1.0.0", old:true }
{ name: "latest", has_targets: true, supported_targets: [ "esp32", "esp32s2", "esp32s3", "esp32c2", "esp32c3", "esp32c6", "esp32h2" ] },
],
IDF_TARGETS: [
{ text: "ESP32", value: "esp32"},

View File

@@ -29,5 +29,5 @@ html_static_path = ['../_static']
project_slug = 'esp-modbus'
versions_url = './_static/modbus_docs_versions.js'
idf_targets = [ 'esp32', 'esp32s2', 'esp32s3', 'esp32c2', 'esp32c3', 'esp32c6', 'esp32h2' ]
idf_targets = [ 'esp32' ]
languages = ['en']

27
docs/generate_docs Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
rm -rf docs
build-docs --target esp32 --language en
# Modifes target field of html files
ELEMENT="<script type='text/javascript'>
window.onload =(function() {
var myAnchor = document.getElementById('target-select');
var mySpan = document.createElement('input');
mySpan.style.float = 'left';
mySpan.setAttribute('type', 'text');
mySpan.setAttribute('maxLength', '10');
mySpan.value = 'all targets';
mySpan.setAttribute('disabled', true);
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
})();
</script>"
FILES=$(find . -path "*/_build/en/esp32/html/*.html")
for FILE in ${FILES}
do
echo ${ELEMENT} >> "${FILE}"
done