mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-17 20:42:21 +02:00
docs(common): deploy docs if component version got changed
This commit is contained in:
56
.github/workflows/publish-docs-component.yml
vendored
56
.github/workflows/publish-docs-component.yml
vendored
@ -43,27 +43,35 @@ jobs:
|
|||||||
tag_name: ${{ env.BUMP_TAG }}
|
tag_name: ${{ env.BUMP_TAG }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# - name: Generate docs
|
- name: Generate docs
|
||||||
# shell: bash
|
shell: bash
|
||||||
# run: |
|
run: |
|
||||||
# sudo apt-get update
|
sudo apt-get update
|
||||||
# sudo apt-get -y install doxygen clang python3-pip
|
sudo apt-get -y install doxygen clang python3-pip
|
||||||
# python -m pip install breathe recommonmark esp-docs==1.4.1
|
python -m pip install breathe recommonmark esp-docs==1.4.1
|
||||||
# cd $GITHUB_WORKSPACE/docs
|
cd $GITHUB_WORKSPACE/docs/${{ env.BUMP_COMPONENT }}
|
||||||
# ./generate_docs
|
./generate_docs ${{ env.BUMP_VERSION }}
|
||||||
# - name: Deploying generated docs
|
- name: Deploying generated docs
|
||||||
# if: always()
|
shell: bash
|
||||||
# shell: bash
|
run: |
|
||||||
# run: |
|
source $GITHUB_WORKSPACE/docs/utils.sh
|
||||||
# source $GITHUB_WORKSPACE/docs/utils.sh
|
add_doc_server_ssh_keys $DOCS_DEPLOY_KEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
|
||||||
# add_doc_server_ssh_keys $DOCS_DEPLOY_KEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
|
export GIT_VER=$(git describe --always)
|
||||||
# export GIT_VER=$(git describe --always)
|
export GITHUB_REF_NAME=latest
|
||||||
# export GITHUB_REF_NAME=latest
|
export DOCS_BUILD_DIR=$GITHUB_WORKSPACE/docs/${{ env.BUMP_COMPONENT }}
|
||||||
# export DOCS_BUILD_DIR=$GITHUB_WORKSPACE/docs
|
export DOCS_DEPLOY_PATH=$DOCS_DEPLOY_PATH/${{ env.BUMP_COMPONENT }}
|
||||||
# deploy-docs
|
cd $GITHUB_WORKSPACE/docs/${{ env.BUMP_COMPONENT }}
|
||||||
# - name: Upload components to component service
|
ls docs/generic/html/
|
||||||
# uses: espressif/github-actions/upload_components@master
|
# Deploy docs with latest path
|
||||||
# with:
|
deploy-docs
|
||||||
# directories: "components/esp_modem;components/esp_websocket_client;components/mdns;components/asio;components/esp_mqtt_cxx"
|
# Deploy docs with version path
|
||||||
# namespace: "espressif"
|
if [ ${{ env.BUMP_VERSION }} != '' ]; then
|
||||||
# api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
|
export GITHUB_REF_NAME=${{ env.BUMP_VERSION }}
|
||||||
|
deploy-docs
|
||||||
|
fi
|
||||||
|
- name: Upload components to component service
|
||||||
|
uses: espressif/github-actions/upload_components@master
|
||||||
|
with:
|
||||||
|
directories: "components/esp_modem;components/esp_websocket_client;components/mdns;components/asio;components/esp_mqtt_cxx"
|
||||||
|
namespace: "espressif"
|
||||||
|
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
|
||||||
|
@ -1,21 +1,59 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
rm -rf docs
|
||||||
|
|
||||||
build-docs --target esp32 --language en
|
build-docs --target esp32 --language en
|
||||||
|
|
||||||
cp -rf _build/en/esp32/html .
|
mkdir -p docs/generic
|
||||||
|
mv _build/en/esp32/html docs/generic
|
||||||
|
|
||||||
rm -rf _build __pycache__
|
rm -rf _build __pycache__
|
||||||
|
|
||||||
|
URL="https://docs.espressif.com/projects/esp-protocols/asio/docs/latest/index.html"
|
||||||
|
RELEASES_STR=$(curl $URL | awk '/var RELEASES = \[/,/];/' | sed 's/var RELEASES = \[//' | sed 's/];$//' | tr -d '",')
|
||||||
|
|
||||||
|
declare -a RELEASES=($RELEASES_STR)
|
||||||
|
|
||||||
|
if [ -n "$1" ] && [ -n "${1}" ]; then
|
||||||
|
RELEASES+=(\'$1\')
|
||||||
|
fi
|
||||||
|
|
||||||
|
for i in "${!RELEASES[@]}"; do
|
||||||
|
RELEASES[i]="${RELEASES[$i]},\n"
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
# Modifes some version and target fields of index.html
|
# Modifes some version and target fields of index.html
|
||||||
echo "<script type="text/javascript">
|
echo "<script type="text/javascript">
|
||||||
window.onload =(function() {
|
window.onload =(function() {
|
||||||
var myAnchor = document.getElementById('version-select');
|
var myAnchor = document.getElementById('version-select');
|
||||||
var mySpan = document.createElement('input');
|
var mySpan = document.createElement('select');
|
||||||
mySpan.setAttribute('type', 'text');
|
mySpan.style.float = 'left';
|
||||||
mySpan.setAttribute('maxLength', '10');
|
|
||||||
mySpan.value = 'latest';
|
var latest_ver = document.createElement('option');
|
||||||
mySpan.setAttribute('disabled', true);
|
latest_ver.value = 'latest';
|
||||||
|
latest_ver.textContent = 'latest(master)';
|
||||||
|
mySpan.append(latest_ver);
|
||||||
|
|
||||||
|
var RELEASES = [
|
||||||
|
$(echo -e ${RELEASES[@]})
|
||||||
|
];
|
||||||
|
for (var i = RELEASES.length - 1; i >= 0; i--) {
|
||||||
|
var current_ver = document.createElement('option');
|
||||||
|
current_ver.value = RELEASES[i];
|
||||||
|
current_ver.textContent = 'release-v'+ RELEASES[i];
|
||||||
|
mySpan.append(current_ver);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
||||||
|
mySpan.addEventListener('change', function() {
|
||||||
|
window.location.href='https://docs.espressif.com/projects/esp-protocols/asio/docs/'+event.target.value+'/index.html'
|
||||||
|
});
|
||||||
|
|
||||||
var myAnchor = document.getElementById('target-select');
|
var myAnchor = document.getElementById('target-select');
|
||||||
var mySpan = document.createElement('input');
|
var mySpan = document.createElement('input');
|
||||||
|
mySpan.style.float = 'left';
|
||||||
mySpan.setAttribute('type', 'text');
|
mySpan.setAttribute('type', 'text');
|
||||||
mySpan.setAttribute('maxLength', '10');
|
mySpan.setAttribute('maxLength', '10');
|
||||||
mySpan.value = 'all targets';
|
mySpan.value = 'all targets';
|
||||||
@ -23,4 +61,4 @@ window.onload =(function() {
|
|||||||
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
||||||
|
|
||||||
})();
|
})();
|
||||||
</script>" >> html/index.html
|
</script>" >> docs/generic/html/index.html
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
# Cleanup the generated html
|
# Cleanup the generated html
|
||||||
rm -rf html
|
rm -rf html docs
|
||||||
|
|
||||||
# Generate C++ API header of the DCE
|
# Generate C++ API header of the DCE
|
||||||
cat ../../components/esp_modem/include/generate/esp_modem_command_declare.inc | clang++ -E -P -CC -xc++ -I../../components/esp_modem/include -DGENERATE_DOCS - | sed -n '1,/DCE command documentation/!p' > en/esp_modem_dce.hpp
|
cat ../../components/esp_modem/include/generate/esp_modem_command_declare.inc | clang++ -E -P -CC -xc++ -I../../components/esp_modem/include -DGENERATE_DOCS - | sed -n '1,/DCE command documentation/!p' > en/esp_modem_dce.hpp
|
||||||
@ -13,27 +15,44 @@ cat ../../components/esp_modem/include/generate/esp_modem_command_declare.inc |
|
|||||||
|
|
||||||
build-docs --target esp32 --language en
|
build-docs --target esp32 --language en
|
||||||
|
|
||||||
cp -rf _build/en/esp32/html .
|
mkdir -p docs/generic
|
||||||
|
mv _build/en/esp32/html docs/generic
|
||||||
|
|
||||||
rm -rf _build __pycache__
|
rm -rf _build __pycache__
|
||||||
|
|
||||||
|
URL="https://docs.espressif.com/projects/esp-protocols/esp_modem/docs/latest/en/index.html"
|
||||||
|
RELEASES_STR=$(curl $URL | awk '/var RELEASES = \[/,/];/' | sed 's/var RELEASES = \[//' | sed 's/];$//' | tr -d '",')
|
||||||
|
|
||||||
|
declare -a RELEASES=($RELEASES_STR)
|
||||||
|
|
||||||
|
if [ -n "$1" ] && [ -n "${1}" ]; then
|
||||||
|
RELEASES+=(\'$1\')
|
||||||
|
fi
|
||||||
|
|
||||||
|
for i in "${!RELEASES[@]}"; do
|
||||||
|
RELEASES[i]="${RELEASES[$i]},\n"
|
||||||
|
done
|
||||||
|
|
||||||
# Modifes some version and target fields of index.html
|
# Modifes some version and target fields of index.html
|
||||||
echo "<script type='text/javascript'>
|
echo "<script type="text/javascript">
|
||||||
window.onload =(function() {
|
window.onload =(function() {
|
||||||
var myAnchor = document.getElementById('version-select');
|
var myAnchor = document.getElementById('version-select');
|
||||||
var mySpan = document.createElement('select');
|
var mySpan = document.createElement('select');
|
||||||
mySpan.style.float = 'left';
|
mySpan.style.float = 'left';
|
||||||
|
|
||||||
latest_ver = document.createElement('option');
|
var latest_ver = document.createElement('option');
|
||||||
latest_ver.value = 'latest';
|
latest_ver.value = 'latest';
|
||||||
latest_ver.textContent = 'latest(master)';
|
latest_ver.textContent = 'latest(master)';
|
||||||
mySpan.append(latest_ver);
|
mySpan.append(latest_ver);
|
||||||
|
|
||||||
var myArray = ['v1.0.0''];
|
var RELEASES = [
|
||||||
for (var i = myArray.length - 1; i >= 0; i--) {
|
$(echo -e ${RELEASES[@]})
|
||||||
current_ver = document.createElement('option');
|
];
|
||||||
current_ver.value = myArray[i];
|
|
||||||
current_ver.textContent = 'release-'+myArray[i];
|
for (var i = RELEASES.length - 1; i >= 0; i--) {
|
||||||
|
var current_ver = document.createElement('option');
|
||||||
|
current_ver.value = RELEASES[i];
|
||||||
|
current_ver.textContent = 'release-v'+ RELEASES[i];
|
||||||
mySpan.append(current_ver);
|
mySpan.append(current_ver);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,4 +72,4 @@ window.onload =(function() {
|
|||||||
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
||||||
|
|
||||||
})();
|
})();
|
||||||
</script>" >> html/index.html
|
</script>" >> docs/generic/html/index.html
|
||||||
|
@ -1,21 +1,59 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
rm -rf docs
|
||||||
|
|
||||||
build-docs --target esp32 --language en
|
build-docs --target esp32 --language en
|
||||||
|
|
||||||
cp -rf _build/en/esp32/html .
|
mkdir -p docs/generic
|
||||||
|
mv _build/en/esp32/html docs/generic
|
||||||
|
|
||||||
rm -rf _build __pycache__
|
rm -rf _build __pycache__
|
||||||
|
|
||||||
|
URL="https://docs.espressif.com/projects/esp-protocols/esp_mqtt_cxx/docs/latest/index.html"
|
||||||
|
RELEASES_STR=$(curl $URL | awk '/var RELEASES = \[/,/];/' | sed 's/var RELEASES = \[//' | sed 's/];$//' | tr -d '",')
|
||||||
|
|
||||||
|
declare -a RELEASES=($RELEASES_STR)
|
||||||
|
|
||||||
|
if [ -n "$1" ] && [ -n "${1}" ]; then
|
||||||
|
RELEASES+=(\'$1\')
|
||||||
|
fi
|
||||||
|
|
||||||
|
for i in "${!RELEASES[@]}"; do
|
||||||
|
RELEASES[i]="${RELEASES[$i]},\n"
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
# Modifes some version and target fields of index.html
|
# Modifes some version and target fields of index.html
|
||||||
echo "<script type="text/javascript">
|
echo "<script type="text/javascript">
|
||||||
window.onload =(function() {
|
window.onload =(function() {
|
||||||
var myAnchor = document.getElementById('version-select');
|
var myAnchor = document.getElementById('version-select');
|
||||||
var mySpan = document.createElement('input');
|
var mySpan = document.createElement('select');
|
||||||
mySpan.setAttribute('type', 'text');
|
mySpan.style.float = 'left';
|
||||||
mySpan.setAttribute('maxLength', '10');
|
|
||||||
mySpan.value = 'latest';
|
var latest_ver = document.createElement('option');
|
||||||
mySpan.setAttribute('disabled', true);
|
latest_ver.value = 'latest';
|
||||||
|
latest_ver.textContent = 'latest(master)';
|
||||||
|
mySpan.append(latest_ver);
|
||||||
|
|
||||||
|
var RELEASES = [
|
||||||
|
$(echo -e ${RELEASES[@]})
|
||||||
|
];
|
||||||
|
for (var i = RELEASES.length - 1; i >= 0; i--) {
|
||||||
|
var current_ver = document.createElement('option');
|
||||||
|
current_ver.value = RELEASES[i];
|
||||||
|
current_ver.textContent = 'release-v'+ RELEASES[i];
|
||||||
|
mySpan.append(current_ver);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
||||||
|
mySpan.addEventListener('change', function() {
|
||||||
|
window.location.href='https://docs.espressif.com/projects/esp-protocols/esp_mqtt_cxx/docs/'+event.target.value+'/index.html'
|
||||||
|
});
|
||||||
|
|
||||||
var myAnchor = document.getElementById('target-select');
|
var myAnchor = document.getElementById('target-select');
|
||||||
var mySpan = document.createElement('input');
|
var mySpan = document.createElement('input');
|
||||||
|
mySpan.style.float = 'left';
|
||||||
mySpan.setAttribute('type', 'text');
|
mySpan.setAttribute('type', 'text');
|
||||||
mySpan.setAttribute('maxLength', '10');
|
mySpan.setAttribute('maxLength', '10');
|
||||||
mySpan.value = 'all targets';
|
mySpan.value = 'all targets';
|
||||||
@ -23,4 +61,4 @@ window.onload =(function() {
|
|||||||
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
||||||
|
|
||||||
})();
|
})();
|
||||||
</script>" >> html/index.html
|
</script>" | tee -a docs/generic/html/index.html > /dev/null
|
||||||
|
@ -1,21 +1,59 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
rm -rf docs
|
||||||
|
|
||||||
build-docs --target esp32 --language en
|
build-docs --target esp32 --language en
|
||||||
|
|
||||||
cp -rf _build/en/esp32/html .
|
mkdir -p docs/generic
|
||||||
|
mv _build/en/esp32/html docs/generic
|
||||||
|
|
||||||
rm -rf _build __pycache__
|
rm -rf _build __pycache__
|
||||||
|
|
||||||
|
URL="https://docs.espressif.com/projects/esp-protocols/esp_websocket_client/docs/latest/index.html"
|
||||||
|
RELEASES_STR=$(curl $URL | awk '/var RELEASES = \[/,/];/' | sed 's/var RELEASES = \[//' | sed 's/];$//' | tr -d '",')
|
||||||
|
|
||||||
|
declare -a RELEASES=($RELEASES_STR)
|
||||||
|
|
||||||
|
if [ -n "$1" ] && [ -n "${1}" ]; then
|
||||||
|
RELEASES+=(\'$1\')
|
||||||
|
fi
|
||||||
|
|
||||||
|
for i in "${!RELEASES[@]}"; do
|
||||||
|
RELEASES[i]="${RELEASES[$i]},\n"
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
# Modifes some version and target fields of index.html
|
# Modifes some version and target fields of index.html
|
||||||
echo "<script type="text/javascript">
|
echo "<script type="text/javascript">
|
||||||
window.onload =(function() {
|
window.onload =(function() {
|
||||||
var myAnchor = document.getElementById('version-select');
|
var myAnchor = document.getElementById('version-select');
|
||||||
var mySpan = document.createElement('input');
|
var mySpan = document.createElement('select');
|
||||||
mySpan.setAttribute('type', 'text');
|
mySpan.style.float = 'left';
|
||||||
mySpan.setAttribute('maxLength', '10');
|
|
||||||
mySpan.value = 'latest';
|
var latest_ver = document.createElement('option');
|
||||||
mySpan.setAttribute('disabled', true);
|
latest_ver.value = 'latest';
|
||||||
|
latest_ver.textContent = 'latest(master)';
|
||||||
|
mySpan.append(latest_ver);
|
||||||
|
|
||||||
|
var RELEASES = [
|
||||||
|
$(echo -e ${RELEASES[@]})
|
||||||
|
];
|
||||||
|
for (var i = RELEASES.length - 1; i >= 0; i--) {
|
||||||
|
var current_ver = document.createElement('option');
|
||||||
|
current_ver.value = RELEASES[i];
|
||||||
|
current_ver.textContent = 'release-v'+ RELEASES[i];
|
||||||
|
mySpan.append(current_ver);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
||||||
|
mySpan.addEventListener('change', function() {
|
||||||
|
window.location.href='https://docs.espressif.com/projects/esp-protocols/esp_websocket_client/docs/'+event.target.value+'/index.html'
|
||||||
|
});
|
||||||
|
|
||||||
var myAnchor = document.getElementById('target-select');
|
var myAnchor = document.getElementById('target-select');
|
||||||
var mySpan = document.createElement('input');
|
var mySpan = document.createElement('input');
|
||||||
|
mySpan.style.float = 'left';
|
||||||
mySpan.setAttribute('type', 'text');
|
mySpan.setAttribute('type', 'text');
|
||||||
mySpan.setAttribute('maxLength', '10');
|
mySpan.setAttribute('maxLength', '10');
|
||||||
mySpan.value = 'all targets';
|
mySpan.value = 'all targets';
|
||||||
@ -23,4 +61,4 @@ window.onload =(function() {
|
|||||||
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
||||||
|
|
||||||
})();
|
})();
|
||||||
</script>" >> html/index.html
|
</script>" >> docs/generic/html/index.html
|
||||||
|
@ -1,23 +1,57 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
rm -rf docs
|
||||||
build-docs --target esp32 --language en
|
build-docs --target esp32 --language en
|
||||||
build-docs --target esp32 --language zh_CN
|
build-docs --target esp32 --language zh_CN
|
||||||
|
|
||||||
cp -rf _build/en/esp32/html en
|
mkdir -p docs/en
|
||||||
cp -rf _build/zh_CN/esp32/html zh_CN
|
mv _build/en/esp32/html docs/en
|
||||||
|
mkdir -p docs/zh_CN
|
||||||
|
mv _build/zh_CN/esp32/html docs/zh_CN
|
||||||
|
|
||||||
rm -rf _build __pycache__ tee
|
rm -rf _build __pycache__ tee
|
||||||
|
|
||||||
|
URL="https://docs.espressif.com/projects/esp-protocols/mdns/docs/latest/en/index.html"
|
||||||
|
RELEASES_STR=$(curl $URL | awk '/var RELEASES = \[/,/];/' | sed 's/var RELEASES = \[//' | sed 's/];$//' | tr -d '",')
|
||||||
|
|
||||||
|
declare -a RELEASES=($RELEASES_STR)
|
||||||
|
|
||||||
|
if [ -n "$1" ] && [ -n "${1}" ]; then
|
||||||
|
RELEASES+=(\'$1\')
|
||||||
|
fi
|
||||||
|
|
||||||
|
for i in "${!RELEASES[@]}"; do
|
||||||
|
RELEASES[i]="${RELEASES[$i]},\n"
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
# Modifes some version and target fields of index.html
|
# Modifes some version and target fields of index.html
|
||||||
echo "<script type="text/javascript">
|
echo "<script type='text/javascript'>
|
||||||
window.onload =(function() {
|
window.onload =(function() {
|
||||||
var myAnchor = document.getElementById('version-select');
|
var myAnchor = document.getElementById('version-select');
|
||||||
var mySpan = document.createElement('input');
|
var mySpan = document.createElement('select');
|
||||||
mySpan.setAttribute('type', 'text');
|
mySpan.style.float = 'left';
|
||||||
mySpan.setAttribute('maxLength', '10');
|
|
||||||
mySpan.value = 'latest';
|
|
||||||
mySpan.setAttribute('disabled', true);
|
|
||||||
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
|
||||||
|
|
||||||
|
var latest_ver = document.createElement('option');
|
||||||
|
latest_ver.value = 'latest';
|
||||||
|
latest_ver.textContent = 'latest(master)';
|
||||||
|
mySpan.append(latest_ver);
|
||||||
|
var RELEASES = [
|
||||||
|
$(echo -e ${RELEASES[@]})
|
||||||
|
];
|
||||||
|
for (var i = RELEASES.length - 1; i >= 0; i--) {
|
||||||
|
var current_ver = document.createElement('option');
|
||||||
|
current_ver.value = RELEASES[i];
|
||||||
|
current_ver.textContent = 'release-v'+ RELEASES[i];
|
||||||
|
mySpan.append(current_ver);
|
||||||
|
}
|
||||||
|
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
||||||
|
mySpan.addEventListener('change', function() {
|
||||||
|
window.location.href='https://docs.espressif.com/projects/esp-protocols/mdns/docs/'+event.target.value+'/en/index.html'
|
||||||
|
});
|
||||||
var myAnchor = document.getElementById('target-select');
|
var myAnchor = document.getElementById('target-select');
|
||||||
var mySpan = document.createElement('input');
|
var mySpan = document.createElement('input');
|
||||||
|
mySpan.style.float = 'left';
|
||||||
mySpan.setAttribute('type', 'text');
|
mySpan.setAttribute('type', 'text');
|
||||||
mySpan.setAttribute('maxLength', '10');
|
mySpan.setAttribute('maxLength', '10');
|
||||||
mySpan.value = 'all targets';
|
mySpan.value = 'all targets';
|
||||||
@ -25,4 +59,42 @@ window.onload =(function() {
|
|||||||
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
||||||
|
|
||||||
})();
|
})();
|
||||||
</script>" | tee -a html_en/index.html html_zh_CN/index.html > /dev/null
|
</script>" >> docs/en/html/index.html
|
||||||
|
|
||||||
|
# Modifes some version and target fields of index.html
|
||||||
|
echo "<script type="text/javascript">
|
||||||
|
window.onload =(function() {
|
||||||
|
var myAnchor = document.getElementById('version-select');
|
||||||
|
var mySpan = document.createElement('select');
|
||||||
|
mySpan.style.float = 'left';
|
||||||
|
|
||||||
|
var latest_ver = document.createElement('option');
|
||||||
|
latest_ver.value = 'latest';
|
||||||
|
latest_ver.textContent = 'latest(master)';
|
||||||
|
mySpan.append(latest_ver);
|
||||||
|
|
||||||
|
for (var i = RELEASES.length - 1; i >= 0; i--) {
|
||||||
|
var current_ver = document.createElement('option');
|
||||||
|
current_ver.value = RELEASES[i];
|
||||||
|
current_ver.textContent = 'release-v'+ RELEASES[i];
|
||||||
|
mySpan.append(current_ver);
|
||||||
|
}
|
||||||
|
var RELEASES = [
|
||||||
|
$(echo -e ${RELEASES[@]})
|
||||||
|
];
|
||||||
|
myAnchor.parentNode.replaceChild(mySpan, myAnchor);
|
||||||
|
mySpan.addEventListener('change', function() {
|
||||||
|
window.location.href='https://docs.espressif.com/projects/esp-protocols/mdns/docs/'+event.target.value+'/zh_CN/index.html'
|
||||||
|
});
|
||||||
|
|
||||||
|
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>" >> docs/zh_CN/html/index.html
|
||||||
|
Reference in New Issue
Block a user