Styling Wiki-like Links


#1

Hi all,

I flip between nvALT and FoldingText, and in nvALT I use the Wiki-like links, by placing text between double squared brackets.

I’d like to theme FoldingText so that all double-square-bracketed text would be automatically styled with a highlight (and the brackets themselves hidden, except when the cursor is over the text), exactly as happens already with inline code blocks between backticks and with CriticMarkup.

Unfortunately I’m stuck as to how to do it! Is it achievable? And if so, could someone help out? It would be a great help to me, and perhaps other people too.

Thanks,

Mark


#2

Have you seen Jamie Kowalski’s wikilinks plugin, and Jesse’s wiki link formatting example ?


#3

Thanks for this, I hadn’t seen either! I have Jesse’s plugin working, and having these links working is more than I had thought to achieve, so that’s great.

Call me particular, but I would still like to restyle these to hide the brackets and highlight them, in the same way as CriticMarkup passages, for them to be clearer, distinct from normal links etc. I can see how that is done in criticmarkuphelper.js but I’m also an amateur and my attempts to jam some of that into main.js in Jesse’s plugin (which I’m sure must be all I need to do) have failed miserably. Do you think this would be hard to achieve? Any help much appreciated, but thanks again for the tip offs!

Mark


#4

Hi Mark,

I’ve just updated the extension on Github. In the style.less file, I added some code at the top to enable the syntax highlight, but have left it commented out. (I also added a couple rules to use the interface color for the links.)

Do the links open files correctly? Check the instructions in the README file, and let me know if you need any help.

Jamie


#5

Hey there, figured I’d respond to this post. For me, the links do not open correctly, instead nvalt immediately opens. I’d really like to get a good wiki system with FT and TP, it would be fantastic.