-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Release content export tool #20500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Release content export tool #20500
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some small nits (didnt check in zola). A bit sad that strings cant start with a backtick
Mode::MigrationGuides => self.mode = Mode::ReleaseNotes, | ||
}, | ||
KeyCode::Down => { | ||
if key.modifiers.contains(KeyModifiers::SHIFT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: these could all be collapsed
if key.modifiers.contains(KeyModifiers::SHIFT) { | |
if key.modifiers.contains(KeyModifiers::SHIFT) | |
&& let Some(index) = mode_state.selected() | |
&& index < mode_entries.len() - 1 | |
{ |
text.pop(); | ||
} | ||
KeyCode::Enter => { | ||
if text != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: use is_empty and collapse
if text != "" { | |
if !text.is_empty() | |
&& let Some(index) = mode_state.selected() | |
mode_state.select_next(); | ||
} | ||
KeyCode::Up => { | ||
if key.modifiers.contains(KeyModifiers::SHIFT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto:
if key.modifiers.contains(KeyModifiers::SHIFT) { | |
if key.modifiers.contains(KeyModifiers::SHIFT) | |
&& let Some(index) = mode_state.selected() | |
&& index > 0 | |
{ | |
self.text_entry = Some(String::new()); | ||
} | ||
KeyCode::Char('d') => { | ||
if let Some(index) = mode_state.selected() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
if let Some(index) = mode_state.selected() { | |
if let Some(index) = mode_state.selected() | |
&& let Entry::Section { .. } = mode_entries[index] | |
{ |
continue; | ||
} | ||
|
||
let file_content = fs::read_to_string(&dir_entry.path()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: needless borrow
let file_content = fs::read_to_string(&dir_entry.path()) | |
let file_content = fs::read_to_string(dir_entry.path()) |
#[source_code] | ||
src: String, | ||
kind: &'static str, | ||
file_name: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For quick fixing it could also be useful to add the path to the file.
Objective
Adds a simple tool to order and merge release notes and migration guides.
To use, go to
tools/export-content
and usecargo run
.The output formatting may need to be tweaked, and we will probably want to add/change the zola shortcodes a bit.