Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Adds logic to look for links in frontmatter #944

Open
wants to merge 1 commit into
base: v4
Choose a base branch
from

Conversation

putzwasser
Copy link

Parses the frontmatter data for wiki links

  • Adds outgoing/backlinks to the graph
  • Adds backlinks to the backlink pane

- Adds outgoing/backlinks to the graph
- Adds backlinks to the backlink pane
@@ -23,6 +25,7 @@ interface Options {
openLinksInNewTab: boolean
lazyLoad: boolean
externalLinkIcon: boolean
includeFrontmatterLinks: boolean
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
includeFrontmatterLinks: boolean
includeFrontmatter: boolean

// Add frontmatter links to outgoing links
if (opts.includeFrontmatterLinks && file.data.frontmatter) {
for (const [fmKey, fmValue] of Object.entries(file.data.frontmatter)) {
if (fmValue && typeof fmValue === "string") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah you might need to take a look at how we handle links in ofm.ts to handle alias, intra-links docs, and marks.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do this in ofm instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah you might need to take a look at how we handle links in ofm.ts to handle alias, intra-links docs, and marks

I tried to but I didn't manage to get a grasp of how it works. This is still too high level typescript for me 🤣

@jackyzha0
Copy link
Owner

imo this shouldn't be allowed (even obsidian doesn't show these links in the graph if they aren't in the links field iirc?)

we should expose the ability to parse a wikilink as a function so that plugin authors may opt-in to that behaviour if they would like though

@putzwasser
Copy link
Author

obsidian doesn't show these links in the graph if they aren't in the links field iirc

Actually, it does. In the links pane, in the backlinks section and in the graph :)
This motivated me to create this (code-wise rather clumsy) PR.

image

So, this change would be completely compatible with "raw" obsidian without plugins.

Additionally, this allows to create an obsidian breadcrumbs plugin for quartz.

@aarnphm
Copy link
Collaborator

aarnphm commented Sep 25, 2024

TIL. we do live in a society lol

@aarnphm
Copy link
Collaborator

aarnphm commented Sep 25, 2024

cc @saberzero1, since you are looking into markdown parser, might be of interests, but lower triage than the refactor.

@aarnphm
Copy link
Collaborator

aarnphm commented Sep 25, 2024

see also #1427

necauqua added a commit to necauqua/beta-quartz that referenced this pull request Dec 24, 2024
I was missing this feature and implemented it, not knowing that there
was jackyzha0#944 already ¯\_(ツ)_/¯

Looking at it now I think that my impl is a little better, and I'd love
to have it upstreamed.

Closes jackyzha0#820 and jackyzha0#944
necauqua added a commit to necauqua/beta-quartz that referenced this pull request Dec 24, 2024
I was missing this feature and implemented it, not knowing that there
was jackyzha0#944 already ¯\_(ツ)_/¯

Looking at it now I think that my impl is a little better, and I'd love
to have it upstreamed.

Closes jackyzha0#820 and jackyzha0#944
necauqua added a commit to necauqua/beta-quartz that referenced this pull request Dec 24, 2024
I was missing this feature and implemented it, not knowing that there
was jackyzha0#944 already ¯\_(ツ)_/¯

Looking at it now I think that my impl is a little better, and I'd love
to have it upstreamed.

Closes jackyzha0#820 and jackyzha0#944
necauqua added a commit to necauqua/beta-quartz that referenced this pull request Dec 24, 2024
I was missing this feature and implemented it, not knowing that there
was jackyzha0#944 already ¯\_(ツ)_/¯

Looking at it now I think that my impl is a little better, and I'd love
to have it upstreamed.

Closes jackyzha0#820 and jackyzha0#944
necauqua added a commit to necauqua/beta-quartz that referenced this pull request Dec 24, 2024
I was missing this feature and implemented it, not knowing that there
was jackyzha0#944 already ¯\_(ツ)_/¯

Looking at it now I think that my impl is a little better, and I'd love
to have it upstreamed.

Closes jackyzha0#820 and jackyzha0#944
necauqua added a commit to necauqua/beta-quartz that referenced this pull request Dec 24, 2024
I was missing this feature and implemented it, not knowing that there
was jackyzha0#944 already ¯\_(ツ)_/¯

Looking at it now I think that my impl is a little better, and I'd love
to have it upstreamed.

Closes jackyzha0#820 and jackyzha0#944
necauqua added a commit to necauqua/beta-quartz that referenced this pull request Jan 2, 2025
I was missing this feature and implemented it, not knowing that there
was jackyzha0#944 already ¯\_(ツ)_/¯

Looking at it now I think that my impl is a little better, and I'd love
to have it upstreamed.

Closes jackyzha0#820 and jackyzha0#944
@aarnphm
Copy link
Collaborator

aarnphm commented Jan 9, 2025

fwiw let me finish writing remark-wikilinks and then it should parse it for once.

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.

3 participants