see more about wiki links, filenames, and URLs at Link workbench.
(question mark missing from filename because Netlify doesn't like ?
or #
in deployed filenames.)
(Or something like a specification? use RFC template?)
/ outline the syntax // / do not assume scheme when encountering ':' (Obsidian does not allow ':' in file names, so such links cannot create wiki pages) // / generate full path links from root of the wiki // / do not change case on the text in the link //
for each line
find wikilink string
(e.g., with this re: wikilink_pattern="\[\[(.*?)\]\]")
search wikifiles dictionary
if found replace string with wikilink full pathname
wikilink edge cases (from Pete)
- [[wiki page]]
- [[Wiki Page]]
- [[wikI pagE]]
- [[WikiPage]]
- [[../wiki page]]
- [[../../wiki page]]
- [[../subdir/wiki page]]
- [[/wiki page]]
- [[/subdir/wiki page]]
- [[/subdir/../subdir2/../wiki page]]
- [[wiki page.md]]
- [[wiki page.jpg]]
- [[wiki page.jpeg]]
- [[wiki page.bmp]]
- [[wiki page/]]
- [[wiki page.exe]]
- [[wiki page.txt]]
- [[Page: Wiki]]
- [[Punctuation Is !@#$%^&*()_+-={}[]|\:";'<>,.?/~` Fun]]
build first tests for a small set of ordinary cases that
- [[wiki page1]]
- [[../wiki page2]]
- [[../../wiki page3]]
- [[../subdir/wiki page4]]
- [[/wiki page5]]
- [[/subdir/wiki page6]]
- [[/subdir/../subdir2/../wiki page7]]
-
Pete's guess at workflow for wikilinks, including wikilinks with paths:
.
or /
characters) or (includes a /
character anywhere), just append .html
to the target to create the HTML link, and emit a diagnostic message that the link was not transformed in anyway, because it contained path-like characters (./
)..html
to the filepath, and use that to create the HTML linkDesign principles:
foo/../../bar/../baz
), and we don't (yet) want to promise users we will do it correctly. instead, just pass along any target that looks like it is trying to include path characters (even if the path would be invalid).Examples: