about summary refs log tree commit diff
path: root/src/librustdoc/html/templates/source.html
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-03-22 19:04:49 +0000
committerbors <bors@rust-lang.org>2023-03-22 19:04:49 +0000
commita266f11990d9544ee408e213e1eec8cc9eb032b7 (patch)
tree8047ee2a1679b107542e980b2ffb2f1f9daf91b5 /src/librustdoc/html/templates/source.html
parent439292bc7913399e406d9bb7e8da0f70c6317c6e (diff)
parenteda88a30c767d1933aaf82a83d679a245b7d26b8 (diff)
downloadrust-a266f11990d9544ee408e213e1eec8cc9eb032b7.tar.gz
rust-a266f11990d9544ee408e213e1eec8cc9eb032b7.zip
Auto merge of #109496 - Dylan-DPC:rollup-u8rsi3h, r=Dylan-DPC
Rollup of 11 pull requests

Successful merges:

 - #100311 (Fix handling of trailing bare CR in str::lines)
 - #108997 (Change text -> rust highlighting in sanitizer.md)
 - #109179 (move Option::as_slice to intrinsic)
 - #109187 (Render source page layout with Askama)
 - #109280 (Remove `VecMap`)
 - #109295 (refactor `fn bootstrap::builder::Builder::compiler_for` logic)
 - #109312 (rustdoc: Cleanup parent module tracking for doc links)
 - #109317 (Update links for custom discriminants.)
 - #109405 (RPITITs are `DefKind::Opaque` with new lowering strategy)
 - #109414 (Do not consider synthesized RPITITs on missing items checks)
 - #109435 (Detect uninhabited types early in const eval)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/librustdoc/html/templates/source.html')
-rw-r--r--src/librustdoc/html/templates/source.html19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/librustdoc/html/templates/source.html b/src/librustdoc/html/templates/source.html
new file mode 100644
index 00000000000..a224ff12f44
--- /dev/null
+++ b/src/librustdoc/html/templates/source.html
@@ -0,0 +1,19 @@
+<div class="example-wrap"> {# #}
+    <pre class="src-line-numbers">
+        {% for line in lines.clone() %}
+            {% if embedded %}
+                <span>{{line|safe}}</span>
+            {%~ else %}
+                <a href="#{{line|safe}}" id="{{line|safe}}">{{line|safe}}</a>
+            {%~ endif %}
+        {% endfor %}
+    </pre> {# #}
+    <pre class="rust"> {# #}
+        <code>
+            {% if needs_expansion %}
+                <button class="expand">&varr;</button>
+            {% endif %}
+            {{code_html|safe}}
+        </code> {# #}
+    </pre> {# #}
+</div>