[DOCS-GEN] Add scripts for making release documentation - #9
Conversation
6b885a8 to
0f217e6
Compare
0f217e6 to
567d95e
Compare
| 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") |
There was a problem hiding this comment.
Shouldn't you use utf8 for some of our authors?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Does this work?
You might need global skip_prefixes somewhere in main
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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})") |
There was a problem hiding this comment.
Might make sense to link to github instead?
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
utf8 is probably better fitting here as well
Add some scripts for generating wiki documents for new releases