Github flavored markdown "wiki" tools. Supports authoring interlinked pages and support for github issues linking.
This is developed for a github.com rendered repo with a flat-directory (no nested folders) containing markdown files that link to one another as well as internal github issues.
But it will likely also be useful on other markdown projects (mkdocs
, hugo
) as well.
An example Makefile using pandoc
to generate a giant interlinked pdf file from all markdown files.
check file names, headers, and links between *.md
files.
TODO: add line number and improve messages. maybe rewrite in compiled language.
- file names are lowercase
-
separated.md
files - first header in a file is also it's name (case insensitive, spaces translated to
-
)- does not check header rules for
readme.md
orindex.md
- does not check header rules for
- all headers are uniquely named across all files
- when
[blah][file.md#header1]
is writtenfile.md
existsfile.md
has some header namedheader1
(line in file like## header1
)
- optionally: can check or "orphan" headers that are never linked to
echo -e "# testing\n## [dne](test.md#does-not-exist)" > test.md
wiki-lint.pl
WANRING: test.md: first header should be match filename not 'testing'
test.md: test.md#does-not-exist link does not exist
This file/emacs package contains functions for quickly linking topics between files.
Use M-x list-packages
to install quelpa-use-package
. then add below to e.g. $HOME/.config/emacs/init.el
.
(use-package gfm-wiki
:quelpa ((gfm-wiki :fetcher github :repo "NPACore/gfm-wiki") :upgrade t)
:bind (:map markdown-mode-map
("C-c M-l" . #'gfm-wiki-insert-link-header)
("C-c M-L" . #'gfm-wiki-insert-link)
("C-c M-i" . #'gfm-wiki-insert-issue)
("C-c M-d" . #'gfm-wiki-deft)
;; other packages -- better to define elsewhere
("C-c l" . #'link-hint-open-link)
("C-c g" . #'git-link)
))
-
gfm-wiki-repo-name
contains the prefix for issues. github.com will render a link from anything thing that looks likeorg/repo#id-num
. This variable stores theorg/repo
part. (Theid-num
is fetched bygfm-wiki-insert-issue
)- consider
((markdown-mode . ((gfm-wiki-repo-name . "NPACore/gfm-wiki"))))
in.dir-local.el
- TODO: pull this from
git remote -v|grep -Pom1 '(?<=github.com.).*(?=.git )'
- consider
-
gfm-wiki-insert-issue
command for getting issue number (to insert) and title (for search). Currently usinggit-bug|jq
aftergit bug bridge
with github. SeeMakefile.example
's git-bug entry. -
gfm-wiki-mkdocs-root
changes link insert to add a prefix (likely "/"). Setting this to non-nil has the side-effect of also stripping the.md
suffix.- consider
.dir-locals.el
:((markdown-mode . ((gfm-wiki-mkdocs-root . "/"))))
- TODO: update link/ffap to follow these links
- TODO: wiki-lint.pl should understand mkdocs links too
- consider
gfm-wiki-insert-link-header
shells out toperl
for finding headers.gfm-wiki-insert-issues
usesgit-bug
andjq
to insert issues bridged to github.gfm-wiki-deft
wraps emacs packagedeft
for a open/create files with search narrowing Consider modifygfm-wiki-issue-cmd
to usegh
instead.- The emacs package
ivy
is used for "completing-read" functions.