Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gardener-robot-ci-3 committed Sep 4, 2023
1 parent 2c7d6e6 commit 9e60a0d
Show file tree
Hide file tree
Showing 17 changed files with 138 additions and 98 deletions.
22 changes: 22 additions & 0 deletions _static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ a.headerlink {
visibility: hidden;
}

a:visited {
color: #551A8B;
}

h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion _static/css/theme.css

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions _static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
const DOCUMENTATION_OPTIONS = {
VERSION: '',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
Expand Down
1 change: 1 addition & 0 deletions _static/pygments.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left:
.highlight .cs { color: #3D7B7B; font-style: italic } /* 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: #E40000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #008400 } /* Generic.Inserted */
Expand Down
26 changes: 17 additions & 9 deletions _static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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())
Expand All @@ -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);
};
Expand All @@ -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
);
}
Expand Down Expand Up @@ -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);
},

/**
Expand Down
16 changes: 13 additions & 3 deletions _static/sphinx_highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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();
});
18 changes: 9 additions & 9 deletions building_components.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->

<script src="_static/jquery.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=5929fcd5"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
Expand Down Expand Up @@ -83,7 +83,7 @@
<div itemprop="articleBody">

<section id="building-components">
<h1>Building Components<a class="headerlink" href="#building-components" title="Permalink to this heading"></a></h1>
<h1>Building Components<a class="headerlink" href="#building-components" title="Link to this heading"></a></h1>
<p>The <cite>CNUDIE Component Descriptor model</cite> takes no assumption as to how component versions are created.
Typically, they are generated during a build process, as this is where their artifacts are generated.
About those build processes, the CNUDIE Component Descriptor model also does not take any
Expand All @@ -92,17 +92,17 @@ <h1>Building Components<a class="headerlink" href="#building-components" title="
be used (<a class="reference external" href="https://github.com/gardener/component-cli">https://github.com/gardener/component-cli</a>).</p>
<p>The following example shows how this can be done based on a <cite>make</cite>-based build.</p>
<section id="example">
<h2>Example<a class="headerlink" href="#example" title="Permalink to this heading"></a></h2>
<h2>Example<a class="headerlink" href="#example" title="Link to this heading"></a></h2>
<section id="prerequisites">
<h3>Prerequisites<a class="headerlink" href="#prerequisites" title="Permalink to this heading"></a></h3>
<h3>Prerequisites<a class="headerlink" href="#prerequisites" title="Link to this heading"></a></h3>
<ul class="simple">
<li><p>toolset must be available</p></li>
<li><p>OCI Registry with write-credentials to store Component-Descriptors</p></li>
<li><p>also: expose credentials (.docker/config.json)</p></li>
</ul>
</section>
<section id="integrating-component-descriptor-creation-into-the-build">
<h3>Integrating Component Descriptor creation into the build<a class="headerlink" href="#integrating-component-descriptor-creation-into-the-build" title="Permalink to this heading"></a></h3>
<h3>Integrating Component Descriptor creation into the build<a class="headerlink" href="#integrating-component-descriptor-creation-into-the-build" title="Link to this heading"></a></h3>
<ul class="simple">
<li><p>todo: reference example build (w/o CNUDIE-CD)</p></li>
<li><p>next step: run the build</p></li>
Expand Down
2 changes: 1 addition & 1 deletion component-descriptor-v2.html

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions component_descriptor_registries.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->

<script src="_static/jquery.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=5929fcd5"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
Expand Down Expand Up @@ -87,15 +87,15 @@
<div itemprop="articleBody">

<section id="component-descriptor-registries">
<h1>Component Descriptor Registries<a class="headerlink" href="#component-descriptor-registries" title="Permalink to this heading"></a></h1>
<h1>Component Descriptor Registries<a class="headerlink" href="#component-descriptor-registries" title="Link to this heading"></a></h1>
<p>Component Descriptor Registries are used to store <cite>Component Descriptors</cite>. Using a
<cite>Repository Context</cite> configuration, and a <cite>Component Name</cite> and <cite>Component Version</cite>, it is possible
to unambiguously reference a <cite>Component Descriptor</cite> for the given component version.</p>
<p>Component Descriptor Registries <em>MUST</em> implement a WORM-semantics (write-once-read-many).</p>
<p>There can potentially be many different technical implementations. However, for the time being,
there is only one, using an OCI Image Registry.</p>
<section id="component-descriptor-registries-backed-by-oci-image-registry">
<h2>Component Descriptor Registries backed by OCI Image Registry<a class="headerlink" href="#component-descriptor-registries-backed-by-oci-image-registry" title="Permalink to this heading"></a></h2>
<h2>Component Descriptor Registries backed by OCI Image Registry<a class="headerlink" href="#component-descriptor-registries-backed-by-oci-image-registry" title="Link to this heading"></a></h2>
<p>Component Descriptor Registries backed by an OCI Image Registry <em>MUST</em> specify a <cite>baseUrl</cite>. Said
URL <em>MUST</em> refer to an OCI Image Registry (for example <cite>eu.gcr.io/gardener-project</cite>).</p>
<p>The base URL <em>MAY</em> refer to sub-path on a OCI Image Registry.</p>
Expand All @@ -114,7 +114,7 @@ <h2>Component Descriptor Registries backed by OCI Image Registry<a class="header
<li><p>the octet-sequence of the serialised <cite>Component Descriptor</cite></p></li>
</ul>
<section id="component-name-mapping">
<h3>Component Name Mapping<a class="headerlink" href="#component-name-mapping" title="Permalink to this heading"></a></h3>
<h3>Component Name Mapping<a class="headerlink" href="#component-name-mapping" title="Link to this heading"></a></h3>
<p>Any OCI Image Registry used as a Component Descriptor registry <em>MUST</em> define an unambiguous
mapping of <cite>Component Name</cite>, <cite>Component Version</cite>-tuples to OCI Image References.</p>
<p>The following Component Name mappings are known:</p>
Expand All @@ -123,7 +123,7 @@ <h3>Component Name Mapping<a class="headerlink" href="#component-name-mapping" t
<li><p>sha256-digest</p></li>
</ul>
<section id="component-name-mapping-urlpath">
<h4>Component Name Mapping <cite>urlPath</cite><a class="headerlink" href="#component-name-mapping-urlpath" title="Permalink to this heading"></a></h4>
<h4>Component Name Mapping <cite>urlPath</cite><a class="headerlink" href="#component-name-mapping-urlpath" title="Link to this heading"></a></h4>
<p>Component Descriptor OCI Names are constructed like so:</p>
<p><cite>&lt;baseUrl&gt;/componentDescriptors/&lt;componentName&gt;:&lt;versionTag&gt;</cite></p>
<p>Where:</p>
Expand All @@ -134,7 +134,7 @@ <h4>Component Name Mapping <cite>urlPath</cite><a class="headerlink" href="#comp
</ul>
</section>
<section id="component-name-mapping-sha256-digest">
<h4>Component Name Mapping <cite>sha256-digest</cite><a class="headerlink" href="#component-name-mapping-sha256-digest" title="Permalink to this heading"></a></h4>
<h4>Component Name Mapping <cite>sha256-digest</cite><a class="headerlink" href="#component-name-mapping-sha256-digest" title="Link to this heading"></a></h4>
<p>Component Descriptor OCI Names are constructed like so:</p>
<p><cite>&lt;baseUrl&gt;/&lt;componentNameDigest&gt;:&lt;versionTag&gt;</cite></p>
<p>Where:</p>
Expand Down
Loading

0 comments on commit 9e60a0d

Please sign in to comment.