GithubHelp home page GithubHelp logo

Comments (5)

RyotaUshio avatar RyotaUshio commented on June 25, 2024

First of all, what makes you want to avoid just doing the copy-paste once again?
Also, could you elaborate on what the workflow in your mind looks like exactly?


As for the &selection=... syntax, I have already succeeded in deciphering it! So it will not be a big problem.

update the quoted text with newly selected

Auto-updating not only the link itself but also the surrounding texts will be very difficult given the variety of custom copy formats.
So as you suggest, the only feasible solution would be using embeds and updating the link text.

Updating link texts will not be difficult, but as you say, opening too many PDF embeds might degrade the performance.
Opening PDF files is such a heavy job.

Can you kindly provide a reference for the Logseq feature you mentioned?

Thank you very much for considering to support me. It really means a lot to me.
I will seek other options for how you can sponsor me!

from obsidian-pdf-plus.

SSmJaE avatar SSmJaE commented on June 25, 2024

First of all, what makes you want to avoid just doing the copy-paste once again?

perfectionism

Also, could you elaborate on what the workflow in your mind looks like exactly?

It depends on the difficulty of implementing this feature, the workflow is already good enough, it's just another quality-of-life kind of enhancement

Can you kindly provide a reference for the Logseq feature you mentioned?

I just realized a more approachable way to achieve this

we need to keep sync between the link and quoted text (by a unique identifier), let us separate this into two problems

  • save the identifier in the link
  • save the identifier in quoted text, while adaptable to different template formats

the first one is pretty easy, we can use query params like below

#page=60&selection=100,8,102,65&identifier=123123

the second one is the same as zotlit and flashcards-obsidian, we put an explicit identifier just around the quoted text
meanwhile, we may need an HTML5 comment to wrap quoted text

<!-- customizable quote start --> <-- this will be hidden in `live preview` or `reading` mode
any template format
...
<!--customizable quote end -->
^123123    <-- explicit identifier in markdown file

as we have backlinks, we already have a mapping relationship between the identifier and file path, we could directly search(regex?) the identifier in that file, then replace the corresponding region

an example regex pattern

{customizable quote start}
.* <-- any text between
{customizable quote end}
\^(\d*)\n <--match the identifer

from obsidian-pdf-plus.

RyotaUshio avatar RyotaUshio commented on June 25, 2024

@SSmJaE I've just updated funding methods and added ko-fi, which supports PayPal!
I appreciate your support and suggestions!


I see, so even after the text selection (&selection=...) changes, the identifier stays untouched, which allows us to locate the corresponding quote in the markdown file and update its content.

That's an interesting idea. But how should we handle the variety of copy template formats?

To make this happen, we will have to identify which template format was used for the quote.
To make matters even worse, the quote might have been added with some arbitrary comments after pasting. When updating the quote, we need to avoid overwriting such comments.
Also, we will have to take care of changes in copy template formats themselves.

from obsidian-pdf-plus.

SSmJaE avatar SSmJaE commented on June 25, 2024

we will have to take care of changes

It's really quite simple; we don't have to change the text with 100 percent certainty.
If it matches the pattern, we update it.
If it doesn't match, we notify the user that we didn't find the supposed pattern.

how should we handle the variety of copy template formats?

image

I found that the html5 comment tag will still be visible in live preview mode, while other html5 tag like div, will also be hidden in live preview mode, and it can be inserted into callout, like what the picture illustrates.

Then we can save data as tag's attribute, which could also be used by regex pattern to locate it.

No matter what template format the user is using, once they have corresponding tag, we can locate and update them.

by the way, happy lunar new year

from obsidian-pdf-plus.

SSmJaE avatar SSmJaE commented on June 25, 2024

hi, any ideas?🙃

from obsidian-pdf-plus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.