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

Recognize aliases when resolving inherited icons #1

Closed
vanto opened this issue Sep 30, 2022 · 9 comments
Closed

Recognize aliases when resolving inherited icons #1

vanto opened this issue Sep 30, 2022 · 9 comments

Comments

@vanto
Copy link

vanto commented Sep 30, 2022

Idea
Currently, inherited page icons only work for the exact page reference. It would be nice if this plugin would also take aliases into account until logseq/logseq#3763 might be solved.

@yoyurec
Copy link
Owner

yoyurec commented Sep 30, 2022

check latest update!

@vanto
Copy link
Author

vanto commented Oct 1, 2022

Thanks for the prompt response. It does not do what I expected, maybe I didn't put it precisely. Here is my scenario:

People.md

icon:: 👤

Elon Musk.md

page-type:: [[People]]
alias:: Elon

When I now write something like, only Elon Musk get the icon but not Elon.
Lorem ipsum dolor sit [[Elon Musk]], consectetur adipiscing elit. Ut ex dui, elementum et [[Elon]] in, pretium elementum odio. Phasellus rhoncus rutrum justo sed malesuada.

Thanks, HTH

@yoyurec
Copy link
Owner

yoyurec commented Oct 1, 2022

oh, i thought you have:

People.md

icon:: 👤
alias:: ppl

Elon Musk.md

page-type:: [[ppl]]

@yoyurec
Copy link
Owner

yoyurec commented Oct 1, 2022

will try...

@yoyurec
Copy link
Owner

yoyurec commented Oct 1, 2022

should be something like:

  • try icon from page
  • if not, try to go page alias to original page and take its icon
  • if not, try to take inherited from props page icon
  • if not, try to take inherited from props, if it's alias, go to original page and take its icon

@yoyurec
Copy link
Owner

yoyurec commented Oct 1, 2022

uhhh.... it was challenging )))
check latest release!

  • original page
  • aliased page
  • original page with inherited props-as-page
  • aliased page with inherited props-as-page
  • original page with inherited props-as-alias

+ cases when local icon wins inherited )))

PS: aliased page with inherited props-as-alias not covered yet, cose to complex rare case with possible performance issues

check latest update!

@vanto
Copy link
Author

vanto commented Oct 1, 2022

Awesome, this works! Thanks for the fast implementation.

@vanto vanto closed this as completed Oct 1, 2022
@yoyurec
Copy link
Owner

yoyurec commented Oct 1, 2022

i'm not so much using aliases.... so case "original page with inherited props-as-alias" (which i've implemented first, wrongly) - maybe delete it? isn't it rare?
b'cose EACH link checks 4 times (( but can be 3 )))

@vanto
Copy link
Author

vanto commented Oct 1, 2022

Is this the scenario from #1 (comment)? I would not need that. I, too, think it is a rather rare use case.

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

No branches or pull requests

2 participants