aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-11-05 03:09:59 -0400
committerBobby <[email protected]>2022-11-05 03:09:59 -0400
commit3487049d5b7ada8b9e10cb5500e2f5c4249a13d8 (patch)
tree19c37fd599bcb99eb9dbd5cecdf5f1e19f810e76 /scripts
parent101cc6d5b832f6a2c22b08fb37922f3548c7a574 (diff)
downloadtexty-3487049d5b7ada8b9e10cb5500e2f5c4249a13d8.tar.xz
texty-3487049d5b7ada8b9e10cb5500e2f5c4249a13d8.zip
feat: Added maintainers
Diffstat (limited to 'scripts')
-rw-r--r--scripts/maintainers.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/scripts/maintainers.py b/scripts/maintainers.py
new file mode 100644
index 0000000..2ab3b0f
--- /dev/null
+++ b/scripts/maintainers.py
@@ -0,0 +1,51 @@
+# This file is used to generate the list of maintainers from the maintainers.yml
+# file. It is used to make sure that all the maintainers are listed in the
+# README.md file.
+
+import yaml
+
+def main():
+ # Load the maintainers.yml file
+ with open('maintainers.yml', 'r') as f:
+ maintainers = yaml.safe_load(f)
+
+ # Load the README.md file
+ with open('README.md', 'r') as f:
+ readme = f.read()
+
+ # Generate the list of maintainers
+ maintainers_list = ""
+ maintainer_images = ""
+ for maintainer in maintainers:
+ if not maintainer['name'] or not maintainer['github']:
+ # Skip maintainers without a name or github username
+ continue
+
+ # Generate the markdown for the maintainer
+ maintainers_list += "- [{}]({})".format(maintainer['name'], maintainer['github'])
+ if maintainer['email']:
+ maintainers_list += "<{}>".format(maintainer['email'])
+
+ if maintainer['website']:
+ maintainers_list += " - [{}]({})".format(maintainer['website'], maintainer['website'])
+
+ # Move to next line
+ maintainers_list += "\r"
+
+ # Generate the markdown for the maintainer's image
+ image_url = "https://github.com/{}.png?size=40".format(maintainer['github'])
+ maintainer_images += "![{}]({}) ".format(maintainer['name'], image_url)
+
+ # Remove everything below "<!-- maintainers -->" in the README.md file
+ readme = readme.split("<!-- maintainers -->")[0]
+
+ # Add the list of maintainers to the README.md file
+ readme += "<!-- maintainers -->\r" + maintainers_list + "\r" + maintainer_images
+
+ # Save the README.md file
+ with open('README.md', 'w') as f:
+ f.write(readme)
+
+
+if __name__ == '__main__':
+ main()