summaryrefslogtreecommitdiffstats
path: root/doc/sphinx-static
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2020-11-13 00:21:41 +0100
committerSteve Sakoman <steve@sakoman.com>2020-12-16 03:57:28 -1000
commitcd68f14031eb45006b44d10b348e35c69ac21ad0 (patch)
treeaa602de307c46e41424dc94588c33104a7af3c4d /doc/sphinx-static
parentd171188cf966852326916f726cbd3ca9627b831c (diff)
downloadbitbake-cd68f14031eb45006b44d10b348e35c69ac21ad0.tar.gz
sphinx: import sphinx docs
The Bitbake manual was migrated to Sphinx in Yocto Project 3.2. Since the docs between 3.2 and 3.1 are "similar", and since 3.1 is an LTS release, we agreed to backport the documentation onto 3.1. If we look at all docs changes in 3.1 and 3.2, we have the following: === Changes in 3.1 git log --oneline b94dec477a8d48ebceec91952ba290798c56c1f5..origin/1.46 -- doc/ ==== 324aaa7f bitbake-user-manual-metadata.xml: fix a minor error f92e19a3 doc: More explanation to tasks that recursively depend on themselves e4695176 doc: Clarify how task dependencies relate to RDEPENDS 25c5c79b user manual: properly tag content as <replaceable> be367887 docs: delete reference to obsolete recipe-depends.dot === Changes in 3.2/master git log --oneline b94dec477a8d48ebceec91952ba290798c56c1f5..origin/master -- doc/ ==== a7c47f1e sphinx: rename Makefile.sphinx 427721d8 sphinx: remove DocBook files d52190ea docs: static: theme_overrides.css: fix responsive design on <640px screens 9ae5cce7 docs: sphinx: report errors when dependencies are not met ec4c481a docs: update README file after migrationg to Sphinx c87cc35a docs: sphinx: replace special quotes with double quotes ebdeef2c docs: ref-variables: add links to terms in glossary 29081375 bitbake-user-manual: fix bad links a0f37789 sphinx: theme_override: Use bold for emphasis text cbc5ca48 sphinx: theme_override: properly set font for verbatim text 08b1ae23 sphinx: remove leading '/' 99ba6fe9 sphinx: update style for important, caution and warnings d99760cc sphinx: last manual round of fixes/improvements 4f94633a sphinx: bitbake-user-manual: insert additional blank line after title 63adcaa5 sphinx: add releases page 3e940d93 sphinx: conf: enable extlinks extension 9921c652 sphinx: index: move the boilerplate at the end of the page 4e461224 sphinx: add SPDX headers cb19159c sphinx: Enhance the sphinx experience/nagivation with: 10a54678 sphinx: tweak html output a bit 219b2348 sphinx: Makefile.sphinx: add clean and publish targets 35fdc185 sphinx: fixes all remaining warnings e11d2dd1 sphinx: fix links inside notes 57300955 sphinx: fixup for links fa304c01 sphinx: override theme CSS 29af1cd2 sphinx: switch to readthedocs theme e8359fd8 sphinx: bitbake-user-manual: use builtin sphinx glossary 6bf6c8d6 sphinx: initial sphinx support 84ccba0f sphinx: add initial build infrastructure 44b57216 bitbake-user-manual: update perforce fetcher docs 9186ca47 bitbake-user-manual: Add BBFILES_DYNAMIC 7689fa78 bitbake-user-manual: Remove TERM from BB_HASHBASE_WHITELIST example 06b5cf0a bitbake-user-manual-metadata.xml: fix a minor error c92a266c doc: More explanation to tasks that recursively depend on themselves caf42243 doc: Clarify how task dependencies relate to RDEPENDS 647c13d4 user manual: properly tag content as <replaceable> 2effbb6e docs: delete reference to obsolete recipe-depends.dot We can conclude the following commits exist in 3.2 and not in 3.1 (if we filter out sphinx changes) 44b57216 bitbake-user-manual: update perforce fetcher docs 9186ca47 bitbake-user-manual: Add BBFILES_DYNAMIC 7689fa78 bitbake-user-manual: Remove TERM from BB_HASHBASE_WHITELIST example Out of these 3 changes, the following patches are for 3.2 only: 44b57216 bitbake-user-manual: update perforce fetcher docs 7689fa78 bitbake-user-manual: Remove TERM from BB_HASHBASE_WHITELIST example To backport the Sphinx docs, we then need to cherry-pick all docs patches from 3.2/1.48 and 'undo' the two patches above. This first patch is the first step that imports all Sphinx files, and remove Docbook files. It was done with the following command: git cherry-pick -n \ $(git log --reverse --oneline \ b94dec477a8d48ebceec91952ba290798c56c1f5..origin/master -- doc/ \ | cut -f1 -d' ') Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Diffstat (limited to 'doc/sphinx-static')
-rw-r--r--doc/sphinx-static/switchers.js233
-rw-r--r--doc/sphinx-static/theme_overrides.css162
2 files changed, 395 insertions, 0 deletions
diff --git a/doc/sphinx-static/switchers.js b/doc/sphinx-static/switchers.js
new file mode 100644
index 000000000..32113cfa9
--- /dev/null
+++ b/doc/sphinx-static/switchers.js
@@ -0,0 +1,233 @@
+(function() {
+ 'use strict';
+
+ var all_versions = {
+ 'dev': 'dev (3.2)',
+ '3.1.2': '3.1.2',
+ '3.0.3': '3.0.3',
+ '2.7.4': '2.7.4',
+ };
+
+ var all_doctypes = {
+ 'single': 'Individual Webpages',
+ 'mega': "All-in-one 'Mega' Manual",
+ };
+
+ // Simple version comparision
+ // Return 1 if a > b
+ // Return -1 if a < b
+ // Return 0 if a == b
+ function ver_compare(a, b) {
+ if (a == "dev") {
+ return 1;
+ }
+
+ if (a === b) {
+ return 0;
+ }
+
+ var a_components = a.split(".");
+ var b_components = b.split(".");
+
+ var len = Math.min(a_components.length, b_components.length);
+
+ // loop while the components are equal
+ for (var i = 0; i < len; i++) {
+ // A bigger than B
+ if (parseInt(a_components[i]) > parseInt(b_components[i])) {
+ return 1;
+ }
+
+ // B bigger than A
+ if (parseInt(a_components[i]) < parseInt(b_components[i])) {
+ return -1;
+ }
+ }
+
+ // If one's a prefix of the other, the longer one is greater.
+ if (a_components.length > b_components.length) {
+ return 1;
+ }
+
+ if (a_components.length < b_components.length) {
+ return -1;
+ }
+
+ // Otherwise they are the same.
+ return 0;
+ }
+
+ function build_version_select(current_series, current_version) {
+ var buf = ['<select>'];
+
+ $.each(all_versions, function(version, title) {
+ var series = version.substr(0, 3);
+ if (series == current_series) {
+ if (version == current_version)
+ buf.push('<option value="' + version + '" selected="selected">' + title + '</option>');
+ else
+ buf.push('<option value="' + version + '">' + title + '</option>');
+
+ if (version != current_version)
+ buf.push('<option value="' + current_version + '" selected="selected">' + current_version + '</option>');
+ } else {
+ buf.push('<option value="' + version + '">' + title + '</option>');
+ }
+ });
+
+ buf.push('</select>');
+ return buf.join('');
+ }
+
+ function build_doctype_select(current_doctype) {
+ var buf = ['<select>'];
+
+ $.each(all_doctypes, function(doctype, title) {
+ if (doctype == current_doctype)
+ buf.push('<option value="' + doctype + '" selected="selected">' +
+ all_doctypes[current_doctype] + '</option>');
+ else
+ buf.push('<option value="' + doctype + '">' + title + '</option>');
+ });
+ if (!(current_doctype in all_doctypes)) {
+ // In case we're browsing a doctype that is not yet in all_doctypes.
+ buf.push('<option value="' + current_doctype + '" selected="selected">' +
+ current_doctype + '</option>');
+ all_doctypes[current_doctype] = current_doctype;
+ }
+ buf.push('</select>');
+ return buf.join('');
+ }
+
+ function navigate_to_first_existing(urls) {
+ // Navigate to the first existing URL in urls.
+ var url = urls.shift();
+
+ // Web browsers won't redirect file:// urls to file urls using ajax but
+ // its useful for local testing
+ if (url.startsWith("file://")) {
+ window.location.href = url;
+ return;
+ }
+
+ if (urls.length == 0) {
+ window.location.href = url;
+ return;
+ }
+ $.ajax({
+ url: url,
+ success: function() {
+ window.location.href = url;
+ },
+ error: function() {
+ navigate_to_first_existing(urls);
+ }
+ });
+ }
+
+ function get_docroot_url() {
+ var url = window.location.href;
+ var root = DOCUMENTATION_OPTIONS.URL_ROOT;
+
+ var urlarray = url.split('/');
+ // Trim off anything after '/'
+ urlarray.pop();
+ var depth = (root.match(/\.\.\//g) || []).length;
+ for (var i = 0; i < depth; i++) {
+ urlarray.pop();
+ }
+
+ return urlarray.join('/') + '/';
+ }
+
+ function on_version_switch() {
+ var selected_version = $(this).children('option:selected').attr('value');
+ var url = window.location.href;
+ var current_version = DOCUMENTATION_OPTIONS.VERSION;
+ var docroot = get_docroot_url()
+
+ var new_versionpath = selected_version + '/';
+ if (selected_version == "dev")
+ new_versionpath = '';
+
+ // dev versions have no version prefix
+ if (current_version == "dev") {
+ var new_url = docroot + new_versionpath + url.replace(docroot, "");
+ var fallback_url = docroot + new_versionpath;
+ } else {
+ var new_url = url.replace('/' + current_version + '/', '/' + new_versionpath);
+ var fallback_url = new_url.replace(url.replace(docroot, ""), "");
+ }
+
+ console.log(get_docroot_url())
+ console.log(url + " to url " + new_url);
+ console.log(url + " to fallback " + fallback_url);
+
+ if (new_url != url) {
+ navigate_to_first_existing([
+ new_url,
+ fallback_url,
+ 'https://www.yoctoproject.org/docs/',
+ ]);
+ }
+ }
+
+ function on_doctype_switch() {
+ var selected_doctype = $(this).children('option:selected').attr('value');
+ var url = window.location.href;
+ if (selected_doctype == 'mega') {
+ var docroot = get_docroot_url()
+ var current_version = DOCUMENTATION_OPTIONS.VERSION;
+ // Assume manuals before 3.2 are using old docbook mega-manual
+ if (ver_compare(current_version, "3.2") < 0) {
+ var new_url = docroot + "mega-manual/mega-manual.html";
+ } else {
+ var new_url = docroot + "singleindex.html";
+ }
+ } else {
+ var new_url = url.replace("singleindex.html", "index.html")
+ }
+
+ if (new_url != url) {
+ navigate_to_first_existing([
+ new_url,
+ 'https://www.yoctoproject.org/docs/',
+ ]);
+ }
+ }
+
+ // Returns the current doctype based upon the url
+ function doctype_segment_from_url(url) {
+ if (url.includes("singleindex") || url.includes("mega-manual"))
+ return "mega";
+ return "single";
+ }
+
+ $(document).ready(function() {
+ var release = DOCUMENTATION_OPTIONS.VERSION;
+ var current_doctype = doctype_segment_from_url(window.location.href);
+ var current_series = release.substr(0, 3);
+ var version_select = build_version_select(current_series, release);
+
+ $('.version_switcher_placeholder').html(version_select);
+ $('.version_switcher_placeholder select').bind('change', on_version_switch);
+
+ var doctype_select = build_doctype_select(current_doctype);
+
+ $('.doctype_switcher_placeholder').html(doctype_select);
+ $('.doctype_switcher_placeholder select').bind('change', on_doctype_switch);
+
+ if (ver_compare(release, "3.1") < 0) {
+ $('#outdated-warning').html('Version ' + release + ' of the project is now considered obsolete, please select and use a more recent version');
+ $('#outdated-warning').css('padding', '.5em');
+ } else if (release != "dev") {
+ $.each(all_versions, function(version, title) {
+ var series = version.substr(0, 3);
+ if (series == current_series && version != release) {
+ $('#outdated-warning').html('This document is for outdated version ' + release + ', you should select the latest release version in this series, ' + version + '.');
+ $('#outdated-warning').css('padding', '.5em');
+ }
+ });
+ }
+ });
+})();
diff --git a/doc/sphinx-static/theme_overrides.css b/doc/sphinx-static/theme_overrides.css
new file mode 100644
index 000000000..e362677a7
--- /dev/null
+++ b/doc/sphinx-static/theme_overrides.css
@@ -0,0 +1,162 @@
+/*
+ SPDX-License-Identifier: CC-BY-2.0-UK
+*/
+
+body {
+ font-family: Verdana, Sans, sans-serif;
+ margin: 0em auto;
+ color: #333;
+}
+
+h1,h2,h3,h4,h5,h6,h7 {
+ font-family: Arial, Sans;
+ color: #00557D;
+ clear: both;
+}
+
+h1 {
+ font-size: 2em;
+ text-align: left;
+ padding: 0em 0em 0em 0em;
+ margin: 2em 0em 0em 0em;
+}
+
+h2.subtitle {
+ margin: 0.10em 0em 3.0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 1.8em;
+ padding-left: 20%;
+ font-weight: normal;
+ font-style: italic;
+}
+
+h2 {
+ margin: 2em 0em 0.66em 0em;
+ padding: 0.5em 0em 0em 0em;
+ font-size: 1.5em;
+ font-weight: bold;
+}
+
+h3.subtitle {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 142.14%;
+ text-align: right;
+}
+
+h3 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 140%;
+ font-weight: bold;
+}
+
+h4 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 120%;
+ font-weight: bold;
+}
+
+h5 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+h6 {
+ margin: 1em 0em 0em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+em {
+ font-weight: bold;
+}
+
+.pre {
+ font-size: medium;
+ font-family: Courier, monospace;
+}
+
+.wy-nav-content a {
+ text-decoration: underline;
+ color: #444;
+ background: transparent;
+}
+
+.wy-nav-content a:hover {
+ text-decoration: underline;
+ background-color: #dedede;
+}
+
+.wy-nav-content a:visited {
+ color: #444;
+}
+
+[alt='Permalink'] { color: #eee; }
+[alt='Permalink']:hover { color: black; }
+
+@media screen {
+ /* content column
+ *
+ * RTD theme's default is 800px as max width for the content, but we have
+ * tables with tons of columns, which need the full width of the view-port.
+ */
+
+ .wy-nav-content{max-width: none; }
+
+ /* inline literal: drop the borderbox, padding and red color */
+ code, .rst-content tt, .rst-content code {
+ color: inherit;
+ border: none;
+ padding: unset;
+ background: inherit;
+ font-size: 85%;
+ }
+
+ .rst-content tt.literal,.rst-content tt.literal,.rst-content code.literal {
+ color: inherit;
+ }
+
+ /* Admonition should be gray, not blue or green */
+ .rst-content .note .admonition-title,
+ .rst-content .tip .admonition-title,
+ .rst-content .warning .admonition-title,
+ .rst-content .caution .admonition-title,
+ .rst-content .important .admonition-title {
+ background: #f0f0f2;
+ color: #00557D;
+
+ }
+
+ .rst-content .note,
+ .rst-content .tip,
+ .rst-content .important,
+ .rst-content .warning,
+ .rst-content .caution {
+ background: #f0f0f2;
+ }
+
+ /* Remove the icon in front of note/tip element, and before the logo */
+ .icon-home:before, .rst-content .admonition-title:before {
+ display: none
+ }
+
+ /* a custom informalexample container is used in some doc */
+ .informalexample {
+ border: 1px solid;
+ border-color: #aaa;
+ margin: 1em 0em;
+ padding: 1em;
+ page-break-inside: avoid;
+ }
+
+ /* Remove the blue background in the top left corner, around the logo */
+ .wy-side-nav-search {
+ background: inherit;
+ }
+
+}