Skip to content

Commit a13b2c0

Browse files
Merge pull request #103 from joshtriplett/no-footnotes
Use direct links, not footnote links
2 parents 6a6c32d + d117b18 commit a13b2c0

File tree

2 files changed

+9
-44
lines changed

2 files changed

+9
-44
lines changed

src/main.rs

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const SKIP_LABELS: &[&str] = &[
2121
#[derive(Clone, Template)]
2222
#[template(path = "relnotes.md", escape = "none")]
2323
struct ReleaseNotes {
24-
cargo_links: String,
2524
cargo_relnotes: String,
2625
cargo_unsorted: String,
2726
compat_relnotes: String,
@@ -33,7 +32,6 @@ struct ReleaseNotes {
3332
language_unsorted: String,
3433
libraries_relnotes: String,
3534
libraries_unsorted: String,
36-
links: String,
3735
unsorted: String,
3836
unsorted_relnotes: String,
3937
version: String,
@@ -71,7 +69,6 @@ fn main() {
7169

7270
let relnotes_tags = &["relnotes", "finished-final-comment-period", "needs-fcp"];
7371

74-
let links = map_to_link_items("", in_release.clone());
7572
let (relnotes, rest) = partition_by_tag(in_release, relnotes_tags);
7673

7774
let (
@@ -91,14 +88,9 @@ fn main() {
9188
let (cargo_relnotes, cargo_unsorted) = {
9289
let (relnotes, rest) = partition_by_tag(cargo_issues.iter(), relnotes_tags);
9390

94-
(
95-
map_to_line_items("cargo/", relnotes),
96-
map_to_line_items("cargo/", rest),
97-
)
91+
(map_to_line_items(relnotes), map_to_line_items(rest))
9892
};
9993

100-
let cargo_links = map_to_link_items("cargo/", cargo_issues.iter());
101-
10294
let relnotes = ReleaseNotes {
10395
version,
10496
date: (end + six_weeks).naive_utc(),
@@ -114,8 +106,6 @@ fn main() {
114106
cargo_unsorted,
115107
unsorted_relnotes,
116108
unsorted,
117-
links,
118-
cargo_links,
119109
};
120110

121111
println!("{}", relnotes.render().unwrap());
@@ -217,34 +207,13 @@ fn request_header() -> HeaderMap {
217207
headers
218208
}
219209

220-
fn map_to_line_items<'a>(
221-
prefix: &'static str,
222-
iter: impl IntoIterator<Item = &'a json::Value>,
223-
) -> String {
210+
fn map_to_line_items<'a>(iter: impl IntoIterator<Item = &'a json::Value>) -> String {
224211
iter.into_iter()
225212
.map(|o| {
226213
format!(
227-
"- [{title}][{prefix}{number}]",
228-
prefix = prefix,
214+
"- [{title}]({url}/)",
229215
title = o["title"].as_str().unwrap(),
230-
number = o["number"],
231-
)
232-
})
233-
.collect::<Vec<_>>()
234-
.join("\n")
235-
}
236-
237-
fn map_to_link_items<'a>(
238-
prefix: &'static str,
239-
iter: impl IntoIterator<Item = &'a json::Value>,
240-
) -> String {
241-
iter.into_iter()
242-
.map(|o| {
243-
format!(
244-
"[{prefix}{number}]: {url}/",
245-
prefix = prefix,
246-
number = o["number"],
247-
url = o["url"].as_str().unwrap()
216+
url = o["url"].as_str().unwrap(),
248217
)
249218
})
250219
.collect::<Vec<_>>()
@@ -273,10 +242,10 @@ fn partition_prs<'a>(
273242
let (compiler, rest) = partition_by_tag(rest, &["T-compiler"]);
274243

275244
(
276-
map_to_line_items("", compat_notes),
277-
map_to_line_items("", libs),
278-
map_to_line_items("", lang),
279-
map_to_line_items("", compiler),
280-
map_to_line_items("", rest),
245+
map_to_line_items(compat_notes),
246+
map_to_line_items(libs),
247+
map_to_line_items(lang),
248+
map_to_line_items(compiler),
249+
map_to_line_items(rest),
281250
)
282251
}

templates/relnotes.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,3 @@ UNSORTED
6262
**other**
6363
{{unsorted}}
6464

65-
{{links}}
66-
{{cargo_links}}
67-
68-

0 commit comments

Comments
 (0)