# Code blocks in tutorials aren't wrapped in a \<code\> element

**URL:** https://discourse.cmake.org/t/code-blocks-in-tutorials-arent-wrapped-in-a-code-element/9093
**Category:** Site Feedback
**Created:** [September 26, 2023, 2:14am UTC](https://discourse.cmake.org/t/code-blocks-in-tutorials-arent-wrapped-in-a-code-element/9093 "2023-09-26T02:14:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![heatblayze](https://discourse.cmake.org/user_avatar/discourse.cmake.org/heatblayze/32/3874_2.png) [@heatblayze](https://discourse.cmake.org/u/heatblayze)
#### Post date: [September 26, 2023, 2:14am UTC](https://discourse.cmake.org/t/code-blocks-in-tutorials-arent-wrapped-in-a-code-element/9093/1 "2023-09-26T02:14:32Z")

</div>

This is barely even an issue at all, but I like using Firefox’s “reader view” tool to follow coding tutorials. One thing I’ve noticed is that the code blocks use the pre element, but it doesn’t include a nested code element. The reader view will apply special formatting to these elements to improve readability. From what I can tell the single line code fragments are using the code element, so it’s only the mult-line code blocks that lack the element.

Without code element (left), with code element (right):

 ![image](https://discourse.cmake.org/uploads/default/original/2X/5/511e9e992b2e481db961815d8def49fefe3479af.png)

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [September 26, 2023, 10:46am UTC](https://discourse.cmake.org/t/code-blocks-in-tutorials-arent-wrapped-in-a-code-element/9093/2 "2023-09-26T10:46:26Z")

</div>

The tutorial pages are generated by [Sphinx](https://github.com/sphinx-doc/sphinx) from reStructuredText documents versioned with CMake’s source. The code block in question is [here](https://gitlab.kitware.com/cmake/cmake/-/blob/v3.27.6/Help/guide/tutorial/Adding%20Usage%20Requirements%20for%20a%20Library.rst?plain=1#L69-74) in the source code, and is already marked as code for Sphinx. The HTML that Sphinx generates from that is not under our control, but it looks fine in a normal browser view.

---

<div class="post-metadata">

### Author: ![heatblayze](https://discourse.cmake.org/user_avatar/discourse.cmake.org/heatblayze/32/3874_2.png) [@heatblayze](https://discourse.cmake.org/u/heatblayze)
#### Post date: [September 26, 2023, 11:50am UTC](https://discourse.cmake.org/t/code-blocks-in-tutorials-arent-wrapped-in-a-code-element/9093/3 "2023-09-26T11:50:50Z")

</div>

Ahh okay, no worries. Thanks for the info!
