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.mdfiles - first header in a file is also it's name (case insensitive, spaces translated to
-)- does not check header rules for
readme.mdorindex.md
- does not check header rules for
- all headers are uniquely named across all files
- when
[blah][file.md#header1]is writtenfile.mdexistsfile.mdhas 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-namecontains the prefix for issues. github.com will render a link from anything thing that looks likeorg/repo#id-num. This variable stores theorg/repopart. (Theid-numis 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-issuecommand for getting issue number (to insert) and title (for search). Currently usinggit-bug|jqaftergit bug bridgewith github. SeeMakefile.example's git-bug entry. -
gfm-wiki-mkdocs-rootchanges link insert to add a prefix (likely "/"). Setting this to non-nil has the side-effect of also stripping the.mdsuffix.- 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-headershells out toperlfor finding headers.gfm-wiki-insert-issuesusesgit-bugandjqto insert issues bridged to github.gfm-wiki-deftwraps emacs packagedeftfor a open/create files with search narrowing Consider modifygfm-wiki-issue-cmdto useghinstead.- The emacs package
ivyis used for "completing-read" functions.