summary refs log tree commit diff
path: root/src/librustdoc/html/render/context.rs
diff options
context:
space:
mode:
authorWill Crichton <wcrichto@cs.stanford.edu>2021-05-09 16:22:22 -0700
committerWill Crichton <wcrichto@cs.stanford.edu>2021-10-06 19:44:47 -0700
commit4b3f82ad0321b8f2e2630b74bbc526ffb8fa5bda (patch)
tree4d10d3906b55b93f95d813d1e859ef92592712a6 /src/librustdoc/html/render/context.rs
parent0eabf25b90396dead0b2a1aaa275af18a1ae6008 (diff)
downloadrust-4b3f82ad0321b8f2e2630b74bbc526ffb8fa5bda.tar.gz
rust-4b3f82ad0321b8f2e2630b74bbc526ffb8fa5bda.zip
Add updated support for example-analyzer
Move rendering of examples into

Finalize design

Cleanup, rename found -> scraped

Softer yellow

Clean up dead code

Document scrape_examples

More simplification and documentation

Remove extra css

Test
Diffstat (limited to 'src/librustdoc/html/render/context.rs')
-rw-r--r--src/librustdoc/html/render/context.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs
index b99d2fe5aa0..49bf760c29c 100644
--- a/src/librustdoc/html/render/context.rs
+++ b/src/librustdoc/html/render/context.rs
@@ -124,6 +124,7 @@ crate struct SharedContext<'tcx> {
     crate span_correspondance_map: FxHashMap<rustc_span::Span, LinkFromSrc>,
     /// The [`Cache`] used during rendering.
     crate cache: Cache,
+    pub(super) repository_url: Option<String>,
 }
 
 impl SharedContext<'_> {
@@ -140,7 +141,11 @@ impl SharedContext<'_> {
     /// Returns the `collapsed_doc_value` of the given item if this is the main crate, otherwise
     /// returns the `doc_value`.
     crate fn maybe_collapsed_doc_value<'a>(&self, item: &'a clean::Item) -> Option<String> {
-        if self.collapsed { item.collapsed_doc_value() } else { item.doc_value() }
+        if self.collapsed {
+            item.collapsed_doc_value()
+        } else {
+            item.doc_value()
+        }
     }
 
     crate fn edition(&self) -> Edition {
@@ -389,6 +394,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
             generate_redirect_map,
             show_type_layout,
             generate_link_to_definition,
+            repository_url,
             ..
         } = options;
 
@@ -480,6 +486,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
             templates,
             span_correspondance_map: matches,
             cache,
+            repository_url,
         };
 
         // Add the default themes to the `Vec` of stylepaths