Skip to content

Commit

Permalink
Update vale config to get vocab dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
edibotopic committed Aug 13, 2024
1 parent 070a9f3 commit 3c38326
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/.sphinx/get_vale_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,23 @@ def main():
file.write(download.text)
file.close()

if os.path.exists(f"{DIR}/.sphinx/styles/config/vocabularies/Canonical"):
print("Vocab directory exists")
else:
os.makedirs(f"{DIR}/.sphinx/styles/config/vocabularies/Canonical")

url = "https://api.github.com/repos/canonical/praecepta/contents/styles/config/vocabularies/Canonical"
r = requests.get(url)
for item in r.json():
download = requests.get(item["download_url"])
file = open(".sphinx/styles/config/vocabularies/Canonical/" + item["name"], "w")
file.write(download.text)
file.close()

config = requests.get("https://raw.githubusercontent.com/canonical/praecepta/main/vale.ini")
file = open(".sphinx/vale.ini", "w")
file.write(config.text)
file.close()

if __name__ == "__main__":
main()
main()

0 comments on commit 3c38326

Please sign in to comment.