docs: use code-blocks

Sphinx can syntax-highlight a block if we use the right syntax.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4630>
This commit is contained in:
Erik Faye-Lund
2019-06-04 14:14:13 +02:00
committed by Marge Bot
parent bf3f0f7a82
commit d6be994ef8
8 changed files with 39 additions and 39 deletions

View File

@@ -35,7 +35,7 @@ than the given year.
For example, if the game was released in 2001, do For example, if the game was released in 2001, do
:: .. code-block:: console
export MESA_EXTENSION_MAX_YEAR=2001 export MESA_EXTENSION_MAX_YEAR=2001

View File

@@ -17,7 +17,7 @@ Basic formatting guidelines
- Opening braces go on the same line as the if/for/while statement. For - Opening braces go on the same line as the if/for/while statement. For
example: example:
:: .. code-block:: c
if (condition) { if (condition) {
foo; foo;
@@ -30,7 +30,7 @@ Basic formatting guidelines
- This GNU indent command generally does the right thing for - This GNU indent command generally does the right thing for
formatting: formatting:
:: .. code-block:: console
indent -br -i3 -npcs --no-tabs infile.c -o outfile.c indent -br -i3 -npcs --no-tabs infile.c -o outfile.c
@@ -41,20 +41,20 @@ Basic formatting guidelines
Single-line comments: Single-line comments:
:: .. code-block:: c
/* null-out pointer to prevent dangling reference below */ /* null-out pointer to prevent dangling reference below */
bufferObj = NULL; bufferObj = NULL;
Or, Or,
:: .. code-block:: c
bufferObj = NULL; /* prevent dangling reference below */ bufferObj = NULL; /* prevent dangling reference below */
Multi-line comment: Multi-line comment:
:: .. code-block:: c
/* If this is a new buffer object id, or one which was generated but /* If this is a new buffer object id, or one which was generated but
* never used before, allocate a buffer object now. * never used before, allocate a buffer object now.
@@ -62,7 +62,7 @@ Basic formatting guidelines
We try to quote the OpenGL specification where prudent: We try to quote the OpenGL specification where prudent:
:: .. code-block:: c
/* Page 38 of the PDF of the OpenGL ES 3.0 spec says: /* Page 38 of the PDF of the OpenGL ES 3.0 spec says:
* *
@@ -78,7 +78,7 @@ Basic formatting guidelines
Function comment example: Function comment example:
:: .. code-block:: c
/** /**
* Create and initialize a new buffer object. Called via the * Create and initialize a new buffer object. Called via the

View File

@@ -13,7 +13,7 @@ To add a new GL extension to Mesa you have to do at least the following.
- If ``glext.h`` doesn't define the extension, edit ``include/GL/gl.h`` - If ``glext.h`` doesn't define the extension, edit ``include/GL/gl.h``
and add code like this: and add code like this:
:: .. code-block:: c
#ifndef GL_EXT_the_extension_name #ifndef GL_EXT_the_extension_name
#define GL_EXT_the_extension_name 1 #define GL_EXT_the_extension_name 1

View File

@@ -25,13 +25,13 @@ Mesa releases are available in two formats: ``.tar.xz`` and ``.tar.gz``.
To unpack the tarball: To unpack the tarball:
:: .. code-block:: console
tar xf mesa-Y.N.P.tar.xz tar xf mesa-Y.N.P.tar.xz
or or
:: .. code-block:: console
tar xf mesa-Y.N.P.tar.gz tar xf mesa-Y.N.P.tar.gz

View File

@@ -18,7 +18,7 @@ Build EGL
#. Configure your build with the desired client APIs and enable the #. Configure your build with the desired client APIs and enable the
driver for your hardware. For example: driver for your hardware. For example:
:: .. code-block:: console
$ meson configure \ $ meson configure \
-D egl=true \ -D egl=true \

View File

@@ -32,7 +32,7 @@ Requirements
For Linux, on a recent Debian based distribution do: For Linux, on a recent Debian based distribution do:
:: .. code-block:: console
aptitude install llvm-dev aptitude install llvm-dev
@@ -43,7 +43,7 @@ Requirements
For a RPM-based distribution do: For a RPM-based distribution do:
:: .. code-block:: console
yum install llvm-devel yum install llvm-devel
@@ -75,13 +75,13 @@ Building
To build everything on Linux invoke scons as: To build everything on Linux invoke scons as:
:: .. code-block:: console
scons build=debug libgl-xlib scons build=debug libgl-xlib
Alternatively, you can build it with meson with: Alternatively, you can build it with meson with:
:: .. code-block:: console
mkdir build mkdir build
cd build cd build
@@ -91,7 +91,7 @@ Alternatively, you can build it with meson with:
but the rest of these instructions assume that scons is used. For but the rest of these instructions assume that scons is used. For
Windows the procedure is similar except the target: Windows the procedure is similar except the target:
:: .. code-block:: console
scons platform=windows build=debug libgl-gdi scons platform=windows build=debug libgl-gdi

View File

@@ -28,13 +28,13 @@ Unix-like OSes
If Meson is not already installed on your system, you can typically If Meson is not already installed on your system, you can typically
install it with your package installer. For example: install it with your package installer. For example:
:: .. code-block:: console
sudo apt-get install meson # Ubuntu sudo apt-get install meson # Ubuntu
or or
:: .. code-block:: console
sudo dnf install meson # Fedora sudo dnf install meson # Fedora
@@ -54,20 +54,20 @@ modules (mako). You also need pkg-config (a hard dependency of meson),
flex, and bison. The easiest way to install everything you need is with flex, and bison. The easiest way to install everything you need is with
`chocolatey <https://chocolatey.org/>`__. `chocolatey <https://chocolatey.org/>`__.
:: .. code-block:: console
choco install python3 winflexbison pkgconfiglite choco install python3 winflexbison pkgconfiglite
You can even use chocolatey to install mingw and ninja (ninja can be You can even use chocolatey to install mingw and ninja (ninja can be
used with MSVC as well) used with MSVC as well)
:: .. code-block:: console
choco install ninja mingw choco install ninja mingw
Then install meson using pip Then install meson using pip
:: .. code-block:: console
py -3 -m pip install meson mako py -3 -m pip install meson mako
@@ -92,7 +92,7 @@ for each configuration you might want to use.
Basic configuration is done with: Basic configuration is done with:
:: .. code-block:: console
meson build/ meson build/
@@ -102,7 +102,7 @@ configuration option (see below).
To review the options which Meson chose, run: To review the options which Meson chose, run:
:: .. code-block:: console
meson configure build/ meson configure build/
@@ -118,7 +118,7 @@ With additional arguments ``meson configure`` can be used to change
options for a previously configured build directory. All options passed options for a previously configured build directory. All options passed
to this command are in the form ``-D "option"="value"``. For example: to this command are in the form ``-D "option"="value"``. For example:
:: .. code-block:: console
meson configure build/ -Dprefix=/tmp/install -Dglx=true meson configure build/ -Dprefix=/tmp/install -Dglx=true
@@ -131,7 +131,7 @@ an empty list (``-D platforms=[]``).
Once you've run the initial ``meson`` command successfully you can use Once you've run the initial ``meson`` command successfully you can use
your configured backend to build the project in your build directory: your configured backend to build the project in your build directory:
:: .. code-block:: console
ninja -C build/ ninja -C build/
@@ -139,7 +139,7 @@ The next step is to install the Mesa libraries, drivers, etc. This also
finishes up some final steps of the build process (such as creating finishes up some final steps of the build process (such as creating
symbolic links for drivers). To install: symbolic links for drivers). To install:
:: .. code-block:: console
ninja -C build/ install ninja -C build/ install
@@ -149,7 +149,7 @@ symbolic links for drivers). To install:
configuration tool) as part of the build process, Meson does not do configuration tool) as part of the build process, Meson does not do
this. Instead, you will need do this: this. Instead, you will need do this:
:: .. code-block:: console
ninja -C build/ xmlpool-pot xmlpool-update-po xmlpool-gmo ninja -C build/ xmlpool-pot xmlpool-update-po xmlpool-gmo
@@ -188,7 +188,7 @@ Developers will often want to install Mesa to a testing directory rather
than the system library directory. This can be done with the --prefix than the system library directory. This can be done with the --prefix
option. For example: option. For example:
:: .. code-block:: console
meson --prefix="${PWD}/build/install" build/ meson --prefix="${PWD}/build/install" build/
@@ -211,7 +211,7 @@ they are guaranteed to persist across rebuilds and reconfigurations.
This example sets -fmax-errors for compiling C sources and -DMAGIC=123 This example sets -fmax-errors for compiling C sources and -DMAGIC=123
for C++ sources: for C++ sources:
:: .. code-block:: console
meson builddir/ -Dc_args=-fmax-errors=10 -Dcpp_args=-DMAGIC=123 meson builddir/ -Dc_args=-fmax-errors=10 -Dcpp_args=-DMAGIC=123
@@ -226,7 +226,7 @@ build dir for a different compiler.
This is an example of specifying the clang compilers and cleaning the This is an example of specifying the clang compilers and cleaning the
build directory before reconfiguring with an extra C option: build directory before reconfiguring with an extra C option:
:: .. code-block:: console
CC=clang CXX=clang++ meson build-clang CC=clang CXX=clang++ meson build-clang
ninja -C build-clang ninja -C build-clang
@@ -251,7 +251,7 @@ libraries, it will never find libllvm.so. There is also a
``-Dcmake_module_path`` option in this meson version, which points to ``-Dcmake_module_path`` option in this meson version, which points to
the root of an alternative installation (the prefix). For example: the root of an alternative installation (the prefix). For example:
:: .. code-block:: console
meson builddir -Dcmake_module_path=/home/user/mycmake/prefix meson builddir -Dcmake_module_path=/home/user/mycmake/prefix
@@ -270,7 +270,7 @@ custom-llvm.ini
Then configure meson: Then configure meson:
:: .. code-block:: console
meson builddir/ --native-file custom-llvm.ini meson builddir/ --native-file custom-llvm.ini
@@ -279,7 +279,7 @@ Meson < 0.49 doesn't support native files, so to specify a custom
windows), which will be searched for ``llvm-config``, windows), which will be searched for ``llvm-config``,
``llvm-config$version``, and ``llvm-config-$version``: ``llvm-config$version``, and ``llvm-config-$version``:
:: .. code-block:: console
PATH=/path/to/folder/with/llvm-config:$PATH meson build PATH=/path/to/folder/with/llvm-config:$PATH meson build
@@ -300,7 +300,7 @@ Obviously, only cmake or llvm-config is required.
Then configure meson: Then configure meson:
:: .. code-block:: console
meson builddir/ --cross-file cross-llvm.ini meson builddir/ --cross-file cross-llvm.ini

View File

@@ -383,7 +383,7 @@ Git tips
- ``git rebase -i ...`` is your friend. Don't be afraid to use it. - ``git rebase -i ...`` is your friend. Don't be afraid to use it.
- Apply a fixup to commit FOO. - Apply a fixup to commit FOO.
:: .. code-block:: console
git add ... git add ...
git commit --fixup=FOO git commit --fixup=FOO
@@ -391,20 +391,20 @@ Git tips
- Test for build breakage between patches e.g last 8 commits. - Test for build breakage between patches e.g last 8 commits.
:: .. code-block:: console
git rebase -i --exec="ninja -C build/" HEAD~8 git rebase -i --exec="ninja -C build/" HEAD~8
- Sets the default mailing address for your repo. - Sets the default mailing address for your repo.
:: .. code-block:: console
git config --local sendemail.to mesa-dev@lists.freedesktop.org git config --local sendemail.to mesa-dev@lists.freedesktop.org
- Add version to subject line of patch series in this case for the last - Add version to subject line of patch series in this case for the last
8 commits before sending. 8 commits before sending.
:: .. code-block:: console
git send-email --subject-prefix="PATCH v4" HEAD~8 git send-email --subject-prefix="PATCH v4" HEAD~8
git send-email -v4 @~8 # shorter version, inherited from git format-patch git send-email -v4 @~8 # shorter version, inherited from git format-patch