diff --git a/contributor_to_wiki_guidelines.md b/contributor_to_wiki_guidelines.md index b39348f..81b0a1b 100644 --- a/contributor_to_wiki_guidelines.md +++ b/contributor_to_wiki_guidelines.md @@ -1,3 +1,22 @@ # contributor to wiki guidelines ![](https://images.squarespace-cdn.com/content/v1/518f5d62e4b075248d6a3f90/1440708225336-222IWR08EAYDB702LXWE/ke17ZwdGBToddI8pDm48kIXUpvhBrBZPKoLIxiWlZx97gQa3H78H3Y0txjaiv_0fDoOvxcdMmMKkDsyUqMSsMWxHk725yiiHCCLfrh8O1z5QPOohDIaIeljMHgDF5CVlOqpeNLcJ80NK65_fV7S1UW6r-5KZab7F0Ak3dvMWCwb56ceReDoNB9OE6BF3ct6_tN_KfIuurh-w-x7bjNuMJA/image-asset.jpeg?format=1500w) + +## GitHub wikis are a flat namespace + +Every `.md` file resolves to a URL by filename alone, no matter which +directory it lives in in this git repo. The `data_files/` directory some +pages sit in is cosmetic -- `data_files/elements_XML.md` and a hypothetical +top-level `elements_XML.md` would collide at the same URL. Don't try to +nest pages by directory; keep filenames unique across the whole repo instead. + +## Before adding a link + +Run this from the repo root to make sure every `](page_name)` link you added +actually points at a page that exists: + +```sh +ls *.md data_files/*.md | xargs -n1 basename | sed 's/\.md$//' | sort -u > /tmp/pages.txt +grep -ohE '\]\(([A-Za-z_][A-Za-z0-9_]*)\)' *.md data_files/*.md | tr -d '()]' | sort -u > /tmp/links.txt +comm -23 /tmp/links.txt /tmp/pages.txt # anything printed here is a dead link +```