Skip to content

Commit 7cca693

Browse files
committed
Fix markdown issue, remove hard-coded rust-lang.org url
1 parent ae5d0cb commit 7cca693

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/doc/rustdoc/src/scraped-examples.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
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:
44

5-
```rust,ignore(needs-other-file)
5+
```rust,ignore (needs-other-file)
66
// a_crate/src/lib.rs
77
pub fn a_func() {}
88
```
99

1010
And you have an example calling this function:
1111

12-
```rust,ignore(needs-other-file)
12+
```rust,ignore (needs-other-file)
1313
// a_crate/examples/ex.rs
1414
fn main() {
1515
a_crate::a_func();

src/librustdoc/html/render/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ use rustc_span::{
6262
use serde::ser::SerializeSeq;
6363
use serde::{Serialize, Serializer};
6464

65+
use crate::clean::utils::DOC_RUST_LANG_ORG_CHANNEL;
6566
use crate::clean::{self, ItemId, RenderedLink, SelfTy};
6667
use crate::error::Error;
6768
use crate::formats::cache::Cache;
@@ -2671,8 +2672,9 @@ fn render_call_locations(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item) {
26712672
<span></span>\
26722673
<h5 id=\"{id}\">\
26732674
<a href=\"#{id}\">Examples found in repository</a>\
2674-
<a class=\"scrape-help\" href=\"https://doc.rust-lang.org/rustdoc/scraped-examples.html\" target=\"_blank\">?</a>\
2675+
<a class=\"scrape-help\" href=\"{doc_prefix}/rustdoc/scraped-examples.html\" target=\"_blank\">?</a>\
26752676
</h5>",
2677+
doc_prefix = DOC_RUST_LANG_ORG_CHANNEL,
26762678
id = id
26772679
);
26782680

0 commit comments

Comments
 (0)