Skip to content

Commit

Permalink
docs: Update vale config to get vocab dependency (#865)
Browse files Browse the repository at this point in the history
This updates the configuration settings for the [Vale](https://vale.sh/)
linter, based on recent changes to the docs Starter Pack.

The linter now works as expected. Running checks on a specific file can
be done as follows:

`make vale TARGET=tutorial/getting-started.md`

This prints a list of errors, suggestions and warnings relating to
documentation style, such as:

` 162:1 warning Avoid inline comments in codeblocks
Canonical.016-No-inline-comments`

UDENG-3785
  • Loading branch information
edibotopic authored Aug 13, 2024
2 parents 070a9f3 + 3c38326 commit 878ebb3
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 878ebb3

Please sign in to comment.