Skip to content

Wiki-style links#351

Merged
srid merged 7 commits intomasterfrom
wikilink
Aug 21, 2020
Merged

Wiki-style links#351
srid merged 7 commits intomasterfrom
wikilink

Conversation

@srid
Copy link
Copy Markdown
Owner

@srid srid commented Aug 20, 2020

Part of #312

Replace autolinks with Wiki links (see below), making them the default. Autolinks will be supported for backwards compat.

  • <foo?cf> replaced by [[foo]]
  • <foo> replaced by [[[foo]]]
  • <z:zettels?tag=xyz> replaced by [[[z:zettels?tag=xyz]]]

In particular note that [[[...]]] makes the link a folgezettel, whereas [[..]] makes it a cf. This applies to full URI queries too.

The following are outside the scope of this PR:

  • {{..}} style links
  • Plain markdown links

Tasks,

  • Working prototype
  • Complete, and refactor, implementation
  • Add unit test coversage
  • Replace all links in ./guide, and update documentation

@srid srid mentioned this pull request Aug 21, 2020
3 tasks
@srid srid marked this pull request as ready for review August 21, 2020 21:26
@srid srid merged commit c51117d into master Aug 21, 2020
@srid srid deleted the wikilink branch August 21, 2020 21:34
@vcavallo
Copy link
Copy Markdown

vcavallo commented Aug 25, 2020

In case it's helpful for anyone in the future, these sed snippets should help with converting your existing <asdf.md?cf> and <asdf.md> style links to the new bracket-style. These worked for me but are largely untested, so be careful, backup your data, and your mileage may vary:

# use from within the directory where your .md files reside.
# for ?cf links:
sed -E "s:<([a-zA-Z0-9.]*)\?cf>:[[[\1]]]:g" *.md

# for standard links:
sed -E "s:<([a-zA-Z0-9.]*)>:[[\1]]:g" *.md

These will also change any other text that is wrapped in < >, so beware of that, as well.

In case you're like me and not a sed expert, after running one of the above commands and determining that the output looks good (the above will output to standard out, but not change anything in your files), add -i'' to the line, as in:

sed -E -i'' "s:<([a-zA-Z0-9.]*)>:[[\1]]:g" *.md

...which will change your files in-place 1. I recommend using git and careful diffing to make sure this is doing what you want. Good luck!

aca added a commit to aca/neuron-language-server that referenced this pull request Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants