From 47d2e8cf19ce9d968e415346f47970d0aa8a8938 Mon Sep 17 00:00:00 2001 From: tnichols217 <62992267+tnichols217@users.noreply.github.com> Date: Mon, 29 Sep 2025 11:12:14 -0400 Subject: [PATCH] fix appendix references --- src/appendices/appendix1.qmd | 4 +--- src/appendices/appendix2.qmd | 4 +--- src/appendices/appendix3.qmd | 4 +--- src/articles/article1.qmd | 6 +++--- src/articles/article12.qmd | 2 +- src/articles/article5.qmd | 2 +- src/index.qmd | 4 ++-- src/references.qmd | 2 +- src/{articles => }/tag-articles.py | 18 +++++++++--------- 9 files changed, 20 insertions(+), 26 deletions(-) rename src/{articles => }/tag-articles.py (72%) diff --git a/src/appendices/appendix1.qmd b/src/appendices/appendix1.qmd index d8a47b5..b00374b 100755 --- a/src/appendices/appendix1.qmd +++ b/src/appendices/appendix1.qmd @@ -1,6 +1,4 @@ -# Appendix A - -## {{< var acronyms.ec >}} Interpretations +# A: {{< var acronyms.ec >}} Interpretations {.unnumbered} {#sec-art-BW7GLKA5} 1. Academic warning is treated the same way as {{< var glossary.academic-probation >}} when a brother has not had classes for a semester. 1. Standards Board does NOT need to automatically recommend a brother for suspension if said brother is brought up for standards with the possibility of suspension. diff --git a/src/appendices/appendix2.qmd b/src/appendices/appendix2.qmd index d32716e..03af1b9 100755 --- a/src/appendices/appendix2.qmd +++ b/src/appendices/appendix2.qmd @@ -1,6 +1,4 @@ -# Appendix B - -## Standards Rulings +# B: Standards Rulings {.unnumbered} {#sec-art-W7CTO1UV} 1. September 25, 2010 diff --git a/src/appendices/appendix3.qmd b/src/appendices/appendix3.qmd index 6637338..69aec4b 100755 --- a/src/appendices/appendix3.qmd +++ b/src/appendices/appendix3.qmd @@ -1,5 +1,3 @@ -# Appendix C - -## Permanent Legislation +# C: Permanent Legislation {.unnumbered} {#sec-art-LGUUVLYZ} 1. The gargoyles on the front of the Theta Chi house at 11136 Magnolia Drive, Cleveland OH, 44106, shall be named Alphonso and Raul, with the northernmost being Raul. diff --git a/src/articles/article1.qmd b/src/articles/article1.qmd index 12990f8..7792806 100755 --- a/src/articles/article1.qmd +++ b/src/articles/article1.qmd @@ -39,18 +39,18 @@ 1. This document will have the following appendices: - a. {{< var acronyms.ec >}} Interpretations + a. {{< var acronyms.ec >}} Interpretations (@sec-art-BW7GLKA5) i. Will contain a record of {{< var acronyms.ec >}} interpretations of the local bylaws. i. Interpretations that refer to deprecated parts of the local bylaws may be removed at the discretion of the Vice President. i. Items may be added to this appendix by the Vice President. - a. Standards Rulings + a. Standards Rulings (@sec-art-W7CTO1UV) i. Will contain the choice of trial and results of all Trial Hearings for the purpose of establishing precedent. i. All parties will remain anonymous. i. Items will be added to this appendix by the Vice President and will include the date that the decision was made. i. Items that are over five years old may be removed at the discretion of the Vice President. - a. Permanent Legislation + a. Permanent Legislation (@sec-art-LGUUVLYZ) i. Will contain all permanent legislation passed by the chapter. i. Upon being passed, permanent legislation will be added to this appendix by the Vice President. i. Permanent legislation that is revoked or amended will be removed or changed in this appendix by the Vice President. diff --git a/src/articles/article12.qmd b/src/articles/article12.qmd index 8372478..74f033c 100755 --- a/src/articles/article12.qmd +++ b/src/articles/article12.qmd @@ -111,7 +111,7 @@ a. Any member of Standards Board may recall any witnesses or the accused, if further questions arise. This may be done once per witness. To recall a witness more than once requires a unanimous vote of the voting members of Standards Board. 1. The voting members of Standards Board will then determine appropriate sanctions, if any. - a. Past judicial history of the accused and sanctions given for similar accusations in the past (as found in Appendix B) may be considered. + a. Past judicial history of the accused and sanctions given for similar accusations in the past (@sec-art-W7CTO1UV) may be considered. a. The Vice President and {{< var glossary.chapter-advisor >}} (if one is present) may offer input to this discussion but may not vote in the final decision unless it is a tie, in which case the Vice President will vote to break the tie. a. The voting members of Standards Board will vote on all sanctions, one at a time. a. If the sanction being voted on is temporary suspension for any duration of time, the vote must be unanimous in the affirmative in order to succeed. diff --git a/src/articles/article5.qmd b/src/articles/article5.qmd index 367d621..5bfe473 100755 --- a/src/articles/article5.qmd +++ b/src/articles/article5.qmd @@ -54,7 +54,7 @@ a. Serves as Parliamentarian for the chapter and is {{< var glossary.responsible >}} for all committees. a. Maintains the chapter's local bylaws. a. Ensures legislation records are up to date. - a. Adds all permanent legislation to the appropriate appendix as outlined in @sec-art-Q8OV40FK. + a. Adds all permanent legislation to the appropriate appendix (@sec-art-LGUUVLYZ) as outlined in @sec-art-Q8OV40FK. a. Adds {{< var acronyms.ec >}} Interpretations to the Appendices. a. Appoints active members to committees at the beginning of each semester. a. Assigns living space as outlined in @sec-art-C89656BJ. diff --git a/src/index.qmd b/src/index.qmd index 467ed01..4da135a 100755 --- a/src/index.qmd +++ b/src/index.qmd @@ -1,5 +1,5 @@ -# Introductory {.unnumbered} +# Introductory {.unnumbered} {#sec-art-L9A0HXIL} -## Preamble +## Preamble {#sec-art-1QB8CIPO} We, the Brothers of Beta Nu Chapter of Theta Chi Fraternity, in order to forge a more perfect Brotherhood, to advance our Alma Mater, to protect and promote our stated values of Truth, Temperance, and Tolerance, and to practice the ideal of the Helping Hand, do ordain and establish these Bylaws for the operations of our Chapter. diff --git a/src/references.qmd b/src/references.qmd index 925f7c4..65e3e0d 100755 --- a/src/references.qmd +++ b/src/references.qmd @@ -1,4 +1,4 @@ -# References {.unnumbered} +# References {.unnumbered} {#sec-art-RL8025YZ} ::: {#refs} ::: diff --git a/src/articles/tag-articles.py b/src/tag-articles.py similarity index 72% rename from src/articles/tag-articles.py rename to src/tag-articles.py index c9a4c11..f9b4f10 100644 --- a/src/articles/tag-articles.py +++ b/src/tag-articles.py @@ -1,9 +1,9 @@ -import os +from collections.abc import Iterator import re import random import string +from pathlib import Path -# Constants HEADER_PATTERN = re.compile(r'^(##? .+?)(\s*\{#.*\})?\s*$') TAG_TEMPLATE = ' {#sec-art-%s}' ID_LENGTH = 8 @@ -11,11 +11,11 @@ ID_LENGTH = 8 def generate_id() -> str: return ''.join(random.choices(string.ascii_uppercase + string.digits, k=ID_LENGTH)) -def process_file(filepath): +def process_file(filepath: Path): changed = False - new_lines = [] + new_lines: list[str] = [] - with open(filepath, 'r', encoding='utf-8') as f: + with filepath.open("r") as f: for line in f: match = HEADER_PATTERN.match(line) if match: @@ -27,14 +27,14 @@ def process_file(filepath): new_lines.append(line) if changed: - with open(filepath, 'w', encoding='utf-8') as f: + with filepath.open("w") as f: f.writelines(new_lines) print(f"Updated: {filepath}") def main(): - for filename in os.listdir('.'): - if filename.endswith('.qmd'): - process_file(filename) + pathes: Iterator[Path] = Path('.').glob("**/*.qmd") + for path in pathes: + process_file(path) if __name__ == '__main__': main()