Giter Site home page Giter Site logo

Comments (9)

GeoffreyChen777 avatar GeoffreyChen777 commented on May 28, 2024

Hi, once you modify the metadata of a paper (by clicking the edit button in the menu bar), the generated bib is changed. Have you tried that?

from paperlib.

paolieri avatar paolieri commented on May 28, 2024

Yes, that works; but I'd like to have one editable field that contains the entire bib entry, to make some changes manually.
Then, if there are manual changes, it should copy the manually modified entry.

from paperlib.

GeoffreyChen777 avatar GeoffreyChen777 commented on May 28, 2024

As it is a very personal feature, what about we achieve it via an extension?

  1. You can attach your modified .bib as a supplementary like this.
  2. You develop an extension to hook a point in the reference exporting pipeline.
  3. Once you export a paper, it triggers a function in your hook extension to replace the original bib string with the content in the .bib file if exits.

As we currently only have some hook points in the metadata scraping pipeline (refer to https://paperlib.app/en/extension-doc/process-hook.html). All we need to do is to add some new hook points in the reference exporting pipeline.

What do you think about it?

from paperlib.

paolieri avatar paolieri commented on May 28, 2024

Sounds good! The extension could be called "Export from supplementary BibTeX".

  • Attaching supplementary files could be nice, because one could mass-edit them in PaperLib's directory using shell scripts.
  • Instead, an editable field would be easier to edit within PaperLib, but it would be saved in the metadata (so, harder to access).

The part on extension hooks makes sense; but I would say that it intercept two actions:

  • One for Export > BibTex
  • Another for Export > BibTex Key

Regarding support for this kind of hooks in PaperLib: how would you determine the order in which extensions should run if they are registered for a hook? E.g., say that there's also an extension that fixes the capitalization; should it run before or after "Export from supplementary BibTeX"?

from paperlib.

GeoffreyChen777 avatar GeoffreyChen777 commented on May 28, 2024

Currently, for a pipeline, we have many hook points, such as beforeXXX, afterXXX. For each point, the order is determined by the hook registering order.

In future, we would add a priority arg for hook registering.

In your own extension, you can organise all your functions in sequential like this:

      Pipeline X ---> beforeStep1 ---> Step1 ---> afterStep1 ---> Others.
                      
    (go into your ext)/       ^ (return from your ext)
            -------- /         \ --------
           /                              \
          v                                \
    your func1  --> your func2 --> .. -- > your funcN

from paperlib.

paolieri avatar paolieri commented on May 28, 2024

Thanks, makes sense!

Priorities are perhaps not the best solution, because high/low priority extensions would likely use the max/min priority value, and you would still have to solve ties by "hook register ordering".

In my opinion, it would be better to:

  • Allow the user to re-order extensions (this could be in the extensions configuration page)
  • Allow extension developers to specify a list of other extensions that should run before, if installed (to decide where to place the extension when it is installed)

from paperlib.

GeoffreyChen777 avatar GeoffreyChen777 commented on May 28, 2024

Hi, a new version with some new hook points has been released now.

Please refer to:

For inspiration about how to develop a hook extension, you can see https://github.com/Future-Scholars/paperlib-entry-scrape-extension

I would suggest you use the beforeExport... or the citeObjCreatedIn... hook points for this issue.

For priorities, I will think about it. Thanks for your suggestion.

from paperlib.

paolieri avatar paolieri commented on May 28, 2024

Thanks! I may have to postpone this to May, but I'll give it a try to implement the extension.

from paperlib.

GeoffreyChen777 avatar GeoffreyChen777 commented on May 28, 2024

OK~ I will close this issue for now.

If you have any problem with the development of extensions, feel free to ask me.

from paperlib.

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.