From b8a9f4bb978e42a2aa5d1d4eee8408525bf2f97c Mon Sep 17 00:00:00 2001 From: bsrdjan Date: Mon, 2 Oct 2023 13:54:26 +0200 Subject: [PATCH] docs: documentation 3.2 --- .buildinfo | 2 +- _static/agogo.css | 14 ++- _static/basic.css | 22 ++++ _static/documentation_options.js | 5 +- _static/pygments.css | 1 + _static/searchtools.js | 26 ++-- _static/sphinx_highlight.js | 16 ++- authentication.html | 32 ++--- bibliography.html | 30 ++--- build.html | 34 +++--- client.html | 52 ++++---- genindex.html | 22 ++-- glossary.html | 26 ++-- index.html | 30 ++--- install.html | 46 ++++---- intro.html | 28 ++--- pyrfc.html | 197 +++++++++++++++++-------------- remarks.html | 30 ++--- search.html | 22 ++-- searchindex.js | 2 +- server.html | 61 +++++----- 21 files changed, 379 insertions(+), 319 deletions(-) diff --git a/.buildinfo b/.buildinfo index 9a02ffd..a5ba20b 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: ca70197c82d4adc6ebb4b3eb5c1d193e +config: 93898538c024605e6f316a0a1364595d tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/_static/agogo.css b/_static/agogo.css index 52b067b..4228b00 100644 --- a/_static/agogo.css +++ b/_static/agogo.css @@ -19,6 +19,10 @@ body { line-height: 1.4em; color: black; background-color: #eeeeec; + + /* fix for background colors breaking at horizontal + scrolling on smaller devices */ + min-width: fit-content; } @@ -41,6 +45,10 @@ a { color: #ce5c00; } +a:visited { + color: #551a8b; +} + div.bodywrapper a, div.footer a { text-decoration: underline; } @@ -127,8 +135,7 @@ dt:target, .highlighted { /* Header */ div.header { - padding-top: 10px; - padding-bottom: 10px; + padding: 1em; } div.header .headertitle { @@ -165,8 +172,7 @@ img.logo { /* Content */ div.content-wrapper { background-color: white; - padding-top: 20px; - padding-bottom: 20px; + padding: 1em; } div.document { diff --git a/_static/basic.css b/_static/basic.css index 3ade861..95c48e9 100644 --- a/_static/basic.css +++ b/_static/basic.css @@ -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/documentation_options.js b/_static/documentation_options.js index 3682fd3..759f6cd 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: '3.1', +const DOCUMENTATION_OPTIONS = { + VERSION: '3.2', LANGUAGE: 'en', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/_static/pygments.css b/_static/pygments.css index 691aeb8..0d49244 100644 --- a/_static/pygments.css +++ b/_static/pygments.css @@ -17,6 +17,7 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #A00000 } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #FF0000 } /* Generic.Error */ .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .highlight .gi { color: #00A000 } /* Generic.Inserted */ diff --git a/_static/searchtools.js b/_static/searchtools.js index 97d56a7..7918c3f 100644 --- a/_static/searchtools.js +++ b/_static/searchtools.js @@ -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,20 +75,24 @@ 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()) @@ -97,6 +101,9 @@ const _displayItem = (item, searchTerms) => { listItem.appendChild( Search.makeSearchSummary(data, searchTerms) ); + // 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); }; @@ -115,14 +122,15 @@ const _finishSearch = (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 ); } @@ -360,7 +368,7 @@ const Search = { // console.info("search results:", Search.lastresults); // print the results - _displayNextItem(results, results.length, searchTerms); + _displayNextItem(results, results.length, searchTerms, highlightTerms); }, /** diff --git a/_static/sphinx_highlight.js b/_static/sphinx_highlight.js index aae669d..8a96c69 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/authentication.html b/authentication.html index f109e57..0ac736d 100644 --- a/authentication.html +++ b/authentication.html @@ -1,16 +1,16 @@ - + - Security — pyrfc 3.1 documentation - - - - - + Security — pyrfc 3.2 documentation + + + + + @@ -19,7 +19,7 @@