diff --git a/.buildinfo b/.buildinfo
index 7e15ee00..f99c1d96 100644
--- a/.buildinfo
+++ b/.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: 275593b5ad3c3b3761aa74eefa992490
+config: 5c96c2ecb544cf35c053d5c4b96d6eb9
tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/.doctrees/contributing.doctree b/.doctrees/contributing.doctree
index 3432f565..44b28e25 100644
Binary files a/.doctrees/contributing.doctree and b/.doctrees/contributing.doctree differ
diff --git a/.doctrees/env_vars.doctree b/.doctrees/env_vars.doctree
index 85e310d1..94bd6b81 100644
Binary files a/.doctrees/env_vars.doctree and b/.doctrees/env_vars.doctree differ
diff --git a/.doctrees/environment.pickle b/.doctrees/environment.pickle
index 1b1b4994..d1aadf23 100644
Binary files a/.doctrees/environment.pickle and b/.doctrees/environment.pickle differ
diff --git a/.doctrees/global_options.doctree b/.doctrees/global_options.doctree
index 0f88de51..e225f57a 100644
Binary files a/.doctrees/global_options.doctree and b/.doctrees/global_options.doctree differ
diff --git a/.doctrees/guides/args_guide.doctree b/.doctrees/guides/args_guide.doctree
index 241bc530..ed3ee0a0 100644
Binary files a/.doctrees/guides/args_guide.doctree and b/.doctrees/guides/args_guide.doctree differ
diff --git a/.doctrees/guides/composition_guide.doctree b/.doctrees/guides/composition_guide.doctree
index 06d99b2d..827a70fb 100644
Binary files a/.doctrees/guides/composition_guide.doctree and b/.doctrees/guides/composition_guide.doctree differ
diff --git a/.doctrees/guides/global_tasks.doctree b/.doctrees/guides/global_tasks.doctree
index d9879a1f..c66d7413 100644
Binary files a/.doctrees/guides/global_tasks.doctree and b/.doctrees/guides/global_tasks.doctree differ
diff --git a/.doctrees/guides/help_guide.doctree b/.doctrees/guides/help_guide.doctree
index 8fd8aa48..5cdd824f 100644
Binary files a/.doctrees/guides/help_guide.doctree and b/.doctrees/guides/help_guide.doctree differ
diff --git a/.doctrees/guides/include_guide.doctree b/.doctrees/guides/include_guide.doctree
index 52a1701e..0d16e5b8 100644
Binary files a/.doctrees/guides/include_guide.doctree and b/.doctrees/guides/include_guide.doctree differ
diff --git a/.doctrees/guides/index.doctree b/.doctrees/guides/index.doctree
index a48a945d..2d359776 100644
Binary files a/.doctrees/guides/index.doctree and b/.doctrees/guides/index.doctree differ
diff --git a/.doctrees/guides/library_guide.doctree b/.doctrees/guides/library_guide.doctree
index 98fd328a..d658c0d5 100644
Binary files a/.doctrees/guides/library_guide.doctree and b/.doctrees/guides/library_guide.doctree differ
diff --git a/.doctrees/guides/running_guide.doctree b/.doctrees/guides/running_guide.doctree
index 82d92ae6..20a71c7d 100644
Binary files a/.doctrees/guides/running_guide.doctree and b/.doctrees/guides/running_guide.doctree differ
diff --git a/.doctrees/guides/toml_guide.doctree b/.doctrees/guides/toml_guide.doctree
index 7ba87982..4a467bbd 100644
Binary files a/.doctrees/guides/toml_guide.doctree and b/.doctrees/guides/toml_guide.doctree differ
diff --git a/.doctrees/guides/without_poetry.doctree b/.doctrees/guides/without_poetry.doctree
index 0d61de2c..d031db52 100644
Binary files a/.doctrees/guides/without_poetry.doctree and b/.doctrees/guides/without_poetry.doctree differ
diff --git a/.doctrees/index.doctree b/.doctrees/index.doctree
index d0a98b2e..a58acc04 100644
Binary files a/.doctrees/index.doctree and b/.doctrees/index.doctree differ
diff --git a/.doctrees/installation.doctree b/.doctrees/installation.doctree
index 09d73c90..0b0d6fe6 100644
Binary files a/.doctrees/installation.doctree and b/.doctrees/installation.doctree differ
diff --git a/.doctrees/license.doctree b/.doctrees/license.doctree
index 8e8c152e..5bc06e73 100644
Binary files a/.doctrees/license.doctree and b/.doctrees/license.doctree differ
diff --git a/.doctrees/poetry_plugin.doctree b/.doctrees/poetry_plugin.doctree
index b1f6c131..35d1bdf8 100644
Binary files a/.doctrees/poetry_plugin.doctree and b/.doctrees/poetry_plugin.doctree differ
diff --git a/.doctrees/tasks/index.doctree b/.doctrees/tasks/index.doctree
index 27e00dc9..263e246c 100644
Binary files a/.doctrees/tasks/index.doctree and b/.doctrees/tasks/index.doctree differ
diff --git a/.doctrees/tasks/options.doctree b/.doctrees/tasks/options.doctree
index ae9f9dcc..997bb2f5 100644
Binary files a/.doctrees/tasks/options.doctree and b/.doctrees/tasks/options.doctree differ
diff --git a/.doctrees/tasks/task_types/cmd.doctree b/.doctrees/tasks/task_types/cmd.doctree
index 35c87a04..331c5641 100644
Binary files a/.doctrees/tasks/task_types/cmd.doctree and b/.doctrees/tasks/task_types/cmd.doctree differ
diff --git a/.doctrees/tasks/task_types/expr.doctree b/.doctrees/tasks/task_types/expr.doctree
index a34f444e..6d0ff6a2 100644
Binary files a/.doctrees/tasks/task_types/expr.doctree and b/.doctrees/tasks/task_types/expr.doctree differ
diff --git a/.doctrees/tasks/task_types/ref.doctree b/.doctrees/tasks/task_types/ref.doctree
index 5d24b55f..45add6b8 100644
Binary files a/.doctrees/tasks/task_types/ref.doctree and b/.doctrees/tasks/task_types/ref.doctree differ
diff --git a/.doctrees/tasks/task_types/script.doctree b/.doctrees/tasks/task_types/script.doctree
index e48621db..43c1963f 100644
Binary files a/.doctrees/tasks/task_types/script.doctree and b/.doctrees/tasks/task_types/script.doctree differ
diff --git a/.doctrees/tasks/task_types/sequence.doctree b/.doctrees/tasks/task_types/sequence.doctree
index b1ac4377..be011fdb 100644
Binary files a/.doctrees/tasks/task_types/sequence.doctree and b/.doctrees/tasks/task_types/sequence.doctree differ
diff --git a/.doctrees/tasks/task_types/shell.doctree b/.doctrees/tasks/task_types/shell.doctree
index 68317f4d..3320f464 100644
Binary files a/.doctrees/tasks/task_types/shell.doctree and b/.doctrees/tasks/task_types/shell.doctree differ
diff --git a/.doctrees/tasks/task_types/switch.doctree b/.doctrees/tasks/task_types/switch.doctree
index 54e5c8c9..2ca46cc2 100644
Binary files a/.doctrees/tasks/task_types/switch.doctree and b/.doctrees/tasks/task_types/switch.doctree differ
diff --git a/_sources/guides/args_guide.rst.txt b/_sources/guides/args_guide.rst.txt
index ae3caf50..21eb991b 100644
--- a/_sources/guides/args_guide.rst.txt
+++ b/_sources/guides/args_guide.rst.txt
@@ -122,11 +122,14 @@ Named arguments support the following configuration options:
.. code-block:: toml
+ [tool.poe.tasks.deploy]
+ cmd = "..."
+ env.AWS_REGION.default = "eu-central-1"
+
[[tool.poe.tasks.deploy.args]]
name = "region"
help = "The region to deploy to"
default = "${AWS_REGION}"
- env.AWS_REGION.default = "eu-central-1"
As in the above example, this can be combined with setting an :doc:`env value<../tasks/options>` on the task with the ``default`` specifier to get the following precedence of values for the arg:
diff --git a/_sources/installation.rst.txt b/_sources/installation.rst.txt
index 653e4804..81ad5180 100644
--- a/_sources/installation.rst.txt
+++ b/_sources/installation.rst.txt
@@ -110,7 +110,7 @@ Fish
Supported python versions
-------------------------
-Poe the Poet officially supports python >=3.8, and is tested with python 3.8 to 3.12 on
+Poe the Poet officially supports python >=3.9, and is tested with python 3.9 to 3.13 on
macOS, linux and windows.
diff --git a/_static/basic.css b/_static/basic.css
index 7577acb1..f316efcb 100644
--- a/_static/basic.css
+++ b/_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.
*
*/
@@ -237,6 +237,10 @@ a.headerlink {
visibility: hidden;
}
+a:visited {
+ color: #551A8B;
+}
+
h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
@@ -670,6 +674,16 @@ dd {
margin-left: 30px;
}
+.sig dd {
+ margin-top: 0px;
+ margin-bottom: 0px;
+}
+
+.sig dl {
+ margin-top: 0px;
+ margin-bottom: 0px;
+}
+
dl > dd:last-child,
dl > dd:last-child > :last-child {
margin-bottom: 0;
@@ -738,6 +752,14 @@ abbr, acronym {
cursor: help;
}
+.translated {
+ background-color: rgba(207, 255, 207, 0.2)
+}
+
+.untranslated {
+ background-color: rgba(255, 207, 207, 0.2)
+}
+
/* -- code displays --------------------------------------------------------- */
pre {
diff --git a/_static/doctools.js b/_static/doctools.js
index d06a71d7..4d67807d 100644
--- a/_static/doctools.js
+++ b/_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/_static/documentation_options.js b/_static/documentation_options.js
index a53a4b50..3a1b785e 100644
--- a/_static/documentation_options.js
+++ b/_static/documentation_options.js
@@ -1,6 +1,5 @@
-var DOCUMENTATION_OPTIONS = {
- URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
- VERSION: '0.30.0',
+const DOCUMENTATION_OPTIONS = {
+ VERSION: '0.31.0',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
diff --git a/_static/language_data.js b/_static/language_data.js
index 250f5665..367b8ed8 100644
--- a/_static/language_data.js
+++ b/_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/_static/searchtools.js b/_static/searchtools.js
index 97d56a74..b08d58c9 100644
--- a/_static/searchtools.js
+++ b/_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.
*
*/
@@ -57,12 +57,12 @@ const _removeChildren = (element) => {
const _escapeRegExp = (string) =>
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
-const _displayItem = (item, searchTerms) => {
+const _displayItem = (item, searchTerms, highlightTerms) => {
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
- const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
+ const contentRoot = document.documentElement.dataset.content_root;
const [docName, title, anchor, descr, score, _filename] = item;
@@ -75,28 +75,35 @@ const _displayItem = (item, searchTerms) => {
if (dirname.match(/\/index\/$/))
dirname = dirname.substring(0, dirname.length - 6);
else if (dirname === "index/") dirname = "";
- requestUrl = docUrlRoot + dirname;
+ requestUrl = contentRoot + dirname;
linkUrl = requestUrl;
} else {
// normal html builders
- requestUrl = docUrlRoot + docName + docFileSuffix;
+ requestUrl = contentRoot + docName + docFileSuffix;
linkUrl = docName + docLinkSuffix;
}
let linkEl = listItem.appendChild(document.createElement("a"));
linkEl.href = linkUrl + anchor;
linkEl.dataset.score = score;
linkEl.innerHTML = title;
- if (descr)
+ if (descr) {
listItem.appendChild(document.createElement("span")).innerHTML =
" (" + descr + ")";
+ // highlight search terms in the description
+ if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js
+ highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted"));
+ }
else if (showSearchSummary)
fetch(requestUrl)
.then((responseData) => responseData.text())
.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
+ highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted"));
});
Search.output.appendChild(listItem);
};
@@ -109,26 +116,43 @@ 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,
resultCount,
- searchTerms
+ searchTerms,
+ highlightTerms,
) => {
// results left, load the summary and display it
// this is intended to be dynamic (don't sub resultsCount)
if (results.length) {
- _displayItem(results.pop(), searchTerms);
+ _displayItem(results.pop(), searchTerms, highlightTerms);
setTimeout(
- () => _displayNextItem(results, resultCount, searchTerms),
+ () => _displayNextItem(results, resultCount, searchTerms, highlightTerms),
5
);
}
// 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
@@ -152,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 [".headerlink", "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 "";
},
@@ -231,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();
@@ -276,21 +304,38 @@ 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([
+ const score = Math.round(Scorer.title * queryLower.length / title.length);
+ const boost = titles[file] === title ? 1 : 0; // add a boost for document titles
+ normalResults.push([
docNames[file],
titles[file] !== title ? `${titles[file]} > ${title}` : title,
id !== null ? "#" + id : "",
null,
- score,
+ score + boost,
filenames[file],
]);
}
@@ -300,46 +345,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)));
-
- // 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;
- });
+ if (Scorer.score) {
+ normalResults.forEach((item) => (item[4] = Scorer.score(item)));
+ nonMainIndexResults.forEach((item) => (item[4] = Scorer.score(item)));
+ }
+
+ // 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
@@ -353,14 +399,19 @@ 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
// console.info("search results:", Search.lastresults);
// print the results
- _displayNextItem(results, results.length, searchTerms);
+ _displayNextItem(results, results.length, searchTerms, highlightTerms);
},
/**
@@ -458,14 +509,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
@@ -488,9 +543,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);
});
});
@@ -541,8 +595,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/_static/sphinx_highlight.js b/_static/sphinx_highlight.js
index aae669d7..8a96c69a 100644
--- a/_static/sphinx_highlight.js
+++ b/_static/sphinx_highlight.js
@@ -29,14 +29,19 @@ const _highlight = (node, addItems, text, className) => {
}
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
+ const rest = document.createTextNode(val.substr(pos + text.length));
parent.insertBefore(
span,
parent.insertBefore(
- document.createTextNode(val.substr(pos + text.length)),
+ rest,
node.nextSibling
)
);
node.nodeValue = val.substr(0, pos);
+ /* There may be more occurrences of search term in this node. So call this
+ * function recursively on the remaining fragment.
+ */
+ _highlight(rest, addItems, text, className);
if (isInSVG) {
const rect = document.createElementNS(
@@ -140,5 +145,10 @@ const SphinxHighlight = {
},
};
-_ready(SphinxHighlight.highlightSearchWords);
-_ready(SphinxHighlight.initEscapeListener);
+_ready(() => {
+ /* Do not call highlightSearchWords() when we are on the search page.
+ * It will highlight words from the *previous* search query.
+ */
+ if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords();
+ SphinxHighlight.initEscapeListener();
+});
diff --git a/contributing.html b/contributing.html
index a126a796..159ba5ac 100644
--- a/contributing.html
+++ b/contributing.html
@@ -1,8 +1,8 @@
-
+
-
+
@@ -12,12 +12,12 @@
-
+
Contributing - Poe the Poet
-
-
-
-
+
+
+
+
@@ -237,26 +237,26 @@
-Contributing
+Contributing
So you’d like to contribute? Awesome! Here are some things worth
knowing.
-Reporting a bug / requesting a feature / asking a question
+Reporting a bug / requesting a feature / asking a question
Go open an issue or start a discussion and I’ll probably reply soon.
-Contributing to the docs
+Contributing to the docs
Just make a PR with your proposed changes targeting the main branch. The documentation website will update once your PR is merged.
-Contributing code
+Contributing code
-Preface
+Preface
If you’re willing to contribute your ideas and effort to making poethepoet better, then that’s awesome and I’m grateful. I don’t have all the answers so it’s particularly important for this project to benefit from diverse perspectives and technical expertise.
However please be aware that a lot of thought has gone into the architecture of poethepoet, and whilst I know it’s not perfect, and I am very interested in alternative perspectives, I do have strong (and I hope reasonable) opinions about how certain things should work. This particularly applies to naming and internal APIs. There is a lot to consider in terms of making sure the tool stays simple, flexible, and performant. So please don’t be offended if there is some push back.
-Development process
+Development process
If your planned changes entail non-trivial UI or internal API changes then it’s a good idea to bring them up for discussion as a GitHub issue first.
Fork and clone the repo, and create a feature or bugfix branch off of the development branch.
@@ -281,28 +281,28 @@ Development process
-Branching model
+Branching model
This project implements something like git flow.
TL;DR branch off of development for new features, or main for documentation improvements.
We like to keep a clean history, so squash-rebase merges are preferred for the development or main branches.
-Overview of branches
+Overview of branches
-Historic branches
+Historic branches
-Working branches
+Working branches
-How to create release
+How to create release
From the head of the development branch, create release commit that bumps the version in pyproject.toml
and __version__.py
(there’s a test to ensure these are in sync).
Create a release (and tag) on GitHub, following the existing convention for naming and release notes format (use the Generate release notes button as a starting point), and the GitHub CI will do the rest.
@@ -428,12 +428,12 @@ How to create release