Skip to content

Commit fd5be91

Browse files
committed
Integrate inline macro support with the main AsciiDoc-to-Markdown conversion process
1 parent a77336b commit fd5be91

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

xtask/src/publish/notes.rs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ impl<'a, 'b, R: BufRead> Converter<'a, 'b, R> {
7474
fn process_document_title(&mut self) -> anyhow::Result<()> {
7575
if let Some(Ok(line)) = self.iter.next() {
7676
if let Some((level, title)) = get_title(&line) {
77+
let title = process_inline_macros(title)?;
7778
if level == 1 {
78-
self.write_title(level, title);
79+
self.write_title(level, &title);
7980
return Ok(());
8081
}
8182
}
@@ -90,6 +91,7 @@ impl<'a, 'b, R: BufRead> Converter<'a, 'b, R> {
9091

9192
if get_list_item(&line).is_some() {
9293
let line = self.iter.next().unwrap()?;
94+
let line = process_inline_macros(&line)?;
9395
let (marker, item) = get_list_item(&line).unwrap();
9496
nesting.set_current(marker);
9597
self.write_list_item(item, &nesting);
@@ -258,6 +260,7 @@ impl<'a, 'b, R: BufRead> Converter<'a, 'b, R> {
258260
self.write_indent(level);
259261
let line = self.iter.next().unwrap()?;
260262
let line = line.trim_start();
263+
let line = process_inline_macros(&line)?;
261264
if line.ends_with('+') {
262265
let line = &line[..(line.len() - 1)];
263266
self.output.push_str(line);
@@ -585,7 +588,7 @@ Release: release:2022-01-01[]
585588
586589
== New Features
587590
588-
* pr:1111[] foo bar baz
591+
* **BREAKING** pr:1111[] shortcut kbd:[ctrl+r]
589592
- hyphen-prefixed list item
590593
* nested list item
591594
** `foo` -> `foofoo`
@@ -645,9 +648,11 @@ paragraph
645648
== Another Section
646649
647650
* foo bar baz
648-
* foo bar baz
651+
* list item with an inline image
652+
image:https://example.com/animation.gif[]
649653
650654
The highlight of the month is probably pr:1111[].
655+
See https://example.com/manual[online manual] for more information.
651656
652657
[source,bash]
653658
----
@@ -668,12 +673,12 @@ This is a plain listing.
668673
669674
Hello!
670675
671-
Commit: commit:0123456789abcdef0123456789abcdef01234567[] \\
672-
Release: release:2022-01-01[]
676+
Commit: [`0123456`](https://github.com/rust-analyzer/rust-analyzer/commit/0123456789abcdef0123456789abcdef01234567) \\
677+
Release: [`2022-01-01`](https://github.com/rust-analyzer/rust-analyzer/releases/2022-01-01)
673678
674679
## New Features
675680
676-
- pr:1111[] foo bar baz
681+
- **BREAKING** [`#1111`](https://github.com/rust-analyzer/rust-analyzer/pull/1111) shortcut <kbd>ctrl</kbd>+<kbd>r</kbd>
677682
- hyphen-prefixed list item
678683
- nested list item
679684
- `foo` -> `foofoo`
@@ -728,9 +733,11 @@ Release: release:2022-01-01[]
728733
## Another Section
729734
730735
- foo bar baz
731-
- foo bar baz
736+
- list item with an inline image
737+
![](https://example.com/animation.gif)
732738
733-
The highlight of the month is probably pr:1111[].
739+
The highlight of the month is probably [`#1111`](https://github.com/rust-analyzer/rust-analyzer/pull/1111).
740+
See [online manual](https://example.com/manual) for more information.
734741
735742
```bash
736743
rustup update nightly

0 commit comments

Comments
 (0)