Skip to content

Commit 6000a62

Browse files
dbkindernashif
authored andcommitted
doc: prepare for improving doc API linking
Linking to API material requires knowing the pecularities of how doxygen, sphinx, and breathe work. In an attempt to hide some of this we're preparing the current docs to allow use of configuration defaults that will let us more simply use a default role that will hunt for a reference target in the various domains that are available by using a default "role" of "all". This will let us use the simple notation `functionname` or `typename` without fully specifying the reference as :c:func:`functionname`. This patch cleans up exising docs that were (incorrectly) using single backtics where double backtics should have been used, and also found some typos (such as a space between the role name and the reference, such as :file: `filename`, and a missing colon such as c:func:`functionname`) This is a start to address issue #14313 Signed-off-by: David B. Kinder <[email protected]>
1 parent a514898 commit 6000a62

File tree

30 files changed

+72
-57
lines changed

30 files changed

+72
-57
lines changed

boards/arm/mec2016evb_assy6797/doc/index.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ features:
6262
Other hardware features are not currently supported by Zephyr (at the moment)
6363

6464
The default configuration can be found in the Kconfig file:
65-
66-
``boards/arm/mec2016evb_assy6797/mec2016evb_assy6797_defconfig``
65+
``boards/arm/mec2016evb_assy6797/mec2016evb_assy6797_defconfig``
6766

6867

6968
Connections and IOs
@@ -178,7 +177,7 @@ Flashing
178177
- Stop bits: 1
179178

180179
#. Connect the MEC2016EVB_ASSY_6797 board to your host computer using the
181-
UART0 port. Then build :ref: `hello_world` application. It is important
180+
UART0 port. Then build :ref:`hello_world` application. It is important
182181
to generate a binary with a new load address, for example do the following::
183182

184183
${OBJCOPY} --change-addresses -0xb0000 -O binary -S ${in_elf} ${out_bin}

boards/arm/nrf52832_mdk/doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The kit gives access to 24 I/Os and interfaces via headers and has a
1414
RGB LED which is user-programmable. It also has a 2.4GHz chip antenna
1515
onboard which is quite convenient to develop IoT wireless applications.
1616

17-
See `nRF52832-mdk website_` for more information about the development
17+
See `nRF52832-mdk website`_ for more information about the development
1818
board and `nRF52832 website`_ for the official reference on the IC itself.
1919

2020
References

boards/arm/nrf52840_mdk/doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ports: one for DAPLink interface and one for nRF52840 USB device controller.
1919
The kit also features ultra-low power 64-Mb QSPI FLASH memory, programmable
2020
user button, RGB LED, up to 24 GPIOs, antenna selection for custom applications.
2121

22-
See `nRF52840-mdk website_` for more information about the development
22+
See `nRF52840-mdk website`_ for more information about the development
2323
board and `nRF52840 website`_ for the official reference on the IC itself.
2424

2525
References

boards/arm/nrf52840_pca10059/doc/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ It is possible to use the nRF5 bootloader alongside MCUBoot. To do so,
148148
program the board with MCUBoot as a Zephyr application, following
149149
the steps above. Then, prepare to compile an application with MCUBoot support.
150150

151-
Select :option: `CONFIG_BOOTLOADER_MCUBOOT`, under "Boot options" and set
152-
:option: `CONFIG_TEXT_SECTION_OFFSET` under "Build and Link features",
151+
Select :option:`CONFIG_BOOTLOADER_MCUBOOT`, under "Boot options" and set
152+
:option:`CONFIG_TEXT_SECTION_OFFSET` under "Build and Link features",
153153
"Linker options" to 0x200 to ensure the code is offset to account for MCUboot
154154
firmware image metadata.
155155

boards/arm/nrf52840_pca10090/doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ First, run your favorite terminal program to listen for output.
100100
$ minicom -D <tty_device> -b 115200
101101
102102
Replace :code:`<tty_device>` with the port where the nRF52840 SoC is connected
103-
to. Usually, under Linux it will be :code:`/dev/ttyACM1`. The `/dev/ttyACM0`
103+
to. Usually, under Linux it will be ``/dev/ttyACM1``. The ``/dev/ttyACM0``
104104
port is connected to the nRF9160 SiP on the board.
105105

106106
Then build and flash the application in the usual way.

boards/x86/up_squared/doc/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,13 @@ Prepare Linux host
326326
#. Follow `Creating a GRUB2 Boot Loader Image from a Linux Host`_ steps
327327
to create grub binary.
328328

329-
#. Install DHCP, TFTP servers. For example `dnsmasq`
329+
#. Install DHCP, TFTP servers. For example ``dnsmasq``
330330

331331
.. code-block:: console
332332
333333
$ sudo apt-get install dnsmasq
334334
335-
#. Configure DHCP server. Configuration for `dnsmasq` is below:
335+
#. Configure DHCP server. Configuration for ``dnsmasq`` is below:
336336

337337
.. code-block:: console
338338
@@ -349,7 +349,7 @@ Prepare Linux host
349349
tftp-root=/srv/tftp
350350
dhcp-boot=grub_x86_64.efi
351351
352-
`grub_x86_64.efi` is a grub binary created above.
352+
``grub_x86_64.efi`` is a grub binary created above.
353353

354354
#. Create the following directories inside TFTP root :file:`/srv/tftp`
355355

@@ -391,7 +391,7 @@ Prepare Linux host
391391
└── kernel
392392
└── zephyr.strip
393393
394-
#. Restart `dnsmasq` service:
394+
#. Restart ``dnsmasq`` service:
395395

396396
.. code-block:: console
397397

boards/xtensa/esp32/doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Using JTAG
149149

150150
As with much custom hardware, the ESP-32 modules require patches to
151151
OpenOCD that are not upstream. Espressif maintains their own fork of
152-
the project here. By convention they put it in the `~/esp` next to the
152+
the project here. By convention they put it in ``~/esp`` next to the
153153
installations of their toolchain and SDK:
154154

155155
.. code-block:: console

doc/application/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,8 @@ into a single application image that can be run on simulated hardware or real
302302
hardware.
303303

304304
As described in :ref:`getting_started_cmake`, on Linux and macOS you can choose
305-
between the `make` and `ninja` generators, whereas on Windows you need to use
306-
`ninja`. For simplicity we will use `ninja` throughout this guide.
305+
between the ``make`` and ``ninja`` generators, whereas on Windows you need to use
306+
``ninja``. For simplicity we will use ``ninja`` throughout this guide.
307307

308308
Basics
309309
======

doc/conf.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,15 @@
143143

144144
# The reST default role (used for this markup: `text`) to use for all
145145
# documents.
146-
#default_role = None
146+
147+
# This change will allow us to use bare back-tick notation to let
148+
# Sphinx hunt for a reference, starting with normal "document"
149+
# references such as :ref:, but also including :c: and :cpp: domains
150+
# (potentially) helping with API (doxygen) references simply by using
151+
# `name`
152+
153+
default_role = 'any'
154+
# default_domain = 'cpp'
147155

148156
# If true, '()' will be appended to :func: etc. cross-reference text.
149157
#add_function_parentheses = True
@@ -390,6 +398,13 @@
390398
}
391399
breathe_default_project = "Zephyr"
392400

401+
# Changing breathe configuration to force "c" domain doesn't work
402+
# see https://github.com/michaeljones/breathe/issues/282
403+
#breathe_domain_by_extension = {
404+
# "h" : "c",
405+
# "c" : "c",
406+
# }
407+
393408
# Qualifiers to a function are causing Sphihx/Breathe to warn about
394409
# Error when parsing function declaration and more. This is a list
395410
# of strings that the parser additionally should accept as

doc/contribute/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,10 @@ gitlint
265265

266266
When you submit a pull request to the project, a series of checks are
267267
performed to verify your commit messages meet the requirements. The same step
268-
done during the CI process can be performed locally using the the `gitlint`
268+
done during the CI process can be performed locally using the the ``gitlint``
269269
command.
270270

271-
Run `gitlint` locally in your tree and branch where your patches have been
271+
Run ``gitlint`` locally in your tree and branch where your patches have been
272272
committed:
273273

274274
.. code-block:: console

doc/development_process/release_process.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,11 @@ Every time a release candidate (or the final release) needs to be tagged, the
249249
following steps need to be followed:
250250

251251
#. Update the :zephyr_file:`VERSION` file in the root of the Git repository. If it's a
252-
release candidate, use `EXTRAVERSION` variable::
252+
release candidate, use ``EXTRAVERSION`` variable::
253253

254254
EXTRAVERSION = rc1
255255

256-
#. Commit the update to the :zephyr_file:`VERSION` file, use `release:` as a commit
256+
#. Commit the update to the :zephyr_file:`VERSION` file, use ``release:`` as a commit
257257
tag.
258258
#. Check that CI has completed successfully before tagging.
259259
#. Tag and push the version, using annotated tags:
@@ -280,18 +280,18 @@ release candidate, use `EXTRAVERSION` variable::
280280
$ git shortlog v1.10.0..v.1.11.0-rc1
281281

282282
#. Find the new tag at the top of the releases page, edit the release with the
283-
`Edit` button and then do the following:
283+
``Edit`` button and then do the following:
284284

285285
* If it's a release candidate:
286286

287-
* Name it `Zephyr 1.11.0-rc1`
287+
* Name it ``Zephyr 1.11.0-rc1``
288288
* Copy the shortlog into the release notes textbox (don't forget to quote it
289289
properly so it shows as unformatted text in Markdown)
290290
* Check the "This is a pre-release" checkbox
291291
* If it's a release:
292292

293-
* Name it `Zephyr 1.11.0`
294-
* Copy the full content of `docs/release-notes-1.11.rst` into the the
293+
* Name it ``Zephyr 1.11.0``
294+
* Copy the full content of ``docs/release-notes-1.11.rst`` into the the
295295
release notes textbox
296296
* Copy the full list of GitHub issues closed with this release into the
297297
release notes textbox (see below on how to generate this list)

doc/getting_started/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ shell or ``cmd.exe`` prompt:
5151
5252
.. note::
5353
See :ref:`gs_python_deps` for additional clarfication on using the
54-
`--user` switch.
54+
``--user`` switch.
5555

5656
Additional information about west's structure can be found
5757
:ref:`in the relevant west documentation section <west-struct>`.

doc/guides/dts/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ extracted information should be formatted.
375375

376376
A YAML description (called "YAML binding") must be provided for every device node
377377
that is a source of information for the system. A YAML binding file
378-
is associated to each node `compatible` property. Information within the YAML
378+
is associated to each node ``compatible`` property. Information within the YAML
379379
file will instruct the python DTS parsing script (located in ``scripts/dts``) how
380380
each property of the node is expected to be generated, either the type of the
381381
value or the format of its name. Node properties are generated as C-style

doc/guides/porting/arch.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ mode if the thread triggered a fatal exception, but not if the thread
300300
gracefully exits its entry point function.
301301

302302
This means implementing an architecture-specific version of
303-
:c:func:`k_thread_abort`, and setting the Kconfig option
303+
:cpp:func:`k_thread_abort`, and setting the Kconfig option
304304
:option:`CONFIG_ARCH_HAS_THREAD_ABORT` as needed for the architecture (e.g. see
305305
:zephyr_file:`arch/arm//core/cortex_m/Kconfig`).
306306

doc/guides/test/ztest.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ the **bar** component of **foo**, you should copy the sample folder to
2323

2424

2525
In the example above ``tests/foo/bar`` signifies the path to the test and the
26-
``test-identifier`` references a test defined in the file::`testcase.yaml` file.
26+
``test-identifier`` references a test defined in the :file:`testcase.yaml` file.
2727

2828
To run all tests defined in a test project, run::
2929

doc/reference/kernel/usermode/mpu_stack_objects.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Thread Stack Creation
77
*********************
88

99
Thread stacks are declared statically with :c:macro:`K_THREAD_STACK_DEFINE()`
10-
or embedded within structures using c:macro:`K_THREAD_STACK_MEMBER()`
10+
or embedded within structures using :c:macro:`K_THREAD_STACK_MEMBER()`
1111

1212
For architectures which utilize memory protection unit (MPU) hardware,
1313
stacks are physically contiguous allocations. This contiguous allocation

doc/reference/networking/mqtt.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ used. An example configuration for TCP transport is shown below:
9292
9393
After the configuration is set up, the MQTT client can connect to the MQTT broker.
9494
Call the ``mqtt_connect`` function, which will create the appropriate socket,
95-
establish a TCP/TLS connection, and send an `MQTT CONNECT` message.
95+
establish a TCP/TLS connection, and send an ``MQTT CONNECT`` message.
9696
When notified, the application should call the ``mqtt_input`` function to process
9797
the response received. Note, that ``mqtt_input`` is a non-blocking function,
9898
therefore the application should use socket ``poll`` to wait for the response.

doc/reference/networking/net_mgmt.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The Network Management API implementation is designed to save memory
2121
by eliminating code at build time for management routines that are not
2222
used. Distinct and statically defined APIs for network management
2323
procedures are not used. Instead, defined procedure handlers are
24-
registered by using a `NET_MGMT_REGISTER_REQUEST_HANDLER`
24+
registered by using a :c:macro:`NET_MGMT_REGISTER_REQUEST_HANDLER`
2525
macro. Procedure requests are done through a single :cpp:func:`net_mgmt()` API
2626
that invokes the registered handler for the corresponding request.
2727

doc/reference/shell/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ Usage
367367
*****
368368

369369
To create a new shell instance user needs to activate requested
370-
backend using `menuconfig`.
370+
backend using ``menuconfig``.
371371

372372
The following code shows a simple use case of this library:
373373

doc/reference/storage/disk/sdhc.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ MMC and SDSC (<= 2 GiB) cards are not supported and will be ignored.
2424
Enabling
2525
********
2626

27-
For example, this device tree fragment adds an SDHC card slot on `spi1`,
28-
uses `PA27` for chip select, and runs the SPI bus at 24 MHz once the
27+
For example, this device tree fragment adds an SDHC card slot on ``spi1``,
28+
uses ``PA27`` for chip select, and runs the SPI bus at 24 MHz once the
2929
SDHC card has been initialized:
3030

3131
.. code-block:: none

doc/releases/release-notes-1.10.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Drivers and Sensors
8686
*******************
8787

8888
* timer: Add Support for TICKLESS KERNEL in xtensa_sys_timer
89-
* Rename `random` to `entropy`
89+
* Rename ``random`` to ``entropy``
9090
* Add Atmel SAM I2S (SSC) driver
9191
* Add Atmel SAM DMA (XDMAC) driver
9292
* Add plantower PMS7003 Driver

doc/releases/release-notes-1.12.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,12 +635,12 @@ These GitHub issues were closed since the previous 1.11.0 tagged release:
635635
* :github:`7380` - dma_stm32f4x possible access out of bounds in start/stop handlers
636636
* :github:`7388` - nxp_mpu: suspicious ENDADDR_ROUND() macro
637637
* :github:`7389` - t1_adc108s102 buffer overflow due to chan->buf_idx growth
638-
* :github:`7412` - Mismatch between 'uint32_t' (and `off_t`) definitions in minimal libc and newlib
638+
* :github:`7412` - Mismatch between 'uint32_t' (and 'off_t') definitions in minimal libc and newlib
639639
* :github:`7434` - bluetooth: host: sample applications can't set BT address w/o using an FS
640640
* :github:`7437` - Zephyr's mailing list archives were hard to find
641641
* :github:`7442` - menuconfig should perform fuzzy string matching for symbols
642642
* :github:`7447` - net tests: valgrind detected issues
643-
* :github:`7452` - nRF52, NXP kinetis, ARM Beetle and STM `MPU` option appear for every MPU-equipped device
643+
* :github:`7452` - nRF52, NXP kinetis, ARM Beetle and STM MPU option appear for every MPU-equipped device
644644
* :github:`7453` - Bluetooth mesh message context API needs to expose DST address of RX messages
645645
* :github:`7459` - net: Multiple inconsistent settings to configure TIME_WAIT delay in the IP stack
646646
* :github:`7460` - Unable to view PR #6391
@@ -752,7 +752,7 @@ These GitHub issues were closed since the previous 1.11.0 tagged release:
752752
* :github:`7979` - drivers: dma: dma_cavs: DMA driver does not support per-channel callbacks
753753
* :github:`7989` - eth: ping: can't ping others from zephyr console
754754
* :github:`8005` - FRDM-K64F boot hang w/ mcuboot + lwm2m client
755-
* :github:`8009` - POSIX `clock_gettime()` is discontinuous
755+
* :github:`8009` - POSIX clock_gettime() is discontinuous
756756
* :github:`8015` - Driver:spi_flash_w25qxxdv.c init mistake and can not be erased
757757
* :github:`8032` - _SysFatalErrorHandler not working properly for arc on quark_se_c1000_ss_devboard
758758
* :github:`8033` - tests/crypto/mbedtls/ results in exception on frdm_k64f

doc/releases/release-notes-1.13.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ release:
523523
* :github:`8415` - [Coverity CID :186581] Memory - corruptions in /subsys/bluetooth/host/gatt.c
524524
* :github:`8414` - [Coverity CID :186582] Memory - corruptions in /subsys/bluetooth/host/gatt.c
525525
* :github:`8413` - [Coverity CID :186583] Error handling issues in /samples/net/sockets/dumb_http_server/src/socket_dumb_http.c
526-
* :github:`8393` - `CONFIG_MULTITHREADING=n` builds call `main()` with interrupts locked
526+
* :github:`8393` - ``CONFIG_MULTITHREADING=n`` builds call main() with interrupts locked
527527
* :github:`8391` - nrf52_blenano2 tmp112 sensor sample build failed.
528528
* :github:`8390` - bluetooth: request APIs to notify application that pairing is complete or not
529529
* :github:`8388` - Assigning to promptless symbols should have a better error message
@@ -535,7 +535,7 @@ release:
535535
* :github:`8367` - fs: nvs: auto restore FS on writing while power down error.
536536
* :github:`8366` - mcumgr: unable to perform 2nd update
537537
* :github:`8365` - mcumgr: improper response to "image list" command after update.
538-
* :github:`8361` - __ASSERT() triggers with `CONFIG_MULTITHREADING=n`
538+
* :github:`8361` - __ASSERT() triggers with ``CONFIG_MULTITHREADING=n``
539539
* :github:`8358` - Flashing Target Device FAIL
540540
* :github:`8357` - bluetooth: request the capability to change gap device name programmatically
541541
* :github:`8356` - Failed test: kernel.common.bitfield (tests/kernel/common) on Altera Max10

samples/boards/96b_argonkey/sensors/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The user may select or unselect the sensors from
2323
:zephyr_file:`samples/boards/96b_argonkey/sensors/prj.conf`.
2424

2525
Please note that all sensor related code is conditionally compiled
26-
using the `#ifdef` directive, so this sample is supposed to always
26+
using the ``#ifdef`` directive, so this sample is supposed to always
2727
build correctly. Example:
2828

2929
.. code-block:: c

samples/gui/lvgl/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ or a simulated display environment in a native Posix application:
2323
or
2424

2525
- :ref:`mimxrt1050_evk`
26-
- `RK043FN02H-CT`
26+
- `RK043FN02H-CT`_
2727

2828
or
2929

3030
- :ref:`mimxrt1060_evk`
31-
- `RK043FN02H-CT`
31+
- `RK043FN02H-CT`_
3232

3333
Wiring
3434
******

samples/net/sockets/big_http_download/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Overview
88

99
The sockets/big_http_download sample application for Zephyr implements
1010
a simple HTTP GET client using a BSD Sockets compatible API. Unlike
11-
the `sockets-http-get` sample application, it downloads a file of
11+
the :ref:`sockets-http-get` sample application, it downloads a file of
1212
several megabytes in size, and verifies its integrity using hashing. It
1313
also performs download repeatedly, tracking the total number of bytes
1414
transferred. Thus, it can serve as a "load testing" application for

samples/subsys/mgmt/mcumgr/smp_svr/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This sample application supports the following mcumgr transports by default:
2525
Caveats
2626
*******
2727

28-
* The Zephyr port of `smp_svr` is configured to run on a Nordic nRF52x MCU. The
28+
* The Zephyr port of ``smp_svr`` is configured to run on a Nordic nRF52x MCU. The
2929
application should build and run for other platforms without modification, but
3030
the file system management commands will not work. To enable file system
3131
management for a different platform, adjust the

0 commit comments

Comments
 (0)