Skip to content

Instantly share code, notes, and snippets.

@DivineDominion
Created April 22, 2021 10:13
Show Gist options
  • Save DivineDominion/83feb20f7a1fa059b915d6e5c412e1b9 to your computer and use it in GitHub Desktop.
Save DivineDominion/83feb20f7a1fa059b915d6e5c412e1b9 to your computer and use it in GitHub Desktop.
Kramdown GFM Parser extension for [[wikilinks]]
@rathboma
Copy link

Hey! This looks like just what I need. Are you using this in a production environment? Any tweaks needed?

@DivineDominion
Copy link
Author

I'm using this in a nanoc statically built website.

  filter :kramdown, KRAMDOWN_OPTS.merge({input: 'GFMWikiLink'})

That option to select the flavor GFMWikiLink is all I needed to do.

Didn't actually write anything on the wiki since figuring this out, but it's at https://christiantietze.de/wiki/ :)

The website repo isn't public so I don't have to worry if I ever committed a password -- but if you want to see anything, send me an email.

@rathboma
Copy link

Thanks! Question -- do you really need to redefine the Table regexes? Is there not a way to force the wikilinks regex match to happen first?

@DivineDominion
Copy link
Author

DivineDominion commented Aug 23, 2022

@rathboma I think no; but I'd be happy if you find a better way :) The table parser is block-level, the wikilink parser span level. You'd need to add a block level parser that detect a non-table block with wikilink inside and then prevent the table, maybe 🤔

@rathboma
Copy link

Fair enough! FYI I got this working. It's great. thank you for posting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment