mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-16 10:44:13 +02:00
Document the flat wiki namespace and add a dead-link check (ref #816)
@@ -1,3 +1,22 @@
|
||||
# contributor to wiki guidelines
|
||||
|
||||

|
||||
|
||||
## 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
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user