Skip to content

[DOCS-GEN] Add scripts for making release documentation - #9

Open
cbialorucki wants to merge 2 commits into
reactos:masterfrom
cbialorucki:add-doc-gen
Open

[DOCS-GEN] Add scripts for making release documentation#9
cbialorucki wants to merge 2 commits into
reactos:masterfrom
cbialorucki:add-doc-gen

Conversation

@cbialorucki

Copy link
Copy Markdown
Contributor

Add some scripts for generating wiki documents for new releases

@cbialorucki
cbialorucki marked this pull request as ready for review August 26, 2026 20:31
def __init__(self, sha, author, message):
self.sha = sha
# Normalize and strip author, message
self.author = unicodedata.normalize("NFKD", author.strip()).encode("ascii", "ignore").decode("ascii")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't you use utf8 for some of our authors?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I did try making it utf-8 at first, but pasting that into our wiki broke on all the extended characters.

raw_commits = run(f'git log {parent}..{branch} --pretty=format:"%h|%an|%s" --reverse').split("\n")
current_version = branch.split("releases/", 1)[1]
# Add current version as a skipped prefix
skip_prefixes.append(current_version)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this work?
You might need global skip_prefixes somewhere in main

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It does work. See this page for example, which was made using this script: https://reactos.org/wiki/0.4.16_Commit_History#BOOTDATA

MAX_MSG_LENGTH = 100
skip_prefixes = []

class Commit:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You might wanna look into dataclasses (https://docs.python.org/3/library/dataclasses.html), that has some nice things like automatic pretty-printing etc.

print(f"=== {subgroup} ===")

for commit in groups[group][subgroup]:
print(f"* [https://git.reactos.org/?p=reactos.git;a=commit;h={commit.sha} <nowiki>{truncate_msg(commit.message)}</nowiki>] ({commit.author})")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Might make sense to link to github instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I prefer Github too, but I figured someone browsing our wiki is more likely to want to use our git mirror. Maybe I am wrong 😄

MAX_SUMMARY_LENGTH = 100

def normalize_summary(s):
s = unicodedata.normalize("NFKD", s).encode("ascii", "ignore").decode("ascii")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

utf8 is probably better fitting here as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants