1
Fork 0

Fix markdown issue, remove hard-coded rust-lang.org url

This commit is contained in:
Will Crichton 2022-01-27 18:39:10 -08:00
parent ae5d0cbe74
commit 7cca69342a
2 changed files with 5 additions and 3 deletions

View file

@ -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();

View file

@ -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
);