Styling for internal link without file (After 0.9.4 in edit mode)

You would have to define it with CSS but if this (link below) goes forward it would solve that problem.
https://forum.obsidian.md/t/css-support-for-missing-pages/3002/2?u=meins

5 Likes

Would be good if suchlinks appear in red, like how they show it in Wikipedia

2 Likes

Over in CSS support for "missing pages", we talked about making classes for these sorts of links, but not automatically styling them in the default Obsidan stylesheets, so that users can use their own obsidian.css file to determine which of these special links should be highlighted in CSS and in what way.

Personally, I’d probably put a font-awesome icon at the end of them instead of changing the actual font color, but that’s the kind of personal preference this would allow us to have.

3 Likes

Wow! that’s a nice idea! How can one add font-awesome icon there?

I believe that you’d add a content attribute to the class you want to target, but now that I think about it, you’d probably need to append a class for FontAwesome to the element, which I don’t think we can do without a pretty extensive Obsidian API that doesn’t exist yet. So maybe FA is out for a while.

On the other hand, if we have a class assigned to missing links, we could target missing::after in CSS and add content: "⚠" (or whatever emoji of your choice) and use that instead to delineate missing links.

After actually looking at the setup in Obsidian, it seems that instead of ::after the devs append the external link icon using a SVG background and some extra left padding, so not the same thing. Not sure if it’d be possible to piggyback that or just use the same design pattern for our icon-after-missing-link trick.

1 Like

+1 — I think this would be super helpful

Also this topic should be merged with the following topics:

https://forum.obsidian.md/t/visually-different-display-of-broken-links/238/9

When I’m brainstorming a lot of content, I really like to be able to enter [[some new link]] while in the middle of a thought without stopping to create the new page. It’d be really convenient if I could style links to non-existing pages to be different, like they appear in MediaWiki and DokuWiki. That would allow me to quickly see what I need to write up or explore at a glance, rather than needing to mouse over each one to see if it exists.

I looked into the CSS, and it doesn’t seem like there’s an equivalent to the CSS class “new” in MediaWiki, so I can’t write custom CSS to select and style it. And yet, it shouldn’t be terribly hard, because Obsidian already knows when links are pointed an existing or a non-existent page.

I don’t think the default stylesheets need to actually style missing links themselves, but having the option to do so in my override CSS would be great.

8 Likes

There used to be such a class actually (missing links were styled red like in MediaWiki), but it was removed. We can add it back without styling it, yeah.

19 Likes

That seems like an excellent middle ground. Thanks!

2 Likes

@silver would it also be feasible to apply this to the graph as well? I don’t know if it’s possible to style the graph nodes with CSS, but that would be an awesome value add for this feature request.

1 Like

I’d love this specifically for styling my Calendar View (credit @Jeffurry) so I can see which days I have notes for and which I don’t.

2 Likes

@liam How did you get that calendar view?

@Mat deserves the credit - I’m just a blagger!

1 Like

It’s just a Markdown table with [[inline links]]. These are the 2 markdown files posted in the discord :point_down:

Calendars.zip (4.8 KB)

So if you add them to your Vault, It Just Works :tm:

5 Likes

Could we get “broken” links (and also, perhaps, links to not yet created notes) displayed with some visual marker … maybe different colours, or squiggly underline or something?

20 Likes

This could be really handy!

TiddlyRoam highlights links that don’t exist yet in yellow like the screenshot. Something obvious, but not crazy so you can’t stop looking at it.

Please, add this! There should be a visual way to differentiate links to non-existing notes.

Here is some encouraging info on this topic.

Will be an option if we do end up implementing this.

Non-existent files used to be red in v0.0.1, and it was removed due to complaints.

2 Likes