diff options
| author | Will Crichton <wcrichto@cs.stanford.edu> | 2022-01-27 18:39:10 -0800 |
|---|---|---|
| committer | Will Crichton <wcrichto@cs.stanford.edu> | 2022-03-27 18:11:56 -0700 |
| commit | 7cca69342a3f662041362bc988da851942dadb6c (patch) | |
| tree | 9217b37c749ec16f25b74644c85b0d9fad017eb2 | |
| parent | ae5d0cbe74a07baef9eb92dde82b28feea8961cd (diff) | |
| download | rust-7cca69342a3f662041362bc988da851942dadb6c.tar.gz rust-7cca69342a3f662041362bc988da851942dadb6c.zip | |
Fix markdown issue, remove hard-coded rust-lang.org url
| -rw-r--r-- | src/doc/rustdoc/src/scraped-examples.md | 4 | ||||
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/doc/rustdoc/src/scraped-examples.md b/src/doc/rustdoc/src/scraped-examples.md index bab992ccc50..08f220af2a0 100644 --- a/src/doc/rustdoc/src/scraped-examples.md +++ b/src/doc/rustdoc/src/scraped-examples.md @@ -2,14 +2,14 @@ Rustdoc can automatically scrape examples of items being documented from the `examples/` directory of a Cargo workspace. These examples will be included within the generated documentation for that item. For example, if your library contains a public function: -```rust,ignore(needs-other-file) +```rust,ignore (needs-other-file) // a_crate/src/lib.rs pub fn a_func() {} ``` And you have an example calling this function: -```rust,ignore(needs-other-file) +```rust,ignore (needs-other-file) // a_crate/examples/ex.rs fn main() { a_crate::a_func(); diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index b5536dc930f..c3e2eb81e45 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -62,6 +62,7 @@ use rustc_span::{ use serde::ser::SerializeSeq; use serde::{Serialize, Serializer}; +use crate::clean::utils::DOC_RUST_LANG_ORG_CHANNEL; use crate::clean::{self, ItemId, RenderedLink, SelfTy}; use crate::error::Error; use crate::formats::cache::Cache; @@ -2671,8 +2672,9 @@ fn render_call_locations(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item) { <span></span>\ <h5 id=\"{id}\">\ <a href=\"#{id}\">Examples found in repository</a>\ - <a class=\"scrape-help\" href=\"https://doc.rust-lang.org/rustdoc/scraped-examples.html\" target=\"_blank\">?</a>\ + <a class=\"scrape-help\" href=\"{doc_prefix}/rustdoc/scraped-examples.html\" target=\"_blank\">?</a>\ </h5>", + doc_prefix = DOC_RUST_LANG_ORG_CHANNEL, id = id ); |
