summaryrefslogtreecommitdiffstats
path: root/bitbake/doc/sphinx-static
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2020-11-13 00:21:41 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-04 10:55:00 +0000
commit22384b2fe567406b3c318b2edd0d23dee0d72023 (patch)
treeb19414c699324722f371d4138c305e925a43da95 /bitbake/doc/sphinx-static
parent16d477fa5d2bec49ccd83ede8249431d30e0c80c (diff)
downloadpoky-22384b2fe567406b3c318b2edd0d23dee0d72023.tar.gz
bitbake: 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' ') (Bitbake rev: cd68f14031eb45006b44d10b348e35c69ac21ad0) Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/doc/sphinx-static')
-rw-r--r--bitbake/doc/sphinx-static/switchers.js233
-rw-r--r--bitbake/doc/sphinx-static/theme_overrides.css162
2 files changed, 395 insertions, 0 deletions
diff --git a/bitbake/doc/sphinx-static/switchers.js b/bitbake/doc/sphinx-static/switchers.js
new file mode 100644
index 0000000000..32113cfa96
--- /dev/null
+++ b/bitbake/doc/sphinx-static/switchers.js
@@ -0,0 +1,233 @@
1(function() {
2 'use strict';
3
4 var all_versions = {
5 'dev': 'dev (3.2)',
6 '3.1.2': '3.1.2',
7 '3.0.3': '3.0.3',
8 '2.7.4': '2.7.4',
9 };
10
11 var all_doctypes = {
12 'single': 'Individual Webpages',
13 'mega': "All-in-one 'Mega' Manual",
14 };
15
16 // Simple version comparision
17 // Return 1 if a > b
18 // Return -1 if a < b
19 // Return 0 if a == b
20 function ver_compare(a, b) {
21 if (a == "dev") {
22 return 1;
23 }
24
25 if (a === b) {
26 return 0;
27 }
28
29 var a_components = a.split(".");
30 var b_components = b.split(".");
31
32 var len = Math.min(a_components.length, b_components.length);
33
34 // loop while the components are equal
35 for (var i = 0; i < len; i++) {
36 // A bigger than B
37 if (parseInt(a_components[i]) > parseInt(b_components[i])) {
38 return 1;
39 }
40
41 // B bigger than A
42 if (parseInt(a_components[i]) < parseInt(b_components[i])) {
43 return -1;
44 }
45 }
46
47 // If one's a prefix of the other, the longer one is greater.
48 if (a_components.length > b_components.length) {
49 return 1;
50 }
51
52 if (a_components.length < b_components.length) {
53 return -1;
54 }
55
56 // Otherwise they are the same.
57 return 0;
58 }
59
60 function build_version_select(current_series, current_version) {
61 var buf = ['<select>'];
62
63 $.each(all_versions, function(version, title) {
64 var series = version.substr(0, 3);
65 if (series == current_series) {
66 if (version == current_version)
67 buf.push('<option value="' + version + '" selected="selected">' + title + '</option>');
68 else
69 buf.push('<option value="' + version + '">' + title + '</option>');
70
71 if (version != current_version)
72 buf.push('<option value="' + current_version + '" selected="selected">' + current_version + '</option>');
73 } else {
74 buf.push('<option value="' + version + '">' + title + '</option>');
75 }
76 });
77
78 buf.push('</select>');
79 return buf.join('');
80 }
81
82 function build_doctype_select(current_doctype) {
83 var buf = ['<select>'];
84
85 $.each(all_doctypes, function(doctype, title) {
86 if (doctype == current_doctype)
87 buf.push('<option value="' + doctype + '" selected="selected">' +
88 all_doctypes[current_doctype] + '</option>');
89 else
90 buf.push('<option value="' + doctype + '">' + title + '</option>');
91 });
92 if (!(current_doctype in all_doctypes)) {
93 // In case we're browsing a doctype that is not yet in all_doctypes.
94 buf.push('<option value="' + current_doctype + '" selected="selected">' +
95 current_doctype + '</option>');
96 all_doctypes[current_doctype] = current_doctype;
97 }
98 buf.push('</select>');
99 return buf.join('');
100 }
101
102 function navigate_to_first_existing(urls) {
103 // Navigate to the first existing URL in urls.
104 var url = urls.shift();
105
106 // Web browsers won't redirect file:// urls to file urls using ajax but
107 // its useful for local testing
108 if (url.startsWith("file://")) {
109 window.location.href = url;
110 return;
111 }
112
113 if (urls.length == 0) {
114 window.location.href = url;
115 return;
116 }
117 $.ajax({
118 url: url,
119 success: function() {
120 window.location.href = url;
121 },
122 error: function() {
123 navigate_to_first_existing(urls);
124 }
125 });
126 }
127
128 function get_docroot_url() {
129 var url = window.location.href;
130 var root = DOCUMENTATION_OPTIONS.URL_ROOT;
131
132 var urlarray = url.split('/');
133 // Trim off anything after '/'
134 urlarray.pop();
135 var depth = (root.match(/\.\.\//g) || []).length;
136 for (var i = 0; i < depth; i++) {
137 urlarray.pop();
138 }
139
140 return urlarray.join('/') + '/';
141 }
142
143 function on_version_switch() {
144 var selected_version = $(this).children('option:selected').attr('value');
145 var url = window.location.href;
146 var current_version = DOCUMENTATION_OPTIONS.VERSION;
147 var docroot = get_docroot_url()
148
149 var new_versionpath = selected_version + '/';
150 if (selected_version == "dev")
151 new_versionpath = '';
152
153 // dev versions have no version prefix
154 if (current_version == "dev") {
155 var new_url = docroot + new_versionpath + url.replace(docroot, "");
156 var fallback_url = docroot + new_versionpath;
157 } else {
158 var new_url = url.replace('/' + current_version + '/', '/' + new_versionpath);
159 var fallback_url = new_url.replace(url.replace(docroot, ""), "");
160 }
161
162 console.log(get_docroot_url())
163 console.log(url + " to url " + new_url);
164 console.log(url + " to fallback " + fallback_url);
165
166 if (new_url != url) {
167 navigate_to_first_existing([
168 new_url,
169 fallback_url,
170 'https://www.yoctoproject.org/docs/',
171 ]);
172 }
173 }
174
175 function on_doctype_switch() {
176 var selected_doctype = $(this).children('option:selected').attr('value');
177 var url = window.location.href;
178 if (selected_doctype == 'mega') {
179 var docroot = get_docroot_url()
180 var current_version = DOCUMENTATION_OPTIONS.VERSION;
181 // Assume manuals before 3.2 are using old docbook mega-manual
182 if (ver_compare(current_version, "3.2") < 0) {
183 var new_url = docroot + "mega-manual/mega-manual.html";
184 } else {
185 var new_url = docroot + "singleindex.html";
186 }
187 } else {
188 var new_url = url.replace("singleindex.html", "index.html")
189 }
190
191 if (new_url != url) {
192 navigate_to_first_existing([
193 new_url,
194 'https://www.yoctoproject.org/docs/',
195 ]);
196 }
197 }
198
199 // Returns the current doctype based upon the url
200 function doctype_segment_from_url(url) {
201 if (url.includes("singleindex") || url.includes("mega-manual"))
202 return "mega";
203 return "single";
204 }
205
206 $(document).ready(function() {
207 var release = DOCUMENTATION_OPTIONS.VERSION;
208 var current_doctype = doctype_segment_from_url(window.location.href);
209 var current_series = release.substr(0, 3);
210 var version_select = build_version_select(current_series, release);
211
212 $('.version_switcher_placeholder').html(version_select);
213 $('.version_switcher_placeholder select').bind('change', on_version_switch);
214
215 var doctype_select = build_doctype_select(current_doctype);
216
217 $('.doctype_switcher_placeholder').html(doctype_select);
218 $('.doctype_switcher_placeholder select').bind('change', on_doctype_switch);
219
220 if (ver_compare(release, "3.1") < 0) {
221 $('#outdated-warning').html('Version ' + release + ' of the project is now considered obsolete, please select and use a more recent version');
222 $('#outdated-warning').css('padding', '.5em');
223 } else if (release != "dev") {
224 $.each(all_versions, function(version, title) {
225 var series = version.substr(0, 3);
226 if (series == current_series && version != release) {
227 $('#outdated-warning').html('This document is for outdated version ' + release + ', you should select the latest release version in this series, ' + version + '.');
228 $('#outdated-warning').css('padding', '.5em');
229 }
230 });
231 }
232 });
233})();
diff --git a/bitbake/doc/sphinx-static/theme_overrides.css b/bitbake/doc/sphinx-static/theme_overrides.css
new file mode 100644
index 0000000000..e362677a7f
--- /dev/null
+++ b/bitbake/doc/sphinx-static/theme_overrides.css
@@ -0,0 +1,162 @@
1/*
2 SPDX-License-Identifier: CC-BY-2.0-UK
3*/
4
5body {
6 font-family: Verdana, Sans, sans-serif;
7 margin: 0em auto;
8 color: #333;
9}
10
11h1,h2,h3,h4,h5,h6,h7 {
12 font-family: Arial, Sans;
13 color: #00557D;
14 clear: both;
15}
16
17h1 {
18 font-size: 2em;
19 text-align: left;
20 padding: 0em 0em 0em 0em;
21 margin: 2em 0em 0em 0em;
22}
23
24h2.subtitle {
25 margin: 0.10em 0em 3.0em 0em;
26 padding: 0em 0em 0em 0em;
27 font-size: 1.8em;
28 padding-left: 20%;
29 font-weight: normal;
30 font-style: italic;
31}
32
33h2 {
34 margin: 2em 0em 0.66em 0em;
35 padding: 0.5em 0em 0em 0em;
36 font-size: 1.5em;
37 font-weight: bold;
38}
39
40h3.subtitle {
41 margin: 0em 0em 1em 0em;
42 padding: 0em 0em 0em 0em;
43 font-size: 142.14%;
44 text-align: right;
45}
46
47h3 {
48 margin: 1em 0em 0.5em 0em;
49 padding: 1em 0em 0em 0em;
50 font-size: 140%;
51 font-weight: bold;
52}
53
54h4 {
55 margin: 1em 0em 0.5em 0em;
56 padding: 1em 0em 0em 0em;
57 font-size: 120%;
58 font-weight: bold;
59}
60
61h5 {
62 margin: 1em 0em 0.5em 0em;
63 padding: 1em 0em 0em 0em;
64 font-size: 110%;
65 font-weight: bold;
66}
67
68h6 {
69 margin: 1em 0em 0em 0em;
70 padding: 1em 0em 0em 0em;
71 font-size: 110%;
72 font-weight: bold;
73}
74
75em {
76 font-weight: bold;
77}
78
79.pre {
80 font-size: medium;
81 font-family: Courier, monospace;
82}
83
84.wy-nav-content a {
85 text-decoration: underline;
86 color: #444;
87 background: transparent;
88}
89
90.wy-nav-content a:hover {
91 text-decoration: underline;
92 background-color: #dedede;
93}
94
95.wy-nav-content a:visited {
96 color: #444;
97}
98
99[alt='Permalink'] { color: #eee; }
100[alt='Permalink']:hover { color: black; }
101
102@media screen {
103 /* content column
104 *
105 * RTD theme's default is 800px as max width for the content, but we have
106 * tables with tons of columns, which need the full width of the view-port.
107 */
108
109 .wy-nav-content{max-width: none; }
110
111 /* inline literal: drop the borderbox, padding and red color */
112 code, .rst-content tt, .rst-content code {
113 color: inherit;
114 border: none;
115 padding: unset;
116 background: inherit;
117 font-size: 85%;
118 }
119
120 .rst-content tt.literal,.rst-content tt.literal,.rst-content code.literal {
121 color: inherit;
122 }
123
124 /* Admonition should be gray, not blue or green */
125 .rst-content .note .admonition-title,
126 .rst-content .tip .admonition-title,
127 .rst-content .warning .admonition-title,
128 .rst-content .caution .admonition-title,
129 .rst-content .important .admonition-title {
130 background: #f0f0f2;
131 color: #00557D;
132
133 }
134
135 .rst-content .note,
136 .rst-content .tip,
137 .rst-content .important,
138 .rst-content .warning,
139 .rst-content .caution {
140 background: #f0f0f2;
141 }
142
143 /* Remove the icon in front of note/tip element, and before the logo */
144 .icon-home:before, .rst-content .admonition-title:before {
145 display: none
146 }
147
148 /* a custom informalexample container is used in some doc */
149 .informalexample {
150 border: 1px solid;
151 border-color: #aaa;
152 margin: 1em 0em;
153 padding: 1em;
154 page-break-inside: avoid;
155 }
156
157 /* Remove the blue background in the top left corner, around the logo */
158 .wy-side-nav-search {
159 background: inherit;
160 }
161
162}