Skip to content

Uniform rendering of links#82

Open
jforberg wants to merge 1 commit intozoni:mainfrom
jforberg:uniform-links
Open

Uniform rendering of links#82
jforberg wants to merge 1 commit intozoni:mainfrom
jforberg:uniform-links

Conversation

@jforberg
Copy link

@jforberg jforberg commented Feb 4, 2022

Render all links as Link in the export. Remove the special case where
dead links were rendered as Emphasis instead. This makes it much easier
to style links in the final output.

Remove the special case where dead links were rendered as Emphasis
instead. This makes it easier to style the links in the final output.
@jforberg
Copy link
Author

jforberg commented Jun 24, 2025

@zoni I have rebased my branch on top of yours. Would you consider accepting this pull request? The current behaviour of translating [dead link] -> *dead link* makes the output quite challenging to style.

@zoni
Copy link
Owner

zoni commented Jun 24, 2025

I just started some work on this last weekend, as a matter of fact, and plan to have it in for the next release. You can explore the customizable-missing-note-handling branch if you're interested in the details.

What I'd like to expose is options to:

  • Rewrite links (current behavior)
  • Keep dead links as-is (more Obsidian-like)
  • Skip embeds that can't be found (current behavior)
  • Replace embeds that can't be found with the text "note name" is not created yet" (more Obsidian-like)
  • Print / suppress printing of "Warning: Note name not found" messages

..but I'm not sure yet what the best CLI design is for the different argument flags that would be needed.

@jforberg
Copy link
Author

Hi, that sounds like a good idea. In my view it is normal for a wiki to contain dead links, they just represent articles that haven't been written yet. For embeds I think it can be considered an error if the link is dead.

The link->emph rewrite is problematic for my usecase, because I want to turn my notes into a printed version without any hyperlinks. Translating links into a plain <em> makes it impossible to style them as desired.

I think the behaviour proposed in this PR can be a good default behaviour, but maybe it can be good to have more fine-grained options too.

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

Comments