~abcdw/rde-discuss

1

Split feature-emacs-zotra / feature-emacs-citation

Details
Message ID
<87y13bo2kn.fsf@ngraves.fr>
DKIM signature
pass
Download raw message
Hi RDE!

I used a self-contained doi-based bibliography management solution,
which I'm currently migrating to emacs-persid. I've found that the
feature-emacs-citation has emacs-zotra (not self-contained) builtin. I
feel this solution is not mature enough to make it into
feature-emacs-citation.

I would like to split this functionality until it is mature / self
contained / integrated with browser features, before eventually
integrating it back in.

I can propose an alternative that I use. The API would be based on
DOIs (rde-citation-add-entry-from-doi), which are not as convenient as
URLs, but are honestly quite easy to find in any paper.

Managing the bibliography itself is not that complicated in this case, I
used such a function:

(defun refresh-gen-biblio ()
      "Regenerates the generated gen.bib file based on the list in dois.txt."
      (interactive)
      (with-temp-file "/tmp/retrieved_dois.txt"
                      (maphash
                       (lambda (k v)
                         (insert
                          (concat (cdr (car v)) "\n")))
                       (parsebib-parse "~/resources/gen.bib"
                                       :fields '("doi"))))
      (with-temp-buffer
       (mapcar (lambda (x) (persid-insert-bibtex x))
               (cl-set-exclusive-or
                (s-split "\n" (f-read "~/resources/dois.txt") t)
                (s-split "\n" (f-read "/tmp/retrieved_dois.txt") t)
                :test 'string-equal-ignore-case))
       (append-to-file nil nil "~/resources/gen.bib")))

I previously used biblio.el to fetch dois but I think persid will be
better, though requires porting some code from doi.el to properly
cleanup doi entries (~15 lines I guess, not too much).

All in all, this can be :
- persid : lightweight
- a copy of biblio.el doi cleanup in RDE
- a refresh-biblio function integrated with a
  rde-citation-add-entry-from-doi function

Regarding library files (pdfs...), I also have a solution (which I would
like to migrate a bit too), but let's start with this first.

On another note, I also have some work I did to be able to build the
Zotero package in a Guix-compatible way in 68941 some time ago. This is
far from finished but I guess was a first relevant way to start
bootstrapping Node packages. IIRC, I had quite some patches above this
one that went quite far, though I had not built zotero itself.

-- 
Best regards,
Nicolas Graves
Details
Message ID
<87o745ecvo.fsf@trop.in>
In-Reply-To
<87y13bo2kn.fsf@ngraves.fr> (view parent)
DKIM signature
pass
Download raw message
On 2024-09-29 00:06, Nicolas Graves wrote:

> Hi RDE!
>
> I used a self-contained doi-based bibliography management solution,
> which I'm currently migrating to emacs-persid. I've found that the
> feature-emacs-citation has emacs-zotra (not self-contained) builtin. I
> feel this solution is not mature enough to make it into
> feature-emacs-citation.

That's true.  IIRC, I was using podman for running translation service.

> I would like to split this functionality until it is mature / self
> contained / integrated with browser features, before eventually
> integrating it back in.
>
> I can propose an alternative that I use. The API would be based on
> DOIs (rde-citation-add-entry-from-doi), which are not as convenient as
> URLs, but are honestly quite easy to find in any paper.

The upside of urls is that you can use it for non-paper activities, when
referencing videos or random internet articles.

> Managing the bibliography itself is not that complicated in this case, I
> used such a function:
>
> (defun refresh-gen-biblio ()
>       "Regenerates the generated gen.bib file based on the list in dois.txt."
>       (interactive)
>       (with-temp-file "/tmp/retrieved_dois.txt"
>                       (maphash
>                        (lambda (k v)
>                          (insert
>                           (concat (cdr (car v)) "\n")))
>                        (parsebib-parse "~/resources/gen.bib"
>                                        :fields '("doi"))))
>       (with-temp-buffer
>        (mapcar (lambda (x) (persid-insert-bibtex x))
>                (cl-set-exclusive-or
>                 (s-split "\n" (f-read "~/resources/dois.txt") t)
>                 (s-split "\n" (f-read "/tmp/retrieved_dois.txt") t)
>                 :test 'string-equal-ignore-case))
>        (append-to-file nil nil "~/resources/gen.bib")))
>
> I previously used biblio.el to fetch dois but I think persid will be
> better, though requires porting some code from doi.el to properly
> cleanup doi entries (~15 lines I guess, not too much).
>
> All in all, this can be :
> - persid : lightweight
> - a copy of biblio.el doi cleanup in RDE
> - a refresh-biblio function integrated with a
>   rde-citation-add-entry-from-doi function
>
> Regarding library files (pdfs...), I also have a solution (which I would
> like to migrate a bit too), but let's start with this first.
>
> On another note, I also have some work I did to be able to build the
> Zotero package in a Guix-compatible way in 68941 some time ago. This is
> far from finished but I guess was a first relevant way to start
> bootstrapping Node packages. IIRC, I had quite some patches above this
> one that went quite far, though I had not built zotero itself.

Unfortunatelly, I don't work with bibliographies at the moment, so I
trust your taste here.

-- 
Best regards,
Andrew Tropin
Reply to thread Export thread (mbox)