From 23a24e0f2253b13bcf8d0d5fa30c2a9b268ce1a0 Mon Sep 17 00:00:00 2001 From: vint2k Date: Thu, 18 Apr 2024 08:59:15 +0000 Subject: [PATCH] deploy: 55817c112aa7584ec05b38e73b8a7bdca95f64a7 --- pr/278/.buildinfo | 2 +- pr/278/_static/basic.css | 2 +- pr/278/_static/doctools.js | 2 +- pr/278/_static/language_data.js | 4 +- pr/278/_static/searchtools.js | 163 +++++++++++++++--------- pr/278/api_facts_module.html | 6 +- pr/278/api_find_and_modify_module.html | 6 +- pr/278/api_info_module.html | 13 +- pr/278/api_modify_module.html | 13 +- pr/278/api_module.html | 6 +- pr/278/command_module.html | 6 +- pr/278/docsite/api-guide.html | 2 +- pr/278/docsite/quoting.html | 2 +- pr/278/docsite/ssh-guide.html | 2 +- pr/278/environment_variables.html | 4 +- pr/278/facts_module.html | 6 +- pr/278/index.html | 6 +- pr/278/join_filter.html | 6 +- pr/278/list_to_dict_filter.html | 6 +- pr/278/quote_argument_filter.html | 6 +- pr/278/quote_argument_value_filter.html | 6 +- pr/278/routeros_cliconf.html | 6 +- pr/278/search.html | 2 +- pr/278/searchindex.js | 2 +- pr/278/split_filter.html | 6 +- 25 files changed, 172 insertions(+), 113 deletions(-) diff --git a/pr/278/.buildinfo b/pr/278/.buildinfo index 8f2816b..81e43cc 100644 --- a/pr/278/.buildinfo +++ b/pr/278/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: b429fdd6ec614bc0e6a7a23863d010fe +config: 9a17ea2b03ea77011284d03100e164d0 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/pr/278/_static/basic.css b/pr/278/_static/basic.css index 30fee9d..f316efc 100644 --- a/pr/278/_static/basic.css +++ b/pr/278/_static/basic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/pr/278/_static/doctools.js b/pr/278/_static/doctools.js index d06a71d..4d67807 100644 --- a/pr/278/_static/doctools.js +++ b/pr/278/_static/doctools.js @@ -4,7 +4,7 @@ * * Base JavaScript utilities for all Sphinx HTML documentation. * - * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/pr/278/_static/language_data.js b/pr/278/_static/language_data.js index 250f566..367b8ed 100644 --- a/pr/278/_static/language_data.js +++ b/pr/278/_static/language_data.js @@ -5,7 +5,7 @@ * This script contains the language-specific data used by searchtools.js, * namely the list of stopwords, stemmer, scorer and splitter. * - * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -13,7 +13,7 @@ var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; -/* Non-minified version is copied as a separate JS file, is available */ +/* Non-minified version is copied as a separate JS file, if available */ /** * Porter Stemmer diff --git a/pr/278/_static/searchtools.js b/pr/278/_static/searchtools.js index 7918c3f..92da3f8 100644 --- a/pr/278/_static/searchtools.js +++ b/pr/278/_static/searchtools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for the full-text search. * - * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -99,7 +99,7 @@ const _displayItem = (item, searchTerms, highlightTerms) => { .then((data) => { if (data) listItem.appendChild( - Search.makeSearchSummary(data, searchTerms) + Search.makeSearchSummary(data, searchTerms, anchor) ); // highlight search terms in the summary if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js @@ -116,8 +116,8 @@ const _finishSearch = (resultCount) => { ); else Search.status.innerText = _( - `Search finished, found ${resultCount} page(s) matching the search query.` - ); + "Search finished, found ${resultCount} page(s) matching the search query." + ).replace('${resultCount}', resultCount); }; const _displayNextItem = ( results, @@ -137,6 +137,22 @@ const _displayNextItem = ( // search finished, update title and status message else _finishSearch(resultCount); }; +// Helper function used by query() to order search results. +// Each input is an array of [docname, title, anchor, descr, score, filename]. +// Order the results by score (in opposite order of appearance, since the +// `_displayNextItem` function uses pop() to retrieve items) and then alphabetically. +const _orderResultsByScoreThenName = (a, b) => { + const leftScore = a[4]; + const rightScore = b[4]; + if (leftScore === rightScore) { + // same score: sort alphabetically + const leftTitle = a[1].toLowerCase(); + const rightTitle = b[1].toLowerCase(); + if (leftTitle === rightTitle) return 0; + return leftTitle > rightTitle ? -1 : 1; // inverted is intentional + } + return leftScore > rightScore ? 1 : -1; +}; /** * Default splitQuery function. Can be overridden in ``sphinx.search`` with a @@ -160,13 +176,26 @@ const Search = { _queued_query: null, _pulse_status: -1, - htmlToText: (htmlString) => { + htmlToText: (htmlString, anchor) => { const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); - htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() }); + for (const removalQuery of [".headerlinks", "script", "style"]) { + htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() }); + } + if (anchor) { + const anchorContent = htmlElement.querySelector(`[role="main"] ${anchor}`); + if (anchorContent) return anchorContent.textContent; + + console.warn( + `Anchored content block not found. Sphinx search tries to obtain it via DOM query '[role=main] ${anchor}'. Check your theme or template.` + ); + } + + // if anchor not specified or not found, fall back to main content const docContent = htmlElement.querySelector('[role="main"]'); - if (docContent !== undefined) return docContent.textContent; + if (docContent) return docContent.textContent; + console.warn( - "Content block not found. Sphinx search tries to obtain it via '[role=main]'. Could you check your theme or template." + "Content block not found. Sphinx search tries to obtain it via DOM query '[role=main]'. Check your theme or template." ); return ""; }, @@ -239,16 +268,7 @@ const Search = { else Search.deferQuery(query); }, - /** - * execute search (requires search index to be loaded) - */ - query: (query) => { - const filenames = Search._index.filenames; - const docNames = Search._index.docnames; - const titles = Search._index.titles; - const allTitles = Search._index.alltitles; - const indexEntries = Search._index.indexentries; - + _parseQuery: (query) => { // stem the search terms and add them to the correct list const stemmer = new Stemmer(); const searchTerms = new Set(); @@ -284,16 +304,32 @@ const Search = { // console.info("required: ", [...searchTerms]); // console.info("excluded: ", [...excludedTerms]); - // array of [docname, title, anchor, descr, score, filename] - let results = []; + return [query, searchTerms, excludedTerms, highlightTerms, objectTerms]; + }, + + /** + * execute search (requires search index to be loaded) + */ + _performSearch: (query, searchTerms, excludedTerms, highlightTerms, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + const allTitles = Search._index.alltitles; + const indexEntries = Search._index.indexentries; + + // Collect multiple result groups to be sorted separately and then ordered. + // Each is an array of [docname, title, anchor, descr, score, filename]. + const normalResults = []; + const nonMainIndexResults = []; + _removeChildren(document.getElementById("search-progress")); - const queryLower = query.toLowerCase(); + const queryLower = query.toLowerCase().trim(); for (const [title, foundTitles] of Object.entries(allTitles)) { - if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) { + if (title.toLowerCase().trim().includes(queryLower) && (queryLower.length >= title.length/2)) { for (const [file, id] of foundTitles) { let score = Math.round(100 * queryLower.length / title.length) - results.push([ + normalResults.push([ docNames[file], titles[file] !== title ? `${titles[file]} > ${title}` : title, id !== null ? "#" + id : "", @@ -308,46 +344,47 @@ const Search = { // search for explicit entries in index directives for (const [entry, foundEntries] of Object.entries(indexEntries)) { if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) { - for (const [file, id] of foundEntries) { - let score = Math.round(100 * queryLower.length / entry.length) - results.push([ + for (const [file, id, isMain] of foundEntries) { + const score = Math.round(100 * queryLower.length / entry.length); + const result = [ docNames[file], titles[file], id ? "#" + id : "", null, score, filenames[file], - ]); + ]; + if (isMain) { + normalResults.push(result); + } else { + nonMainIndexResults.push(result); + } } } } // lookup as object objectTerms.forEach((term) => - results.push(...Search.performObjectSearch(term, objectTerms)) + normalResults.push(...Search.performObjectSearch(term, objectTerms)) ); // lookup as search terms in fulltext - results.push(...Search.performTermsSearch(searchTerms, excludedTerms)); + normalResults.push(...Search.performTermsSearch(searchTerms, excludedTerms)); // let the scorer override scores with a custom scoring function - if (Scorer.score) results.forEach((item) => (item[4] = Scorer.score(item))); + if (Scorer.score) { + normalResults.forEach((item) => (item[4] = Scorer.score(item))); + nonMainIndexResults.forEach((item) => (item[4] = Scorer.score(item))); + } - // now sort the results by score (in opposite order of appearance, since the - // display function below uses pop() to retrieve items) and then - // alphabetically - results.sort((a, b) => { - const leftScore = a[4]; - const rightScore = b[4]; - if (leftScore === rightScore) { - // same score: sort alphabetically - const leftTitle = a[1].toLowerCase(); - const rightTitle = b[1].toLowerCase(); - if (leftTitle === rightTitle) return 0; - return leftTitle > rightTitle ? -1 : 1; // inverted is intentional - } - return leftScore > rightScore ? 1 : -1; - }); + // Sort each group of results by score and then alphabetically by name. + normalResults.sort(_orderResultsByScoreThenName); + nonMainIndexResults.sort(_orderResultsByScoreThenName); + + // Combine the result groups in (reverse) order. + // Non-main index entries are typically arbitrary cross-references, + // so display them after other results. + let results = [...nonMainIndexResults, ...normalResults]; // remove duplicate search results // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept @@ -361,7 +398,12 @@ const Search = { return acc; }, []); - results = results.reverse(); + return results.reverse(); + }, + + query: (query) => { + const [searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms] = Search._parseQuery(query); + const results = Search._performSearch(searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms); // for debugging //Search.lastresults = results.slice(); // a copy @@ -466,14 +508,18 @@ const Search = { // add support for partial matches if (word.length > 2) { const escapedWord = _escapeRegExp(word); - Object.keys(terms).forEach((term) => { - if (term.match(escapedWord) && !terms[word]) - arr.push({ files: terms[term], score: Scorer.partialTerm }); - }); - Object.keys(titleTerms).forEach((term) => { - if (term.match(escapedWord) && !titleTerms[word]) - arr.push({ files: titleTerms[word], score: Scorer.partialTitle }); - }); + if (!terms.hasOwnProperty(word)) { + Object.keys(terms).forEach((term) => { + if (term.match(escapedWord)) + arr.push({ files: terms[term], score: Scorer.partialTerm }); + }); + } + if (!titleTerms.hasOwnProperty(word)) { + Object.keys(titleTerms).forEach((term) => { + if (term.match(escapedWord)) + arr.push({ files: titleTerms[term], score: Scorer.partialTitle }); + }); + } } // no match but word was a required one @@ -496,9 +542,8 @@ const Search = { // create the mapping files.forEach((file) => { - if (fileMap.has(file) && fileMap.get(file).indexOf(word) === -1) - fileMap.get(file).push(word); - else fileMap.set(file, [word]); + if (!fileMap.has(file)) fileMap.set(file, [word]); + else if (fileMap.get(file).indexOf(word) === -1) fileMap.get(file).push(word); }); }); @@ -549,8 +594,8 @@ const Search = { * search summary for a given text. keywords is a list * of stemmed words. */ - makeSearchSummary: (htmlText, keywords) => { - const text = Search.htmlToText(htmlText); + makeSearchSummary: (htmlText, keywords, anchor) => { + const text = Search.htmlToText(htmlText, anchor); if (text === "") return null; const textLower = text.toLowerCase(); diff --git a/pr/278/api_facts_module.html b/pr/278/api_facts_module.html index 1a15688..da7d10c 100644 --- a/pr/278/api_facts_module.html +++ b/pr/278/api_facts_module.html @@ -2,7 +2,7 @@ - + community.routeros.api_facts module – Collect facts from remote devices running MikroTik RouterOS using the API — Community.Routeros Collection documentation @@ -20,7 +20,7 @@ - + @@ -145,7 +145,7 @@

community.routeros.api_facts module – Collect facts from remote devices running MikroTik RouterOS using the API

Note

-

This module is part of the community.routeros collection (version 2.14.0).

+

This module is part of the community.routeros collection (version 2.15.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.routeros. diff --git a/pr/278/api_find_and_modify_module.html b/pr/278/api_find_and_modify_module.html index ca5a18c..800ccd0 100644 --- a/pr/278/api_find_and_modify_module.html +++ b/pr/278/api_find_and_modify_module.html @@ -2,7 +2,7 @@ - + community.routeros.api_find_and_modify module – Find and modify information using the API — Community.Routeros Collection documentation @@ -20,7 +20,7 @@ - + @@ -146,7 +146,7 @@

community.routeros.api_find_and_modify module – Find and modify information using the API

Note

-

This module is part of the community.routeros collection (version 2.14.0).

+

This module is part of the community.routeros collection (version 2.15.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.routeros. diff --git a/pr/278/api_info_module.html b/pr/278/api_info_module.html index 46dce28..c467934 100644 --- a/pr/278/api_info_module.html +++ b/pr/278/api_info_module.html @@ -2,7 +2,7 @@ - + community.routeros.api_info module – Retrieve information from API — Community.Routeros Collection documentation @@ -20,7 +20,7 @@ - + @@ -145,7 +145,7 @@

community.routeros.api_info module – Retrieve information from API

Note

-

This module is part of the community.routeros collection (version 2.14.0).

+

This module is part of the community.routeros collection (version 2.15.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.routeros. @@ -351,6 +351,7 @@ see "interface ovpn-server server"

  • "interface ppp-client"

  • "interface pppoe-client"

  • +
  • "interface pppoe-server server"

  • "interface pptp-server server"

  • "interface sstp-server server"

  • "interface vlan"

  • @@ -451,13 +452,19 @@ see
    "ipv6 route"

  • "ipv6 settings"

  • "mpls"

  • +
  • "mpls interface"

  • "mpls ldp"

  • +
  • "mpls ldp accept-filter"

  • +
  • "mpls ldp advertise-filter"

  • +
  • "mpls ldp interface"

  • "port firmware"

  • "port remote-access"

  • "ppp aaa"

  • "ppp profile"

  • "queue interface"

  • +
  • "queue simple"

  • "queue tree"

  • +
  • "queue type"

  • "radius"

  • "radius incoming"

  • "routing bgp connection"

  • diff --git a/pr/278/api_modify_module.html b/pr/278/api_modify_module.html index c343833..9a1ec76 100644 --- a/pr/278/api_modify_module.html +++ b/pr/278/api_modify_module.html @@ -2,7 +2,7 @@ - + community.routeros.api_modify module – Modify data at paths with API — Community.Routeros Collection documentation @@ -20,7 +20,7 @@ - + @@ -146,7 +146,7 @@

    community.routeros.api_modify module – Modify data at paths with API

    Note

    -

    This module is part of the community.routeros collection (version 2.14.0).

    +

    This module is part of the community.routeros collection (version 2.15.0).

    It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

    To install it, use: ansible-galaxy collection install community.routeros. @@ -371,6 +371,7 @@ see "interface ovpn-server server"

  • "interface ppp-client"

  • "interface pppoe-client"

  • +
  • "interface pppoe-server server"

  • "interface pptp-server server"

  • "interface sstp-server server"

  • "interface vlan"

  • @@ -471,13 +472,19 @@ see
    "ipv6 route"

  • "ipv6 settings"

  • "mpls"

  • +
  • "mpls interface"

  • "mpls ldp"

  • +
  • "mpls ldp accept-filter"

  • +
  • "mpls ldp advertise-filter"

  • +
  • "mpls ldp interface"

  • "port firmware"

  • "port remote-access"

  • "ppp aaa"

  • "ppp profile"

  • "queue interface"

  • +
  • "queue simple"

  • "queue tree"

  • +
  • "queue type"

  • "radius"

  • "radius incoming"

  • "routing bgp connection"

  • diff --git a/pr/278/api_module.html b/pr/278/api_module.html index 22ac4cf..ecdfafe 100644 --- a/pr/278/api_module.html +++ b/pr/278/api_module.html @@ -2,7 +2,7 @@ - + community.routeros.api module – Ansible module for RouterOS API — Community.Routeros Collection documentation @@ -20,7 +20,7 @@ - + @@ -146,7 +146,7 @@

    community.routeros.api module – Ansible module for RouterOS API

    Note

    -

    This module is part of the community.routeros collection (version 2.14.0).

    +

    This module is part of the community.routeros collection (version 2.15.0).

    It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

    To install it, use: ansible-galaxy collection install community.routeros. diff --git a/pr/278/command_module.html b/pr/278/command_module.html index d50b079..d2003dd 100644 --- a/pr/278/command_module.html +++ b/pr/278/command_module.html @@ -2,7 +2,7 @@ - + community.routeros.command module – Run commands on remote devices running MikroTik RouterOS — Community.Routeros Collection documentation @@ -20,7 +20,7 @@ - + @@ -145,7 +145,7 @@

    community.routeros.command module – Run commands on remote devices running MikroTik RouterOS

    Note

    -

    This module is part of the community.routeros collection (version 2.14.0).

    +

    This module is part of the community.routeros collection (version 2.15.0).

    It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

    To install it, use: ansible-galaxy collection install community.routeros.

    diff --git a/pr/278/docsite/api-guide.html b/pr/278/docsite/api-guide.html index e3983fa..6582f16 100644 --- a/pr/278/docsite/api-guide.html +++ b/pr/278/docsite/api-guide.html @@ -19,7 +19,7 @@ - + diff --git a/pr/278/docsite/quoting.html b/pr/278/docsite/quoting.html index e4b7652..572c7c1 100644 --- a/pr/278/docsite/quoting.html +++ b/pr/278/docsite/quoting.html @@ -19,7 +19,7 @@ - + diff --git a/pr/278/docsite/ssh-guide.html b/pr/278/docsite/ssh-guide.html index 800dff3..b333e06 100644 --- a/pr/278/docsite/ssh-guide.html +++ b/pr/278/docsite/ssh-guide.html @@ -19,7 +19,7 @@ - + diff --git a/pr/278/environment_variables.html b/pr/278/environment_variables.html index dc55e83..587df4c 100644 --- a/pr/278/environment_variables.html +++ b/pr/278/environment_variables.html @@ -2,7 +2,7 @@ - + Index of all Collection Environment Variables — Community.Routeros Collection documentation @@ -20,7 +20,7 @@ - + diff --git a/pr/278/facts_module.html b/pr/278/facts_module.html index 1226f46..7b33378 100644 --- a/pr/278/facts_module.html +++ b/pr/278/facts_module.html @@ -2,7 +2,7 @@ - + community.routeros.facts module – Collect facts from remote devices running MikroTik RouterOS — Community.Routeros Collection documentation @@ -20,7 +20,7 @@ - + @@ -144,7 +144,7 @@

    community.routeros.facts module – Collect facts from remote devices running MikroTik RouterOS

    Note

    -

    This module is part of the community.routeros collection (version 2.14.0).

    +

    This module is part of the community.routeros collection (version 2.15.0).

    It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

    To install it, use: ansible-galaxy collection install community.routeros.

    diff --git a/pr/278/index.html b/pr/278/index.html index 3948a7e..32d1b49 100644 --- a/pr/278/index.html +++ b/pr/278/index.html @@ -2,7 +2,7 @@ - + Community.Routeros — Community.Routeros Collection documentation @@ -20,7 +20,7 @@ - + @@ -127,7 +127,7 @@

    Community.Routeros

    -

    Collection version 2.14.0

    +

    Collection version 2.15.0