Commit Graph

351 Commits

Author SHA1 Message Date
Michael Opdenacker
51cb23e695 adding missing space in appends
(From yocto-docs rev: 9ae3071f66c1811d847ed559cb773999ff6185fc)

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Reported-by: Quentin Schulz <foss@0leil.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-24 14:00:03 +01:00
Michael Opdenacker
95866fd533 manuals: delete unmaintained history sections
This deletes the history sections in each sub-manual,
which didn't add any value, given that they didn't list
the changes from one Yocto Project version to the next.

(From yocto-docs rev: 29ce5b89c438079793cc6457401b6a9275db877a)

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Reviewed-by: Quentin Schulz <foss@0leil.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-09-18 13:03:45 +01:00
Tom Rini
2eb5550db4 manuals: Rename the "Using .bbappend Files in Your Layer" section
To prepare to add another example bbappend, rename the current "Using
.bbappend Files in Your Layer" section to "Appending Other Layers Metadata
With Your Layer". Name the current example as "Overlaying a File Using
Your Layer".

(From yocto-docs rev: 62d7b5721b2fbcf1e22fc4e7bbac51d52260730e)

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Reviewed-by: Quentin Schulz <foss@0leil.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-14 12:04:24 +01:00
Quentin Schulz
3d93ddf9e8 docs: fix new override syntax migration
Fix bits missed by the migration script.

(From yocto-docs rev: 452e0c5067476fd2ce81f09e6c73da84ced4bbd0)

Signed-off-by: Quentin Schulz <foss@0leil.net>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-14 12:04:23 +01:00
Michael Opdenacker
80859f21b5 kernel-dev manual: overrides syntax updates
Updated with openembedded-core/scripts/contrib/convert-overrides.py

(From yocto-docs rev: d4598b592d1b0c9ce9448a8858eb4f47d83487b2)

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-14 12:04:23 +01:00
Quentin Schulz
5a6fb291ad docs: replace remaining `FOO by :term:FOO`
A few occurences appeared between the time the original patch was sent
and it was applied, this fixes it.

Also, the original patch didn't take into account lowercase terms, this
is now fixed, see module_autoload for example.

Finally, as is often the case with regexp, there was a typo in it that
didn't make it match as much as it should have.

The script that is used to do the replacement of ``FOO`` by :term:`FOO`
is the following Python code:

import re
from pathlib import Path
from runpy import run_module
import contextlib
import io
import sys

re_term = re.compile(r'variables.html#term-([a-zA-Z_0-9]*)')
terms = []
new_terms = set()

with contextlib.redirect_stdout(io.StringIO()) as f:
    run_module('sphinx.ext.intersphinx', run_name='__main__')

objects = f.getvalue()

match = re_term.search(objects)
while match:
    if match.group(1):
        terms.append(match.group(1))
    match = re_term.search(objects, match.end())

for rst in Path('.').rglob('*.rst'):
    with open(rst, 'r') as f:
        content = "".join(f.readlines())
    for term in terms:
        content = re.sub(r'``({})``(?!.*\s+[~=-]{{{:d},}})'.format(term, len(term)), r':term:`\1`', content)

    with open(rst, 'w') as f:
        f.write(content)

This script takes one argument as input: an objects.inv. Bitbake's can
be gotten from https://docs.yoctoproject.org/bitbake/objects.inv. The
objetcs.inv from the current git repo can be gotten from
documentation/_build/html/objetcs.inv after running `make html`.

Note that this excludes from replacement terms that appear in section
titles as it requires refs to be changed too. This can be automated too
if need be but right now it looks a bit confusing to have an anchor link
(for sections) also have a term/reference link in it. I am not sure this
is desired today.

This is the result of two runs of the aforementioned script, once with
Bitbake objects.inv and once with this repo's.

Fixes: ba49d9babfcb "docs: replace ``FOO`` by :term:`FOO` where possible"

(From yocto-docs rev: 1e1b0c4dd241b6657035172b1f7b5f341afa8b25)

Signed-off-by: Quentin Schulz <foss@0leil.net>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-16 21:59:31 +01:00
Quentin Schulz
7d3f57cfd2 docs: replace `FOO by :term:FOO` where possible
If a variable has a glossary entry and some rST files write about those
variables, it's better to point to the glossary entry instead of just
highlighting it by surrounding it with two tick quotes.

This was automated by the following python script:
"""
import re
from pathlib import Path

with open('objects.inv.txt', 'r') as f:
    objects = f.readlines()

with open('bitbake-objects.inv.txt', 'r') as f:
    objects = objects + f.readlines()

re_term = re.compile(r'variables.html#term-([A-Z_0-9]*)')
terms = []

for obj in objects:
    match = re_term.search(obj)
    if match and match.group(1):
        terms.append(match.group(1))

for rst in Path('.').rglob('*.rst'):
    with open(rst, 'r') as f:
        content = "".joing(f.readlines())
    for term in terms:
        content = re.sub(r'``({})``(?!.*\s*[~-]+)'.format(term), r':term:`\1`', content)

    with open(rst, 'w') as f:
        f.write(content)
"""

(From yocto-docs rev: ba49d9babfcb84bc5c26a68c8c3880a1d9c236d3)

Signed-off-by: Quentin Schulz <foss@0leil.net>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Reviewed-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-06-19 16:54:01 +01:00
Michael Opdenacker
020562cfbc kernel-dev manual: simplify style
(From yocto-docs rev: 5bbbed35175ffcabb24bcac305d17563b8d9b9e3)

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-22 12:16:40 +01:00
Michael Opdenacker
d4a82b30b7 manuals: reduce verbosity related to "the following" expression
(From yocto-docs rev: da9d1cfb5c084d172eff3cb10ec3631dd8266260)

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-13 11:28:34 +01:00
Michael Opdenacker
f3540fc691 manuals: reduce verbosity with "worry about" expression
(From yocto-docs rev: 6c65f5f350cdc79a435deb20c48d861d9f4c5c14)

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Reviewed-by: Quentin Schulz <foss@0leil.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-13 11:28:34 +01:00
Daniel Wagenknecht
e145129aaa kernel-dev: document KCONFIG_MODE
(From yocto-docs rev: 12aa6f9c6af68ea03fbb056677213b00d693cf5f)

Signed-off-by: Daniel Wagenknecht <dwagenknecht@emlix.com>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Reviewed-by: Quentin Schulz <foss@0leil.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-13 11:28:34 +01:00
Michael Opdenacker
c3c6de2187 manuals: code insertion simplification over two lines
This simplifies paragraphs ending with a colon and followed
by code insertion.

Automatically substituted through the command:
sed -i -z "s/:\n\s*::/::/g" file.rst

This generates identical HTML output.

(From yocto-docs rev: 28e2192a7c12d64b68061138a9f6c796453eebb1)

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-23 16:39:03 +01:00
Quentin Schulz
c380ba5a17 docs: replace anchor links
Anchor links are treated by Sphinx as external links and are not checked
during build, meaning it is impossible to know if a link becomes broken or
not.

As a matter of fact, most of the anchor links replaced in this commit
were actually broken.

The README now states that anchor links are forbidden so that there's no
need to go through such a change later on.

(From yocto-docs rev: de9e4d26b46afa3c79137d07529a74553400d2e0)

Signed-off-by: Quentin Schulz <foss@0leil.net>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-09 15:24:46 +01:00
Michael Opdenacker
44d0532c89 manuals: Fix typos and spacing
Fix double words, punctuation spacing issues, spacing issues,
"its" instead of "it's", and other trivial issues.

(From yocto-docs rev: 56eb1f340a7af112e62c1d8ad02d4bec0ad88313)

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-06 22:29:49 +01:00
Michael Opdenacker
a306baf850 Do not assume working from $HOME
In the "Yocto Project Quick Build" instructions
(https://docs.yoctoproject.org/brief-yoctoprojectqs/index.html#)
there is an inconsistency that impacts several documents...

People are first instructed to clone the poky git repository, but not
mentioning from which directory. Then, it's consistent to instruct
people to run "cd poky/".

However, later in the instructions, readers are instructed to run "cd
~/poky", which assumes that cloning poky was done from the home
directory. Many other places in the documentation make such an assumption.

This change fixes this, and makes no assumption on where people
have chosen to store their data, in particular where they cloned
the "poky" repository.

This also fixes a few whitespace issues.

(From yocto-docs rev: fd4e365c85df212d7ed70fc1abb3657a4a88b294)

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-23 22:54:55 +00:00
Quentin Schulz
e6a0be545d docs: fix missing & and ; surrounding references from poky.yaml
poky.yaml references are only replaced in files if they are prefixed by
& and suffixed by ;.

Let's fix the missing surrounding characters.

(From yocto-docs rev: 7ee4ba7a27acd87d8c728639d1b053d2e26c6e58)

Signed-off-by: Quentin Schulz <foss@0leil.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-20 00:53:53 +00:00
Paul Barker
d903e586c2 documentation: Simplify oe_wiki and oe_home links
(From yocto-docs rev: 6867f54f349edede37c4085194f51342c24297ed)

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-24 08:23:33 +00:00
Nicolas Dechesne
79fecb25e1 sdk-manual: remove 'sdk' from filenames
All filenames duplicate the 'manual name', which is not needed, and
make all references longer than they should. Rename all files to be as
consise as possible, and fix all references

(From yocto-docs rev: bd8c0f7fc09a39a8bbde1c05b51693955738e148)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-09 12:21:27 +00:00
Nicolas Dechesne
3240a59758 overview-manual: remove 'overview-manual' from filenames
All filenames duplicate the 'manual name', which is not needed, and
make all references longer than they should. Rename all files to be as
consise as possible, and fix all references

(From yocto-docs rev: 4f489a40bb00be018e419802a76fec9dbee3f255)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-09 12:21:27 +00:00
Nicolas Dechesne
a0afa48859 kernel-dev: remove 'kernel-dev' from filenames
All filenames duplicate the 'manual name', which is not needed, and
make all references longer than they should. Rename all files to be as
consise as possible, and fix all references

(From yocto-docs rev: 3d7eb2c5e1d230290c97dd8e5b528086e1d8034a)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-09 12:21:27 +00:00
Nicolas Dechesne
af6f5d821d dev-manual: remove 'dev-manual' from filenames
All filenames duplicate the 'manual name', which is not needed, and
make all references longer than they should. Rename all files to be as
consise as possible, and fix all references

(From yocto-docs rev: 00a9244587e2e63f2a5197ed0dfc89cb330f9275)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-09 12:21:27 +00:00
Nicolas Dechesne
097d0c9f04 sphinx: use absolute paths for :doc: references
:doc: references can be made with absolute path instead of relative
path. This patch was generated with this command:
sed -i 's!:doc:`\.\./!:doc:`/!g' */*.rst *.rst

And a few manual fixup we made for references such as:
:doc:"FOOBAR <../xxx>"

Suggested-by: Robert P. J. Day <rpjday@crashcourse.ca>
(From yocto-docs rev: b7948ec7eb8172b8eae4bfa5c21aab76e123ad85)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-09 12:21:27 +00:00
Nicolas Dechesne
bd17892611 sphinx: rename top level document in each manual
It is more common to call the top level document index.rst. This is
what this patch is doing, along with all required references fixup.

(From yocto-docs rev: 2cea7fbba9210479fc0387d7e1b80da9885558f0)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-09 12:21:27 +00:00
Paul Barker
48748377a4 documentation: Simplify yocto_git links
The yocto_git external link directive is modified to include the
`/cgit/cgit.cgi` element of the URL so that we can simplify the links in
the text.

Manual links to git.yoctoproject.org are converted to use the yocto_git
directive where possible. Note that this directive can't be used in some
places such as example code.

(From yocto-docs rev: 3a8ba5dcc783411c73fe49fb217cbc4d6528d9a7)

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-03 12:04:21 +00:00
Paul Barker
8faafa99cc documentation: Simplify yocto_wiki links
The `yocto_wiki` external link directive is modified to include the
`/wiki` element of the URL so that we can simplify the links in the
text.

Note that there are still a couple of places where this directive
cannot be used, such as in the table of contents in index.rst.

(From yocto-docs rev: d8aa5f93d349f27db3d03a2c4bcc205649f45a8d)

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-03 12:04:21 +00:00
Nicolas Dechesne
63710fc913 sphinx: replace bitbake labels with references to corresponding title
In order to remove autogenerated labels in the bibtake docs, let's use
section titles in all YP docs.

(From yocto-docs rev: 0f44b6027f16cc37260abc7e00042d98e2e0427f)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-03 12:04:20 +00:00
Nicolas Dechesne
912a3c52e2 {dev,kernel,sdk}-manual: replace hardcoded release version with &DISTRO;
In the Docbook files we had DISTRO, but somehow it was lost during the
migration to Sphinx.

(From yocto-docs rev: d10bb13070039e17281fccc5c1a64b5bfed30543)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-03 12:04:20 +00:00
Nicolas Dechesne
d54b7f2e00 kernel-dev: remove unused labels
(From yocto-docs rev: 98c0f58fb88fe8dffb00751826bc2927fd488a42)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-20 14:32:25 +00:00
Nicolas Dechesne
043592a585 kernel-dev: replace labels with references to section title
(From yocto-docs rev: 0a0a5d3ad6c2e551db0d43b1e76b8c459c347dc5)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-20 14:32:25 +00:00
Quentin Schulz
bb08435ebf docs: kernel-dev-faq: update outdated RDEPENDS_kernel-base
Since 2.5 (sumo), RDEPENDS_kernel-base has been replaced by
RDEPENDS_${KERNEL_PACKAGE_NAME}-base, so let's use this one instead.

(From yocto-docs rev: 0639160185969a6761e9911a166b897a015f4d59)

Signed-off-by: Quentin Schulz <foss@0leil.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-27 13:23:00 +00:00
Quentin Schulz
4dc272c4b9 docs: kernel-dev-common: add .patch file extension to SRC_URI files
Patches provided in SRC_URI are only applied if their extension is .diff or
.patch. The examples do not use those extensions and would probably result
in user confusion as to why the patches aren't being applied to the
sources.

Let's fix this by giving them a .patch file extension.

(From yocto-docs rev: 0858e86ed8e3e3005207980041fe4f2117750663)

Signed-off-by: Quentin Schulz <foss@0leil.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-27 13:23:00 +00:00
Quentin Schulz
08d7d5c243 docs: kernel-dev: fix typos, highlights and links
(From yocto-docs rev: a69247321ff34cb0a2b9a8cc62020ec7f3aad834)

Signed-off-by: Quentin Schulz <foss@0leil.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-27 13:23:00 +00:00
Richard Purdie
fe74a4edd2 docs: Fix license CC-BY-2.0-UK -> CC-BY-SA-2.0-UK
When the license identifier tags were added, an incorrect string was used
and the Share-Alike clause was lost. Fix this to match the license
description in the files and add back the lost piece (its clear from
the history it should be there)

(From yocto-docs rev: 8d30c3d792755a7bfdb74b331dad98f51d3516af)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-08 11:28:30 +01:00
Nicolas Dechesne
43d07a2851 sphinx: remove DocBook files
The Yocto Project documentation was migrated to Sphinx. Let's remove
the deprecated DocBook files.

(From yocto-docs rev: 28fb0e63b2fbfd6426b00498bf2682bb53fdd862)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-06 13:56:17 +01:00
Quentin Schulz
c387f0c254 sphinx: replace special quotes with single and double quotes
(From yocto-docs rev: 0aeb7a94abcef3cb3850c753dd0a243f381e6675)

Signed-off-by: Quentin Schulz <foss@0leil.net>
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-17 10:09:36 +01:00
Richard Purdie
cb37a15cf5 sphinx: kernel-dev: Various URL, code block and other fixes to imported data
(From yocto-docs rev: 4888b49ccc5d133b4096e5a9b808f14d1afc7deb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-17 10:09:35 +01:00
Nicolas Dechesne
721edcfd44 sphinx: insert blank below between title and toc
Whenever a TOC follows a title/heading, a blank line is missing. So
let's add it explicitely.

(From yocto-docs rev: 600b6fe7837dd817d32350e1a45431bdcfe8ebbd)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-17 10:09:34 +01:00
Richard Purdie
8f04fc5824 sphinx: manuals: Move boilerplate after toctree
The boilerplate looks better after the ToC, still not quite
right but the boilerplate can be improved from here.

(From yocto-docs rev: 5e81b9c90f6f45acf26ba146e280bc2659ac14e5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-17 10:09:34 +01:00
Richard Purdie
83ebbf63e9 sphinx: history: Move revision history to its own section
The revision history tables look better in their own section,
move them.

(From yocto-docs rev: 27bf0f69b6dc04cea97a023ef52bec2b213d074f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-17 10:09:34 +01:00
Nicolas Dechesne
f3e7db78ad sphinx: add links to section in the Bitbake manual
Use intersphinx extension to replace links to the Bitbake manual with
proper cross references.

(From yocto-docs rev: 458a6e540a2286ac838812d802306806f77b885c)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-17 10:09:34 +01:00
Nicolas Dechesne
28afbf81ec sphinx: fix links when the link text should be displayed
When an hyperlink should be display in the output, there is no need to
any specific syntax or marker, the parser finds links and mail
addresses in ordinary text. Somehow the conversion from pandoc
generated wrong output in the form: ` <link>`__. This patch is
generated using the following Python regexp:

    line = re.sub("` <(https?://.*)>`__",
                  "\\1",
                  line)

(From yocto-docs rev: a35d735a74425dff34c63c086947624467658c40)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-17 10:09:34 +01:00
Nicolas Dechesne
283ed72d48 sphinx: add links for Yocto project website
In DocBook, variables are used to create custom links (note that it is
not consistent everywhere, since some web addresses are still
hardcoded), such as YOCTO_HOME_URL, YOCTO_GIT_URL, YOCTO_WIKI_URL,
YOCTO_BUGS_URL and YOCTO_DL_URL..

In Sphinx they are replaced with extlinks.

(From yocto-docs rev: d25f3095a9d29a3355581d0743f27b2a423ad580)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-17 10:09:34 +01:00
Nicolas Dechesne
ffa58f2985 sphinx: kernel-dev: add figures
(From yocto-docs rev: cd859cca2e6861fbb5bac68c2f6e972285c47dcb)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-17 10:09:33 +01:00
Nicolas Dechesne
424567d629 sphinx: manual updates for some links
Some links were not found by the regexp, especially because of they
are spanning across multiple lines. This patch is a manual fixup for
these patterns.

(From yocto-docs rev: 7a5cf8b372903d959d4a1f0882e6198f31f3cba5)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-17 10:09:33 +01:00
Nicolas Dechesne
4bf6fc5281 sphinx: fix custom term links
Some term links have custom 'text', and require manual update, since
they were not caught by the generic Python regexp.

(From yocto-docs rev: 519355ba9daf7630e8d477b2f6f511be51fd8b2e)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-17 10:09:33 +01:00
Nicolas Dechesne
c473fa2292 sphinx: fix internal links
Many of the internal links were not converted probably from DocBook
using pandoc. After looking at the various patterns, the follow series
of 'naive' Python regexp were used to perform some additional
automatic conversion.

Also, since we rely on built-in glossary, all links to terms need to
use the sphinx :term: syntax.

This commit is generated using the following Python series of regexp:

   line = re.sub("`+(\w+)`* <(\&YOCTO_DOCS_REF_URL;)?#var-\\1>`__",
                 ":term:`\\1`",
                 line)

   line = re.sub("`+do_([a-z_]+)`* <(\&YOCTO_DOCS_REF_URL;)?#ref-tasks-\\1>`__",
                 ":ref:`ref-tasks-\\1`",
                 line)

   line = re.sub("`+([a-z_\-\*\.]+).bbclass`* <(\&YOCTO_DOCS_REF_URL;)?#ref-classes-\\1>`__",
                 ":ref:`\\1.bbclass <ref-classes-\\1>`",
                 line)

   line = re.sub("`+([a-z_\-\*\.]+)`* <(\&YOCTO_DOCS_REF_URL;)?#ref-classes-\\1>`__",
                 ":ref:`\\1 <ref-classes-\\1>`",
                 line)

   line = re.sub("`Source Directory <(\&YOCTO_DOCS_REF_URL;)?#source-directory>`__",
                 ":term:`Source Directory`",
                 line)

   line = re.sub("`Build Directory <(\&YOCTO_DOCS_REF_URL;)?#build-directory>`__",
                 ":term:`Build Directory`",
                 line)

   line = re.sub("`Metadata <(\&YOCTO_DOCS_REF_URL;)?#metadata>`__",
                 ":term:`Metadata`",
                 line)

   line = re.sub("`BitBake <(\&YOCTO_DOCS_REF_URL;)?#bitbake-term>`__",
                 ":term:`BitBake`",
                 line)

   line = re.sub("`Images <(\&YOCTO_DOCS_REF_URL;)?#ref-images>`__",
                 ":ref:`ref-manual/ref-images:Images`",
                 line)

   line = re.sub("`Classes <(\&YOCTO_DOCS_REF_URL;)?#ref-classes>`__",
                 ":ref:`ref-manual/ref-classes:Classes`",
                 line)

   line = re.sub("`workspace <(\&YOCTO_DOCS_REF_URL;)?#devtool-the-workspace-layer-structure>`__",
                 ":ref:`devtool-the-workspace-layer-structure`",
                 line)

   line = re.sub("`Open-?Embedded b?B?uild s?S?ystem <(\&YOCTO_DOCS_REF_URL;)?#build-system-term>`__",
                 ":term:`OpenEmbedded Build System`",
                 line)

   line = re.sub("`(OpenEmbedded-Core )?(\(?OE-Core\)? )?<(\&YOCTO_DOCS_REF_URL;)?#oe-core>`__",
                 ":term:`OpenEmbedded-Core (OE-Core)`",
                 line)

It won't catch multiline strings, but it catches a very large number
of occurences!

(From yocto-docs rev: 3f537d17de5b1fb76ba3bee196481984a4826378)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-17 10:09:33 +01:00
Nicolas Dechesne
17f1c2ce04 sphinx: ref-manual: add revision history table
(From yocto-docs rev: 36d1073119081b9c364f48aedf4086881bef03d6)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-17 10:09:33 +01:00
Nicolas Dechesne
461e2e843d sphinx: add boilerplate to manuals
(From yocto-docs rev: d552acdc60c8a0467b649b95183b87b3345a4f8c)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-17 10:09:33 +01:00
Nicolas Dechesne
7ea70a656b sphinx: Add SPDX license headers
SPDX headers have been added to each file, and match the headers used
in the DocBook files.

(From yocto-docs rev: 79dbb0007ae24da4a3689a23e921f2a2638757f7)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-17 10:09:33 +01:00
Nicolas Dechesne
9bd69b1f1d sphinx: initial sphinx support
This commit is autogenerated pandoc to generate an inital set
of reST files based on DocBook XML files.

A .rst file is generated for each .xml files in all manuals with this
command:

cd <manual>
for i in *.xml; do \
  pandoc -f docbook -t rst --shift-heading-level-by=-1 \
  $i -o $(basename $i .xml).rst \
done

The conversion was done with: pandoc 2.9.2.1-91 (Arch Linux).

Also created an initial top level index file for each document, and
added all 'books' to the top leve index.rst file.

The YP manuals layout is organized as:

Book
  Chapter
    Section
      Section
        Section

Sphinx uses section headers to create the document structure.
ReStructuredText defines sections headers like that:

   To break longer text up into sections, you use section headers. These
   are a single line of text (one or more words) with adornment: an
   underline alone, or an underline and an overline together, in dashes
   "-----", equals "======", tildes "~~~~~~" or any of the
   non-alphanumeric characters = - ` : ' " ~ ^ _ * + # < > that you feel
   comfortable with. An underline-only adornment is distinct from an
   overline-and-underline adornment using the same character. The
   underline/overline must be at least as long as the title text. Be
   consistent, since all sections marked with the same adornment style
   are deemed to be at the same level:

Let's define the following convention when converting from Docbook:

Book                => overline ===   (Title)
  Chapter           => overline ***   (1.)
    Section         => ====           (1.1)
      Section       => ----           (1.1.1)
        Section     => ~~~~           (1.1.1.1)
          Section   => ^^^^           (1.1.1.1.1)

During the conversion with pandoc, we used --shift-heading-level=-1 to
convert most of DocBook headings automatically. However with this
setting, the Chapter header was removed, so I added it back
manually. Without this setting all headings were off by one, which was
more difficult to manually fix.

At least with this change, we now have the same TOC with Sphinx and
DocBook.

(From yocto-docs rev: 3c73d64a476d4423ee4c6808c685fa94d88d7df8)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-17 10:09:33 +01:00