Skip to content

Commit e6b702b

Browse files
authored
Merge pull request #1315 from camelid/fix-about-code
Fix code blocks in `/about`
2 parents 4ee9d89 + d94d9a6 commit e6b702b

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

templates/core/about/builds.html

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@ <h4 id="detecting-docsrs"> <a href="#detecting-docsrs">Detecting Docs.rs</a> </h
3232
<p>
3333
To recognize Docs.rs from <code>build.rs</code> files, you can test for the environment variable <code>DOCS_RS</code>, e.g.:
3434
{% filter dedent(levels=4) -%}
35-
<pre>
36-
<code>
37-
if let Ok(_) = std::env::var("DOCS_RS") {
38-
// ... your code here ...
39-
}
40-
</code>
41-
</pre>
35+
<pre><code class="lang-rust">
36+
if let Ok(_) = std::env::var("DOCS_RS") {
37+
// ... your code here ...
38+
}
39+
</code></pre>
4240
{%- endfilter %}
4341
This approach can be helpful if you need dependencies for building the library, but not for building the documentation.
4442
</p>
@@ -51,12 +49,10 @@ <h4 id="cross-compiling"> <a href="#cross-compiling">Cross-compiling</a> </h4>
5149
<p>
5250
You can configure how your crate is built by adding <a href="metadata">package metadata</a> to your <code>Cargo.toml</code>, e.g.:
5351
{% filter dedent -%}
54-
<pre>
55-
<code>
56-
[package.metadata.docs.rs]
57-
rustc-args = ["--cfg", "docsrs"]
58-
</code>
59-
</pre>
52+
<pre><code class="lang-toml">
53+
[package.metadata.docs.rs]
54+
rustc-args = ["--cfg", "docsrs"]
55+
</code></pre>
6056
{%- endfilter %}
6157
Here, the compiler arguments are set so that <code>#[cfg(docsrs)]</code> (not to be confused with <code>#[cfg(doc)]</code>) can be used for conditional compilation.
6258
This approach is also useful for setting <a href="https://doc.rust-lang.org/cargo/reference/features.html">cargo features</a>.

templates/core/about/metadata.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h1>Metadata for custom builds</h1>
1414

1515
<p>The available configuration flags you can customize are:</p>
1616

17-
<pre><code>{%- include "core/Cargo.toml.example" -%}</code></pre>
17+
<pre><code class="lang-toml">{%- include "core/Cargo.toml.example" -%}</code></pre>
1818
</div>
1919
</div>
2020
{%- endblock body %}

0 commit comments

Comments
 (0)