This commit is contained in:
GitHub Actions
2022-08-21 05:26:00 +00:00
parent 93c20b6ee1
commit aa434a6b8b
8 changed files with 26 additions and 56 deletions
+5 -5
View File
@@ -9,7 +9,7 @@ Synopsis
.. parsed-literal::
version(`PARSE`_ <out-var> [REQUIRE [PATCH|TWEAK][;...]] <string>)
version(`GENERATE`_ <out-var> [COMPRESS] [MAJOR <major>] [MINOR <minor>] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>])
version(`GENERATE`_ <out-var> [COMPRESS] [MAJOR <major>] [MINOR <minor>] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>] [REQUIRE [PATCH|TWEAK][;...]])
version(`MODIFY`_ <out-var> <string> [COMPRESS] [MAJOR <major>] [MINOR <minor] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>] [REQUIRE [PATCH|TWEAK][;...]])
version(`COMPARE`_ <out-var> <a> <b>)
@@ -38,9 +38,9 @@ Generating
.. code-block:: cmake
version(GENERATE <out-var> [COMPRESS] [MAJOR <major>] [MINOR <minor>] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>])
version(GENERATE <out-var> [COMPRESS] [MAJOR <major>] [MINOR <minor>] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>] [REQUIRE [PATCH|TWEAK][;...]])
Generates a version from the components provided and stores the result in ``<out-var>``. The components ``<major>`` and ``<minor>`` will default to ``0`` if not provided. If an error occurred, ``<out-var>_ERROR`` will contain the error message otherwise it will be a false constant. The ``PRERELEASE`` and ``BUILD`` components support the dot-separation specifier and will be converted from a list if encountered.
Generates a version from the components provided and stores the result in ``<out-var>``. The components ``<major>`` and ``<minor>`` will default to ``0`` if not provided. If an error occurred, ``<out-var>_ERROR`` will contain the error message otherwise it will be a false constant. The ``PRERELEASE`` and ``BUILD`` components support the dot-separation specifier and will be converted from a list if encountered. The optional ``REQUIRE`` allows forcing the components ``PATCH`` and ``TWEAK`` to always be defined.
Modifying
^^^^^^^^^
@@ -59,7 +59,7 @@ Comparing
.. _COMPARE:
.. code-block:: cmake
version(COMPARE <out-var> <a> <b>)
Compares the version ``<a>`` against ``<b>`` and stores the result in ``<out-var>``. The provided version will be evaluated in the order MAJOR, MINOR, PATCH, TWEAK, PRERELEASE, and then BUILD. The following results should be expected:
@@ -69,7 +69,7 @@ Compares the version ``<a>`` against ``<b>`` and stores the result in ``<out-var
- If a component is numerical and the value is larger in ``<a>``, ``<out-var>`` will contain the componenent name prefixed by ``>``.
- If a component is numerical and the value is larger in ``<b>``, ``<out-var>`` will contain the componenent name prefixed by ``<``.
- If a component is alphanumerical and the value is different in either, ``<out-var>`` will contain the component name with no prefix.
- If an error occurred, ``<out-var>_ERROR`` will contain the error message otherwise it will be a false constant, and ``<out-var>`` will be a false constant.
- If an error occurred, ``<out-var>_ERROR`` will contain the error message otherwise it will be a false constant, and ``<out-var>`` will be a false constant.
- In all other cases, ``<out-var>`` will be a false constant.
There is no special handling for dot-separated ``PRERELEASE`` and ``BUILD`` component. They will be treated as if they were a string, as special handling for these is up to the application.
+1 -30
View File
@@ -608,8 +608,6 @@ ol.simple p,
ul.simple p {
margin-bottom: 0;
}
/* Docutils 0.17 and older (footnotes & citations) */
dl.footnote > dt,
dl.citation > dt {
float: left;
@@ -627,33 +625,6 @@ dl.citation > dd:after {
clear: both;
}
/* Docutils 0.18+ (footnotes & citations) */
aside.footnote > span,
div.citation > span {
float: left;
}
aside.footnote > span:last-of-type,
div.citation > span:last-of-type {
padding-right: 0.5em;
}
aside.footnote > p {
margin-left: 2em;
}
div.citation > p {
margin-left: 4em;
}
aside.footnote > p:last-of-type,
div.citation > p:last-of-type {
margin-bottom: 0em;
}
aside.footnote > p:last-of-type:after,
div.citation > p:last-of-type:after {
content: "";
clear: both;
}
/* Footnotes & citations ends */
dl.field-list {
display: grid;
grid-template-columns: fit-content(30%) auto;
@@ -665,11 +636,11 @@ dl.field-list > dt {
padding-left: 0.5em;
padding-right: 5px;
}
dl.field-list > dt:after {
content: ":";
}
dl.field-list > dd {
padding-left: 0.5em;
margin-top: 0em;
+2 -2
View File
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '1.3.0',
VERSION: '1.4.0',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
@@ -10,5 +10,5 @@ var DOCUMENTATION_OPTIONS = {
SOURCELINK_SUFFIX: '.txt',
NAVIGATION_WITH_KEYS: false,
SHOW_SEARCH_SUMMARY: true,
ENABLE_SEARCH_SHORTCUTS: false,
ENABLE_SEARCH_SHORTCUTS: true,
};
+8 -9
View File
@@ -88,7 +88,7 @@ const _displayItem = (item, highlightTerms, searchTerms) => {
linkEl.href = linkUrl + "?" + params.toString() + anchor;
linkEl.innerHTML = title;
if (descr)
listItem.appendChild(document.createElement("span")).innerText =
listItem.appendChild(document.createElement("span")).innerHTML =
" (" + descr + ")";
else if (showSearchSummary)
fetch(requestUrl)
@@ -155,10 +155,8 @@ const Search = {
_pulse_status: -1,
htmlToText: (htmlString) => {
const htmlElement = document
.createRange()
.createContextualFragment(htmlString);
_removeChildren(htmlElement.querySelectorAll(".headerlink"));
const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() });
const docContent = htmlElement.querySelector('[role="main"]');
if (docContent !== undefined) return docContent.textContent;
console.warn(
@@ -504,11 +502,12 @@ const Search = {
* latter for highlighting it.
*/
makeSearchSummary: (htmlText, keywords, highlightWords) => {
const text = Search.htmlToText(htmlText).toLowerCase();
const text = Search.htmlToText(htmlText);
if (text === "") return null;
const textLower = text.toLowerCase();
const actualStartPosition = [...keywords]
.map((k) => text.indexOf(k.toLowerCase()))
.map((k) => textLower.indexOf(k.toLowerCase()))
.filter((i) => i > -1)
.slice(-1)[0];
const startWithContext = Math.max(actualStartPosition - 120, 0);
@@ -516,9 +515,9 @@ const Search = {
const top = startWithContext === 0 ? "" : "...";
const tail = startWithContext + 240 < text.length ? "..." : "";
let summary = document.createElement("div");
let summary = document.createElement("p");
summary.classList.add("context");
summary.innerText = top + text.substr(startWithContext, 240).trim() + tail;
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;
highlightWords.forEach((highlightWord) =>
_highlightText(summary, highlightWord, "highlighted")
+2 -2
View File
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Index &mdash; version 1.3.0 documentation</title>
<title>Index &mdash; version 1.4.0 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
@@ -28,7 +28,7 @@
<a href="index.html" class="icon icon-home"> version
</a>
<div class="version">
1.3.0
1.4.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
+5 -5
View File
@@ -4,7 +4,7 @@
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>version &mdash; version 1.3.0 documentation</title>
<title>version &mdash; version 1.4.0 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
@@ -29,7 +29,7 @@
<a href="#" class="icon icon-home"> version
</a>
<div class="version">
1.3.0
1.4.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
@@ -81,7 +81,7 @@
<section id="synopsis">
<h2>Synopsis<a class="headerlink" href="#synopsis" title="Permalink to this heading"></a></h2>
<pre class="literal-block">version(<a class="reference internal" href="#parse">PARSE</a> &lt;out-var&gt; [REQUIRE [PATCH|TWEAK][;...]] &lt;string&gt;)
version(<a class="reference internal" href="#generate">GENERATE</a> &lt;out-var&gt; [COMPRESS] [MAJOR &lt;major&gt;] [MINOR &lt;minor&gt;] [PATCH &lt;patch&gt;] [TWEAK &lt;tweak&gt;] [PRERELEASE &lt;prerelease&gt;] [BUILD &lt;build&gt;])
version(<a class="reference internal" href="#generate">GENERATE</a> &lt;out-var&gt; [COMPRESS] [MAJOR &lt;major&gt;] [MINOR &lt;minor&gt;] [PATCH &lt;patch&gt;] [TWEAK &lt;tweak&gt;] [PRERELEASE &lt;prerelease&gt;] [BUILD &lt;build&gt;] [REQUIRE [PATCH|TWEAK][;...]])
version(<a class="reference internal" href="#modify">MODIFY</a> &lt;out-var&gt; &lt;string&gt; [COMPRESS] [MAJOR &lt;major&gt;] [MINOR &lt;minor] [PATCH &lt;patch&gt;] [TWEAK &lt;tweak&gt;] [PRERELEASE &lt;prerelease&gt;] [BUILD &lt;build&gt;] [REQUIRE [PATCH|TWEAK][;...]])
version(<a class="reference internal" href="#compare">COMPARE</a> &lt;out-var&gt; &lt;a&gt; &lt;b&gt;)</pre>
<p>The following version constructs are currently supported:</p>
@@ -98,10 +98,10 @@ version(<a class="reference internal" href="#compare">COMPARE</a> &lt;out-var&gt
</section>
<section id="generating">
<h2>Generating<a class="headerlink" href="#generating" title="Permalink to this heading"></a></h2>
<div class="highlight-cmake notranslate" id="generate"><div class="highlight"><pre><span></span><span class="nb">version</span><span class="p">(</span><span class="s">GENERATE</span><span class="w"> </span><span class="s">&lt;out-var&gt;</span><span class="w"> </span><span class="s">[COMPRESS]</span><span class="w"> </span><span class="s">[MAJOR</span><span class="w"> </span><span class="s">&lt;major&gt;]</span><span class="w"> </span><span class="s">[MINOR</span><span class="w"> </span><span class="s">&lt;minor&gt;]</span><span class="w"> </span><span class="s">[PATCH</span><span class="w"> </span><span class="s">&lt;patch&gt;]</span><span class="w"> </span><span class="s">[TWEAK</span><span class="w"> </span><span class="s">&lt;tweak&gt;]</span><span class="w"> </span><span class="s">[PRERELEASE</span><span class="w"> </span><span class="s">&lt;prerelease&gt;]</span><span class="w"> </span><span class="s">[BUILD</span><span class="w"> </span><span class="s">&lt;build&gt;]</span><span class="p">)</span>
<div class="highlight-cmake notranslate" id="generate"><div class="highlight"><pre><span></span><span class="nb">version</span><span class="p">(</span><span class="s">GENERATE</span><span class="w"> </span><span class="s">&lt;out-var&gt;</span><span class="w"> </span><span class="s">[COMPRESS]</span><span class="w"> </span><span class="s">[MAJOR</span><span class="w"> </span><span class="s">&lt;major&gt;]</span><span class="w"> </span><span class="s">[MINOR</span><span class="w"> </span><span class="s">&lt;minor&gt;]</span><span class="w"> </span><span class="s">[PATCH</span><span class="w"> </span><span class="s">&lt;patch&gt;]</span><span class="w"> </span><span class="s">[TWEAK</span><span class="w"> </span><span class="s">&lt;tweak&gt;]</span><span class="w"> </span><span class="s">[PRERELEASE</span><span class="w"> </span><span class="s">&lt;prerelease&gt;]</span><span class="w"> </span><span class="s">[BUILD</span><span class="w"> </span><span class="s">&lt;build&gt;]</span><span class="w"> </span><span class="s">[REQUIRE</span><span class="w"> </span><span class="s">[PATCH|TWEAK][;...]]</span><span class="p">)</span>
</pre></div>
</div>
<p>Generates a version from the components provided and stores the result in <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;</span></code>. The components <code class="docutils literal notranslate"><span class="pre">&lt;major&gt;</span></code> and <code class="docutils literal notranslate"><span class="pre">&lt;minor&gt;</span></code> will default to <code class="docutils literal notranslate"><span class="pre">0</span></code> if not provided. If an error occurred, <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;_ERROR</span></code> will contain the error message otherwise it will be a false constant. The <code class="docutils literal notranslate"><span class="pre">PRERELEASE</span></code> and <code class="docutils literal notranslate"><span class="pre">BUILD</span></code> components support the dot-separation specifier and will be converted from a list if encountered.</p>
<p>Generates a version from the components provided and stores the result in <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;</span></code>. The components <code class="docutils literal notranslate"><span class="pre">&lt;major&gt;</span></code> and <code class="docutils literal notranslate"><span class="pre">&lt;minor&gt;</span></code> will default to <code class="docutils literal notranslate"><span class="pre">0</span></code> if not provided. If an error occurred, <code class="docutils literal notranslate"><span class="pre">&lt;out-var&gt;_ERROR</span></code> will contain the error message otherwise it will be a false constant. The <code class="docutils literal notranslate"><span class="pre">PRERELEASE</span></code> and <code class="docutils literal notranslate"><span class="pre">BUILD</span></code> components support the dot-separation specifier and will be converted from a list if encountered. The optional <code class="docutils literal notranslate"><span class="pre">REQUIRE</span></code> allows forcing the components <code class="docutils literal notranslate"><span class="pre">PATCH</span></code> and <code class="docutils literal notranslate"><span class="pre">TWEAK</span></code> to always be defined.</p>
</section>
<section id="modifying">
<h2>Modifying<a class="headerlink" href="#modifying" title="Permalink to this heading"></a></h2>
+2 -2
View File
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Search &mdash; version 1.3.0 documentation</title>
<title>Search &mdash; version 1.4.0 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
@@ -31,7 +31,7 @@
<a href="index.html" class="icon icon-home"> version
</a>
<div class="version">
1.3.0
1.4.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="#" method="get">
+1 -1
View File
@@ -1 +1 @@
Search.setIndex({"docnames": ["index"], "filenames": ["index.rst"], "titles": ["version"], "terms": {"pure": 0, "cmake": 0, "support": 0, "semant": 0, "2": 0, "0": 0, "1": 0, "other": 0, "format": 0, "out": 0, "var": 0, "string": 0, "compress": 0, "major": 0, "minor": 0, "patch": 0, "tweak": 0, "prereleas": 0, "build": 0, "b": 0, "The": 0, "follow": 0, "construct": 0, "ar": 0, "current": 0, "pre": 0, "releas": 0, "attempt": 0, "store": 0, "individu": 0, "compoent": 0, "_": 0, "compon": 0, "If": 0, "present": 0, "given": 0, "undefin": [], "an": 0, "error": 0, "occur": 0, "_error": 0, "defin": 0, "contain": 0, "messag": 0, "from": 0, "provid": 0, "result": 0, "default": 0, "mai": 0, "have": 0, "prefix": 0, "add": 0, "subtract": 0, "valu": 0, "replac": 0, "thi": 0, "oper": 0, "did": 0, "exist": 0, "origin": 0, "ad": 0, "against": 0, "evalu": 0, "order": 0, "should": 0, "expect": 0, "onli": 0, "componen": 0, "name": 0, "numer": 0, "larger": 0, "alphanumer": 0, "differ": 0, "either": 0, "In": 0, "all": 0, "case": 0, "empti": [], "dot": 0, "separ": 0, "specifi": 0, "turn": 0, "list": 0, "thei": 0, "encount": 0, "convert": 0, "There": 0, "special": 0, "handl": 0, "treat": 0, "were": 0, "up": 0, "applic": 0, "set": 0, "fals": 0, "constant": 0, "otherwis": 0, "requir": 0, "option": 0, "allow": 0, "forc": 0, "alwai": 0}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"version": 0, "synopsi": 0, "pars": 0, "gener": 0, "modifi": 0, "compar": 0}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 56}})
Search.setIndex({"docnames": ["index"], "filenames": ["index.rst"], "titles": ["version"], "terms": {"pure": 0, "cmake": 0, "support": 0, "semant": 0, "2": 0, "0": 0, "1": 0, "other": 0, "format": 0, "out": 0, "var": 0, "string": 0, "compress": 0, "major": 0, "minor": 0, "patch": 0, "tweak": 0, "prereleas": 0, "build": 0, "b": 0, "The": 0, "follow": 0, "construct": 0, "ar": 0, "current": 0, "pre": 0, "releas": 0, "attempt": 0, "store": 0, "individu": 0, "compoent": 0, "_": 0, "compon": 0, "If": 0, "present": 0, "given": 0, "undefin": [], "an": 0, "error": 0, "occur": 0, "_error": 0, "defin": 0, "contain": 0, "messag": 0, "from": 0, "provid": 0, "result": 0, "default": 0, "mai": 0, "have": 0, "prefix": 0, "add": 0, "subtract": 0, "valu": 0, "replac": 0, "thi": 0, "oper": 0, "did": 0, "exist": 0, "origin": 0, "ad": 0, "against": 0, "evalu": 0, "order": 0, "should": 0, "expect": 0, "onli": 0, "componen": 0, "name": 0, "numer": 0, "larger": 0, "alphanumer": 0, "differ": 0, "either": 0, "In": 0, "all": 0, "case": 0, "empti": [], "dot": 0, "separ": 0, "specifi": 0, "turn": 0, "list": 0, "thei": 0, "encount": 0, "convert": 0, "There": 0, "special": 0, "handl": 0, "treat": 0, "were": 0, "up": 0, "applic": 0, "set": 0, "fals": 0, "constant": 0, "otherwis": 0, "requir": 0, "option": 0, "allow": 0, "forc": 0, "alwai": 0, "i": 0}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"version": 0, "synopsi": 0, "pars": 0, "gener": 0, "modifi": 0, "compar": 0}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 56}})