Skip to main content

Preview wikilinks in Marked2

Completed

Comments

12 comments

  • Brett

    This would require a custom preprocessor to be written for Marked.

    0
  • Feek

    Hi Brett,

    thnx for the prompt reply! 

    OK, I did not missed a setting in Marked2 :)

    Have to dive into this more...  because when preprocessing a wikilink to a MD link ( [[test]] becomes [test](test.md) ) goes well for previewing big goes wrong for HTML generation. 

    == feek

    0
  • Brett

    I assume you mean because it's a relative URL, which is why WikiLinks aren't a regular part of Markdown. The link will only work as long as the file is in the same directory as the other notes...

    -1
  • Feek

    I mean, when generating HTM the link needs to become [test](test.html) 

    0
  • Brett

    At that point you're into making a whole custom export system outside of Marked to render a wiki, at which point there are just easier ways (like using Gollum).

    0
  • Fletcher Penney

    > I mean, when generating HTM the link needs to become [test](test.html)

     

    That is incorrect.  WikiLinks are different than normal links and imply some sort of a known "database", where `[[foo]]` is translated into something.  It may be `<a href="foo.html">foo</a>`, but it may be something completely different.  All that is known is that `foo` serves as a key to locate information in this "database".  This is why WikiLinks were removed from MultiMarkdown in very early days -- it is really a functionality that belongs to the app, not to the syntax, and is not reliably portable between implementations or even the same implementation in different contexts.

     

    In this case, WikiLinks tell nvUltra to look for a relative text file based on its knowledge of the location on disk of the current file.  This may or may not be useful once the MD/MMD is converted to HTML, or once the file is moved.  So the WikiLink becomes a rich text attribute embedded in the editor that tells macOS to open a URL -- it never becomes `[test](test.html)`, or anything like it.  The custom URL then effectively tells nvUltra to open a different file.  (The actual implementation details are slightly different, but at a higher level this is generally what is going on.)

     

    0
  • Feek

    Hi Brett and Fletcher

    Fletcher Penney I do understand your point of view regarding the 'definition' of wikilinks. Also your concerns related to that link generations depending on what output you want (html, pdf)

    But of the user point of view, nvUltra in combination with the excellent implementation of use of wikilinks (auto completion, browsing documents) also invites to write for example simple documentation which could be reused / shared with others by generating a simple html multi-paged doc  I use nvUltra more and more to generate simple information HTML documents for clients. Normally I used hardcoded html links, but wikilinks makes editing browsing documents (in the editor) much faster! But unfortunately generating the documents is a bit more complex. Some regex search and replace actions do the job, but a kind of out of the box solution would be great.... But I also understand this would have a low priority, because I use nvUltra not as intended (caused by my thoughts of thought).

     

    0
  • Brett

    Either way, this should be a request on the Marked support forums, it's not really an nvUltra issue.

    Again, this type of system is entirely possible using a more complete wiki platform like Gollum, or your own script for generating documentation. I do something very similar for the docs for both nvUltra and Marked, but it's all through my own system of scripts. I don't see it being a feasible change to the basic functionality of either app, though it might possibly be a preference I'd make available in Marked.

    0
  • Fletcher Penney

    Feek -- yes.  WikiLinks are a convenience when the MultiMarkdown text is being used within a known environment (specifically nvUltra, in this case.)  But they are not designed for any use beyond that, because there is no guarantee of compatibility in any other context.  Again, this is why WikiLinks were removed from MultiMarkdown many years ago.  Based on that experience, and the issues described above, I do not plan on adding WikiLinks back to MultiMarkdown itself.

     

    So, just to be clear for anyone else stumbling across this thread in the future...  WikiLinks are not part of MultiMarkdown.  WikiLinks are part of nvUltra as an internal convenience function for quickly navigating between notes.  They have no meaning when MultiMarkdown is converted to any other format (HTML, LaTeX, etc.)

     

    Knowing this, one could always write a quick Perl script to convert `[[foo]]` to `[foo]` in the MMD text, which would then be processed as a normal link.  Or to convert `[[foo]]` to `<a href...` in the HTML.  This would allow you to use a WikiLink as a substitute for a regular link, but would require that you understand your configuration in order to fix any potential problems that arise.

    0
  • Feek

    OK, Thnx again 

    You both convinced me, this goes beyond the scope of MMD and nvUltra and is more a personal houghts of thought. I'll try wo write my own scripts ...

    == feek

     

    [offtopic]Talking about known environment.... I stumbled upon Obsidian lately. But happily nvUltra is my Mac native app for that. only the backlink overview is missing..... is it worth open a request ticket  😁 )..... [/offtopic]

    0
  • Fletcher Penney

    Navigating backwards is already something we are considering, so no need for a ticket.

     

    I'm going to close this for nvUltra, and defer to Brett as to whether any new functionality should be added to Marked or not.

    0
  • Feek

    COOL!!!

    0

Please sign in to leave a comment.

Powered by Zendesk