diff --git a/Dockerfile b/Dockerfile index cb96532696..c43ca7742d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ # docker build -t sphinx-autobuild . # docker run -it -p 8000:8000 --rm -v "$(pwd)/source":/home/python/docs sphinx-autobuild -FROM python:3.7-alpine +FROM python:3.8-alpine COPY --chown=1000:1000 requirements.txt ./ diff --git a/source/_themes/wazuh_doc_theme_v3/config/uglifyjs-group.js b/source/_themes/wazuh_doc_theme_v3/config/uglifyjs-group.js index 2c03f23188..85b40c8ede 100644 --- a/source/_themes/wazuh_doc_theme_v3/config/uglifyjs-group.js +++ b/source/_themes/wazuh_doc_theme_v3/config/uglifyjs-group.js @@ -56,6 +56,7 @@ const pageSpecificJS = { ], "api-reference": [ SRC_PATH + "components/version-selector.js", + SRC_PATH + "components/doctools.js", SRC_PATH + "components/sphinx-search/sphinx_highlight.js", SRC_PATH + "custom-redoc.js" ], diff --git a/source/_themes/wazuh_doc_theme_v3/src/scss/pages/index.scss b/source/_themes/wazuh_doc_theme_v3/src/scss/pages/index.scss index 0acaa646f0..04d2587352 100644 --- a/source/_themes/wazuh_doc_theme_v3/src/scss/pages/index.scss +++ b/source/_themes/wazuh_doc_theme_v3/src/scss/pages/index.scss @@ -490,7 +490,6 @@ main { background-image: url("#{$ico-path}index-icons.svg#compliance-lt"); } - /* Learning Wazuh */ [href$="learning-wazuh/index.html"]::before, [data-href$="learning-wazuh/index.html"]::before { diff --git a/source/_themes/wazuh_doc_theme_v3/static/js/min/api-reference.min.js b/source/_themes/wazuh_doc_theme_v3/static/js/min/api-reference.min.js index 4c0fb40c7b..8f85ce2337 100644 --- a/source/_themes/wazuh_doc_theme_v3/static/js/min/api-reference.min.js +++ b/source/_themes/wazuh_doc_theme_v3/static/js/min/api-reference.min.js @@ -1,2 +1,2 @@ -if($(document).ready(function(){if(window.matchMedia){let n=$('head > link[rel="icon"][media]');$.each(n,function(e,t){const r=window.matchMedia(t.media);function o(){r.matches&&(n.remove(),n=$(t).appendTo("head"))}r.addListener(o),o()})}}),"undefined"==typeof versions){const versions=[]}!function(r){window.matchMedia("(hover: hover)").matches&&(r(".navbar-nav .dropdown-toggle").on("mouseenter",function(e){r(this).closest(".dropdown").hasClass("show")||(e.stopPropagation(),r(this).trigger("click"))}),r(".navbar-nav .dropdown-toggle").on("mouseleave",function(e){var t=e.toElement||e.relatedTarget;r(this).closest(".dropdown").hasClass("show")&&t!==r(this).siblings()[0]&&(e.stopPropagation(),r(this).trigger("click"))}),r(".navbar-nav .dropdown-menu").on("mouseleave",function(e){e=e.toElement||e.relatedTarget;r(this).closest(".dropdown").hasClass("show")&&e!==r(this).siblings()[0]&&r(this).siblings().trigger("click")}))}(jQuery);const minVersionRedoc="4.0",useApiRedoc=0<=compareVersion(DOCUMENTATION_OPTIONS.VERSION,minVersionRedoc),newTabNodes=["user-manual/api/reference","cloud-service/apis/reference"];let oursHost=["documentation.wazuh.com"];function compareVersion(r,o){let n=!1;if("string"==typeof r&&"string"==typeof o){let e=r.split("."),t=o.split(".");2<=e.length&&2<=t.length&&(e=e.map(e=>parseInt(e)),t=t.map(e=>parseInt(e)),n=e[0]>t[0]?1:e[0]t[1]?1:e[1]=parseInt(E))&&delete a[r]}return a}(h,f,i,newUrls,redirections,removedUrls);h=h.reverse();for(let e=0;e Version "+g[e]+(0==e?" (current)":"")+"",a==g[0]&&u(".no-latest-notice .link-latest").attr("href",l);return e.html(n),d}function p(t){if(Array.isArray(t))return t;{let e=t.trim();return"/"==(e="#"==(e=(e=e.replace(/\/$/,"/index.html")).replace(/\/{2,}/,"/")).charAt(e.length-1)?e.substring(0,e.length-1):e).charAt(e.length-1)||/.*(\.html|#.*)$/.test(e)||(e+="/"),e=checkEncodeURI(e="/"!=e.charAt(0)?"/"+e:e)?e:encodeURI(e)}}function I(e,t){let r=-1;for(i in t)e==t[i]&&(r=i);return r}function N(e,t){var r=[];for(forId in t)if({}.hasOwnProperty.call(t,forId))for(forRelease in t[forId])"target"!=forRelease&&e==t[forId][forRelease]&&r.push(t[forId]);return r}function T(e,t,r){for(var o=[],n=t;n.length;){var i,s,a,l=n.pop();for(forTarget in l.target)({}).hasOwnProperty.call(l.target,forTarget)&&(i=l.target[forTarget].split("=>"),s=parseInt(I(i[0],r)),a=parseInt(I(i[1],r)),e.page==l[i[0]])&&("toBottom"!=e.direction&&s=s&&o.push({release:i[1],direction:"toBottom",url:l[i[1]]})}return o}function b(e,t,r,o){var n,s=[];for(forVersions in o)({}).hasOwnProperty.call(o,forVersions)&&(forVersions=parseInt(forVersions),"toBottom"==e&&forVersionse&&null!=r[t[i]]&&-1==o&&(o=i);return o}(forVersions,o,t))&&(s[o[forVersions]]=t[o[n]]):s[o[forVersions]]=t[o[forVersions]]),"toTop"==e)&&forVersions>=r&&(null==t[o[forVersions]]?0!=forVersions&&-1!=(n=function(e,t,r){let o=-1;for(i in t)({}).hasOwnProperty.call(t,i)&&(i=parseInt(i))>=e&&null!=r[t[i-1]]&&-1==o&&(o=i-1);return o}(forVersions,o,s))&&(s[o[forVersions]]=s[o[n]]):s[o[forVersions]]=t[o[forVersions]]);return s}e==g[0]&&(e="current"),document.querySelector("link[rel='canonical']")||((s=document.createElement("link")).setAttribute("rel","canonical"),s.setAttribute("href",document.location.protocol+"//"+document.location.host+"/"+e+a),document.head.appendChild(s)),u('#version-selector [data-toggle="tooltip"]').tooltip({container:"header"})}),$("#version-selector a.disable").click(function(e){return e.preventDefault(),e.stopPropagation(),!1});"use strict";const SPHINX_HIGHLIGHT_ENABLED=!0,_highlight=(t,r,o,n)=>{if(t.nodeType===Node.TEXT_NODE){var i=t.nodeValue,s=t.parentNode,a=i.toLowerCase().indexOf(o);if(0<=a&&!s.classList.contains(n)&&!s.classList.contains("nohighlight")){let e;var l=s.closest("body, svg, foreignObject"),l=l&&l.matches("svg");l?e=document.createElementNS("http://www.w3.org/2000/svg","tspan"):(e=document.createElement("span")).classList.add(n),e.appendChild(document.createTextNode(i.substr(a,o.length))),s.insertBefore(e,s.insertBefore(document.createTextNode(i.substr(a+o.length)),t.nextSibling)),t.nodeValue=i.substr(0,a),l&&(i=document.createElementNS("http://www.w3.org/2000/svg","rect"),a=s.getBBox(),i.x.baseVal.value=a.x,i.y.baseVal.value=a.y,i.width.baseVal.value=a.width,i.height.baseVal.value=a.height,i.setAttribute("class",n),r.push({parent:s,target:i}))}}else t.matches&&!t.matches("button, select, textarea")&&t.childNodes.forEach(e=>_highlight(e,r,o,n))},_highlightText=(e,t,r)=>{var o=[];_highlight(e,o,t,r),o.forEach(e=>e.parent.insertAdjacentElement("beforebegin",e.target))},SphinxHighlight={highlightSearchWords:()=>{if(SPHINX_HIGHLIGHT_ENABLED){var e=new URL(window.location),t=localStorage.getItem("sphinx_highlight_terms")||e.searchParams.get("highlight")||"";localStorage.removeItem("sphinx_highlight_terms"),e.searchParams.delete("highlight"),window.history.replaceState({},"",e);const r=t.toLowerCase().split(/\s+/).filter(e=>e);if(0!==r.length){e=document.querySelectorAll("main>section");const o=e.length?e[0]:document.querySelector("body");window.setTimeout(()=>{r.forEach(e=>_highlightText(o,e,"highlighted"))},10);t=document.getElementById("searchbox");null!==t&&t.appendChild(document.createRange().createContextualFragment('"))}}},hideSearchWords:()=>{document.querySelectorAll("#searchbox .highlight-link").forEach(e=>e.remove()),document.querySelectorAll("span.highlighted").forEach(e=>e.classList.remove("highlighted")),localStorage.removeItem("sphinx_highlight_terms")},initEscapeListener:()=>{DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS&&document.addEventListener("keydown",e=>{BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)||e.shiftKey||e.altKey||e.ctrlKey||e.metaKey||DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS&&"Escape"===e.key&&(SphinxHighlight.hideSearchWords(),e.preventDefault())})}};function init(){new MutationObserver(function(e,t){for(i=0;i link[rel="icon"][media]');$.each(o,function(e,t){const r=window.matchMedia(t.media);function n(){r.matches&&(o.remove(),o=$(t).appendTo("head"))}r.addListener(n),n()})}}),"undefined"==typeof versions){const versions=[]}!function(r){window.matchMedia("(hover: hover)").matches&&(r(".navbar-nav .dropdown-toggle").on("mouseenter",function(e){r(this).closest(".dropdown").hasClass("show")||(e.stopPropagation(),r(this).trigger("click"))}),r(".navbar-nav .dropdown-toggle").on("mouseleave",function(e){var t=e.toElement||e.relatedTarget;r(this).closest(".dropdown").hasClass("show")&&t!==r(this).siblings()[0]&&(e.stopPropagation(),r(this).trigger("click"))}),r(".navbar-nav .dropdown-menu").on("mouseleave",function(e){e=e.toElement||e.relatedTarget;r(this).closest(".dropdown").hasClass("show")&&e!==r(this).siblings()[0]&&r(this).siblings().trigger("click")}))}(jQuery);const minVersionRedoc="4.0",useApiRedoc=0<=compareVersion(DOCUMENTATION_OPTIONS.VERSION,minVersionRedoc),newTabNodes=["user-manual/api/reference","cloud-service/apis/reference"];let oursHost=["documentation.wazuh.com"];function compareVersion(r,n){let o=!1;if("string"==typeof r&&"string"==typeof n){let e=r.split("."),t=n.split(".");2<=e.length&&2<=t.length&&(e=e.map(e=>parseInt(e)),t=t.map(e=>parseInt(e)),o=e[0]>t[0]?1:e[0]t[1]?1:e[1]=parseInt(S))&&delete a[r]}return a}(h,f,i,newUrls,redirections,removedUrls);h=h.reverse();for(let e=0;e Version "+g[e]+(0==e?" (current)":"")+"",a==g[0]&&u(".no-latest-notice .link-latest").attr("href",l);return e.html(o),d}function p(t){if(Array.isArray(t))return t;{let e=t.trim();return"/"==(e="#"==(e=(e=e.replace(/\/$/,"/index.html")).replace(/\/{2,}/,"/")).charAt(e.length-1)?e.substring(0,e.length-1):e).charAt(e.length-1)||/.*(\.html|#.*)$/.test(e)||(e+="/"),e=checkEncodeURI(e="/"!=e.charAt(0)?"/"+e:e)?e:encodeURI(e)}}function N(e,t){let r=-1;for(i in t)e==t[i]&&(r=i);return r}function v(e,t){var r=[];for(forId in t)if({}.hasOwnProperty.call(t,forId))for(forRelease in t[forId])"target"!=forRelease&&e==t[forId][forRelease]&&r.push(t[forId]);return r}function I(e,t,r){for(var n=[],o=t;o.length;){var i,s,a,l=o.pop();for(forTarget in l.target)({}).hasOwnProperty.call(l.target,forTarget)&&(i=l.target[forTarget].split("=>"),s=parseInt(N(i[0],r)),a=parseInt(N(i[1],r)),e.page==l[i[0]])&&("toBottom"!=e.direction&&s=s&&n.push({release:i[1],direction:"toBottom",url:l[i[1]]})}return n}function A(e,t,r,n){var o,s=[];for(forVersions in n)({}).hasOwnProperty.call(n,forVersions)&&(forVersions=parseInt(forVersions),"toBottom"==e&&forVersionse&&null!=r[t[i]]&&-1==n&&(n=i);return n}(forVersions,n,t))&&(s[n[forVersions]]=t[n[o]]):s[n[forVersions]]=t[n[forVersions]]),"toTop"==e)&&forVersions>=r&&(null==t[n[forVersions]]?0!=forVersions&&-1!=(o=function(e,t,r){let n=-1;for(i in t)({}).hasOwnProperty.call(t,i)&&(i=parseInt(i))>=e&&null!=r[t[i-1]]&&-1==n&&(n=i-1);return n}(forVersions,n,s))&&(s[n[forVersions]]=s[n[o]]):s[n[forVersions]]=t[n[forVersions]]);return s}e==g[0]&&(e="current"),document.querySelector("link[rel='canonical']")||((s=document.createElement("link")).setAttribute("rel","canonical"),s.setAttribute("href",document.location.protocol+"//"+document.location.host+"/"+e+a),document.head.appendChild(s)),u('#version-selector [data-toggle="tooltip"]').tooltip({container:"header"})}),$("#version-selector a.disable").click(function(e){return e.preventDefault(),e.stopPropagation(),!1});"use strict";const BLACKLISTED_KEY_CONTROL_ELEMENTS=new Set(["TEXTAREA","INPUT","SELECT","BUTTON"]),_ready=e=>{"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)},Documentation={init:()=>{Documentation.initDomainIndexTable(),Documentation.initOnKeyListeners()},TRANSLATIONS:{},PLURAL_EXPR:e=>1===e?0:1,LOCALE:"unknown",gettext:e=>{var t=Documentation.TRANSLATIONS[e];switch(typeof t){case"undefined":return e;case"string":return t;default:return t[0]}},ngettext:(e,t,r)=>{var n=Documentation.TRANSLATIONS[e];return"undefined"!=typeof n?n[Documentation.PLURAL_EXPR(r)]:1===r?e:t},addTranslations:e=>{Object.assign(Documentation.TRANSLATIONS,e.messages),Documentation.PLURAL_EXPR=new Function("n",`return (${e.plural_expr})`),Documentation.LOCALE=e.locale},focusSearchBar:()=>{document.querySelectorAll("input[name=q]")[0]?.focus()},initDomainIndexTable:()=>{const t=e=>{var t=e.id.substr(7),t=document.querySelectorAll("tr.cg-"+t);"minus.png"===e.src.substr(-9)?(e.src=e.src.substr(0,e.src.length-9)+"plus.png",t.forEach(e=>e.style.display="none")):(e.src=e.src.substr(0,e.src.length-8)+"minus.png",t.forEach(e=>e.style.display=""))};var e=document.querySelectorAll("img.toggler");e.forEach(e=>e.addEventListener("click",e=>t(e.currentTarget))),e.forEach(e=>e.style.display=""),DOCUMENTATION_OPTIONS.COLLAPSE_INDEX&&e.forEach(t)},initOnKeyListeners:()=>{(DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS||DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS)&&document.addEventListener("keydown",e=>{if(!BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)&&!(e.altKey||e.ctrlKey||e.metaKey)){if(!e.shiftKey)switch(e.key){case"ArrowLeft":DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS&&(t=document.querySelector('link[rel="prev"]'))&&t.href&&(window.location.href=t.href,e.preventDefault());break;case"ArrowRight":var t;DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS&&(t=document.querySelector('link[rel="next"]'))&&t.href&&(window.location.href=t.href,e.preventDefault())}"/"===e.key&&DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS&&(Documentation.focusSearchBar(),e.preventDefault())}})}},_=Documentation.gettext,SPHINX_HIGHLIGHT_ENABLED=(_ready(Documentation.init),!0),_highlight=(t,r,n,o)=>{if(t.nodeType===Node.TEXT_NODE){var i=t.nodeValue,s=t.parentNode,a=i.toLowerCase().indexOf(n);if(0<=a&&!s.classList.contains(o)&&!s.classList.contains("nohighlight")){let e;var l=s.closest("body, svg, foreignObject"),l=l&&l.matches("svg");l?e=document.createElementNS("http://www.w3.org/2000/svg","tspan"):(e=document.createElement("span")).classList.add(o),e.appendChild(document.createTextNode(i.substr(a,n.length))),s.insertBefore(e,s.insertBefore(document.createTextNode(i.substr(a+n.length)),t.nextSibling)),t.nodeValue=i.substr(0,a),l&&(i=document.createElementNS("http://www.w3.org/2000/svg","rect"),a=s.getBBox(),i.x.baseVal.value=a.x,i.y.baseVal.value=a.y,i.width.baseVal.value=a.width,i.height.baseVal.value=a.height,i.setAttribute("class",o),r.push({parent:s,target:i}))}}else t.matches&&!t.matches("button, select, textarea")&&t.childNodes.forEach(e=>_highlight(e,r,n,o))},_highlightText=(e,t,r)=>{var n=[];_highlight(e,n,t,r),n.forEach(e=>e.parent.insertAdjacentElement("beforebegin",e.target))},SphinxHighlight={highlightSearchWords:()=>{if(SPHINX_HIGHLIGHT_ENABLED){var e=new URL(window.location),t=localStorage.getItem("sphinx_highlight_terms")||e.searchParams.get("highlight")||"";localStorage.removeItem("sphinx_highlight_terms"),e.searchParams.delete("highlight"),window.history.replaceState({},"",e);const r=t.toLowerCase().split(/\s+/).filter(e=>e);if(0!==r.length){e=document.querySelectorAll("main>section");const n=e.length?e[0]:document.querySelector("body");window.setTimeout(()=>{r.forEach(e=>_highlightText(n,e,"highlighted"))},10);t=document.getElementById("searchbox");null!==t&&t.appendChild(document.createRange().createContextualFragment('"))}}},hideSearchWords:()=>{document.querySelectorAll("#searchbox .highlight-link").forEach(e=>e.remove()),document.querySelectorAll("span.highlighted").forEach(e=>e.classList.remove("highlighted")),localStorage.removeItem("sphinx_highlight_terms")},initEscapeListener:()=>{DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS&&document.addEventListener("keydown",e=>{BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)||e.shiftKey||e.altKey||e.ctrlKey||e.metaKey||DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS&&"Escape"===e.key&&(SphinxHighlight.hideSearchWords(),e.preventDefault())})}};function init(){new MutationObserver(function(e,t){for(i=0;i