Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

NthTensor
Copy link
Contributor

Objective

Adds a simple tool to order and merge release notes and migration guides.

To use, go to tools/export-content and use cargo run.

The output formatting may need to be tweaked, and we will probably want to add/change the zola shortcodes a bit.

@alice-i-cecile alice-i-cecile added this to the 0.17 milestone Aug 11, 2025
@alice-i-cecile alice-i-cecile added A-Meta About the project itself S-Needs-Review Needs reviewer attention (from anyone!) to move forward C-Feature A new feature, making something new possible X-Contentious There are nontrivial implications that should be thought through labels Aug 11, 2025
Copy link
Contributor

@DaAlbrecht DaAlbrecht left a 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) {
Copy link
Contributor

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

Suggested change
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 != "" {
Copy link
Contributor

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

Suggested change
if text != "" {
if !text.is_empty()
&& let Some(index) = mode_state.selected()

mode_state.select_next();
}
KeyCode::Up => {
if key.modifiers.contains(KeyModifiers::SHIFT) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto:

Suggested change
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() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Suggested change
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())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: needless borrow

Suggested change
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,
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Meta About the project itself C-Feature A new feature, making something new possible S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Contentious There are nontrivial implications that should be thought through
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants