~protesilaos/denote

13 4

Linking bibliographies with the Citar-Denote package

Details
Message ID
<87edtkls6y.fsf@prevos.net>
DKIM signature
pass
Download raw message
Dear fellow denoters,

With some help from Joel Lööw, the Citar-Denote package is now 
ready for testing; https://github.com/pprevos/citar-denote/

This package allows you to create and access bibliographic notes 
from within the Citar bibliography completion system.

The package is no were near perfect the caching needs optimising.

Question for the group: how can I rewrite the 
'citar-denote--create-note' function so that the note title can be 
edited before it is created (the title is extracted from the 
BibTeX entry).


Regards

P:)

-- 
Dr Peter Prevos
---------------
peterprevos.com
Details
Message ID
<86sfi0so1q.fsf@nobiot.com>
In-Reply-To
<87edtkls6y.fsf@prevos.net> (view parent)
DKIM signature
missing
Download raw message
Hi Peter

> The package is no were near perfect the caching needs optimising.
>
> Question for the group: how can I rewrite the 
> 'citar-denote--create-note' function so that the note title can be 
> edited before it is created (the title is extracted from the 
> BibTeX entry).

Quickly; not verified (I can look at it later, probably tomorrow, if it
does not work).

How about using

   '(read-minibuffer "Title?:" (citar-get-value "title" key))'

as the first argument in calling 'denote'?  You shoud get a prompt in
minibuffer with the string returned by 'citer-get-value' as the inital
value.

Cheers,
nobiot
Details
Message ID
<86tu2gbems.fsf@nobiot.com>
In-Reply-To
<86sfi0so1q.fsf@nobiot.com> (view parent)
DKIM signature
missing
Download raw message
Noboru Ota <me@nobiot.com> writes:

Hi Peter,

>    '(read-minibuffer "Title?:" (citar-get-value "title" key))'

This is not the correct function. 'read-string' should be the
one to use instead. Like this:

   '(read-string "Title?: " (citar-get-value "title" key))'

Aplogies.
nobiot
Details
Message ID
<877czckwhn.fsf@prevos.net>
In-Reply-To
<86tu2gbems.fsf@nobiot.com> (view parent)
DKIM signature
pass
Download raw message
Thanks Nobiot,

That worked a treat.

P:)


Noboru Ota <me@nobiot.com> writes:

> Noboru Ota <me@nobiot.com> writes:
>
> Hi Peter,
>
>>    '(read-minibuffer "Title?:" (citar-get-value "title" key))'
>
> This is not the correct function. 'read-string' should be the
> one to use instead. Like this:
>
>    '(read-string "Title?: " (citar-get-value "title" key))'
>
> Aplogies.
> nobiot
Details
Message ID
<874jufdluc.fsf@protesilaos.com>
In-Reply-To
<87edtkls6y.fsf@prevos.net> (view parent)
DKIM signature
pass
Download raw message
> From: Peter Prevos <peter@prevos.net>
> Date: Wed, 30 Nov 2022 20:07:04 +1100
>
> Dear fellow denoters,

Hello Peter,

> With some help from Joel Lööw, the Citar-Denote package is now 
> ready for testing; https://github.com/pprevos/citar-denote/
>
> This package allows you to create and access bibliographic notes 
> from within the Citar bibliography completion system.
>
> The package is no were near perfect the caching needs optimising.

I can't test it personally.  What do you think about mentioning
citar-denote in the Denote manual?

Either I can write a brief entry or you can provide one yourself.

No pressure though if you prefer to develop the package further before
deciding on this point.

All the best,
Prot

-- 
Protesilaos Stavrou
https://protesilaos.com
Details
Message ID
<87r0xic1z3.fsf@prevos.net>
In-Reply-To
<874jufdluc.fsf@protesilaos.com> (view parent)
DKIM signature
pass
Download raw message
Hi Prot,

Not quite to a point yet where I will announce to the world. It 
needs some performance tweaking.

Denote will be part of a major rewrite of my series of blog posts 
on using Emacs for content-creators: 
https://lucidmanager.org/tags/emacs/

I will certainly give you a paragraph or two for the Denote 
manual.

I am surprised that an intellectual like yourself does not manage 
a bibliography. Linking thoughts to articles and books is a great 
way to organise your thoughts.

regards

P:)

Protesilaos Stavrou <info@protesilaos.com> writes:

>> From: Peter Prevos <peter@prevos.net>
>> Date: Wed, 30 Nov 2022 20:07:04 +1100
>>
>> Dear fellow denoters,
>
> Hello Peter,
>
>> With some help from Joel Lööw, the Citar-Denote package is now 
>> ready for testing; https://github.com/pprevos/citar-denote/
>>
>> This package allows you to create and access bibliographic 
>> notes 
>> from within the Citar bibliography completion system.
>>
>> The package is no were near perfect the caching needs 
>> optimising.
>
> I can't test it personally.  What do you think about mentioning
> citar-denote in the Denote manual?
>
> Either I can write a brief entry or you can provide one 
> yourself.
>
> No pressure though if you prefer to develop the package further 
> before
> deciding on this point.
>
> All the best,
> Prot


-- 
Dr Peter Prevos
---------------
peterprevos.com
Details
Message ID
<87lenmmev5.fsf@protesilaos.com>
In-Reply-To
<87r0xic1z3.fsf@prevos.net> (view parent)
DKIM signature
pass
Download raw message
> From: Peter Prevos <peter@prevos.net>
> Date: Fri,  2 Dec 2022 07:13:40 +1100
>
> Hi Prot,

Hello Peter,

> Not quite to a point yet where I will announce to the world. It 
> needs some performance tweaking.

That's okay.  I am ready to do it whenever you want.

> Denote will be part of a major rewrite of my series of blog posts 
> on using Emacs for content-creators: 
> https://lucidmanager.org/tags/emacs/

Very well!

> I will certainly give you a paragraph or two for the Denote 
> manual.

Thank you!

> I am surprised that an intellectual like yourself does not manage 
> a bibliography. Linking thoughts to articles and books is a great 
> way to organise your thoughts.

You are right.  I was always intimidated by the sheer number of
tex-related packages.  I did not know where to start from and did not
have a good reason to spend time researching the technicalities...  So
here we are.

All the best,
Prot

-- 
Protesilaos Stavrou
https://protesilaos.com
Details
Message ID
<877cz69n8g.fsf@prevos.net>
In-Reply-To
<87lenmmev5.fsf@protesilaos.com> (view parent)
DKIM signature
pass
Download raw message
Hi Prott,

You don't have to use LaTeX to use BibTeX. I use a BibTeX file to 
link notes and attachments to literature.

That I can cite these in my published work is an added benefit. I 
use Org Mode to write books and export it to PDF.

In other words, you can use BibTeX without knowing anything about 
LaTeX.

Regards

P:)

Protesilaos Stavrou <info@protesilaos.com> writes:

>> From: Peter Prevos <peter@prevos.net>
>> Date: Fri,  2 Dec 2022 07:13:40 +1100
>>
>> Hi Prot,
>
> Hello Peter,
>
>> Not quite to a point yet where I will announce to the world. It 
>> needs some performance tweaking.
>
> That's okay.  I am ready to do it whenever you want.
>
>> Denote will be part of a major rewrite of my series of blog 
>> posts 
>> on using Emacs for content-creators: 
>> https://lucidmanager.org/tags/emacs/
>
> Very well!
>
>> I will certainly give you a paragraph or two for the Denote 
>> manual.
>
> Thank you!
>
>> I am surprised that an intellectual like yourself does not 
>> manage 
>> a bibliography. Linking thoughts to articles and books is a 
>> great 
>> way to organise your thoughts.
>
> You are right.  I was always intimidated by the sheer number of
> tex-related packages.  I did not know where to start from and 
> did not
> have a good reason to spend time researching the 
> technicalities...  So
> here we are.
>
> All the best,
> Prot


-- 
Dr Peter Prevos
---------------
peterprevos.com
Saša Janiška <sjaniska@atmarama.net>
Details
Message ID
<87bkof5vur.fsf@atmarama.net>
In-Reply-To
<87edtkls6y.fsf@prevos.net> (view parent)
DKIM signature
missing
Download raw message
Peter Prevos <peter@prevos.net> writes:

Hello Peter,

> With some help from Joel Lööw, the Citar-Denote package is now 
> ready
> for testing; https://github.com/pprevos/citar-denote/
>
> This package allows you to create and access bibliographic notes 
> from
> within the Citar bibliography completion system.

Thank you ver much for providing it!

I see in the README: "Please note that the Citar-Denote package 
only
works with Org Mode Denotes files." so I wonder if there is plan 
to
provide support Markdown files since, afaict, Citar does support 
them,
or should we consider to use Org-mode in Denote?


Sincerely,
Saša

-- 
Those who are on this path are resolute in purpose,
and their aim is one. O beloved child of the Kurus,
the intelligence of those who are irresolute is many-branched.
Details
Message ID
<86wn72528t.fsf@nobiot.com>
In-Reply-To
<87bkof5vur.fsf@atmarama.net> (view parent)
DKIM signature
missing
Download raw message
I hope this email finds itself back in the original thread.

Saša Janiška <sjaniska@atmarama.net> writes:

> I see in the README: "Please note that the Citar-Denote package only
> works with Org Mode Denotes files." so I wonder if there is plan to
> provide support Markdown files since, afaict, Citar does support them,
> or should we consider to use Org-mode in Denote?

Hi Saša,

Peter's code is crafted to allow for easy changes.  You can try this
one-line change -- diff in the body of the email below.  It is just to
change function 'citar-denote--create-note'.

If you make sure the following, Citar-Denote should work for your
markdown files (it did for me for my markdown-yaml):

1. Configure user option 'denote-file-type' to markdown ('markdown-yaml
   or 'markdown--toml)

2. Have a tag appear as part of the file name (Citar-Denote adds "bib"
   and it searches for "_bib" in file names)

One note:

A) When you create a note, Citar-Denote adds "#+reference:  <cite-key>"
   around line 10 of your markdown file.  Keep it as it is.  This is
   Citar-Denote searches for with a regexp.

Perhaps this something you could have a suggestion for change and
contribute to Peter's efforts (if he is happy to accept a PR)?

@@ -78,7 +78,7 @@

 (defun citar-denote--create-note (key &optional entry)
   "Create a bibliography note for `KEY' with properties `ENTRY'."
-  (let ((denote-file-type nil)) ; make sure it is Org
+  (let ((denote-file-type denote-file-type)) ; make sure it is Org
     (denote
      ;;(citar-get-value "title" key)
      (read-string "Title: " (citar-get-value "title" key))
Details
Message ID
<7e3f242bd9e39dc5a4c091f0b1623c49@prevos.net>
In-Reply-To
<86wn72528t.fsf@nobiot.com> (view parent)
DKIM signature
pass
Download raw message
Hi everybody,

Happy to make changes to accept .md and .txt.

The 'citar-denote--get-notes' function looks for all notes with the 
"_bib" keyword (irrespective of extension) and searches these for 
"#reference:" to extract the citation key.

Potentially that function can be updated to have a different method for 
each file type (Org Mode has a special function to extract keywords, 
perhaps the markdown package does this well).

I welcome any improvements through a GitHub pull request. My focus is on 
Org Mode.

P:)


---
Dr Peter Prevos
  ---------------
peterprevos.com

On 08-12-2022 08:32, Noboru Ota wrote:
> I hope this email finds itself back in the original thread.
> 
> Saša Janiška <sjaniska@atmarama.net> writes:
> 
>> I see in the README: "Please note that the Citar-Denote package only
>> works with Org Mode Denotes files." so I wonder if there is plan to
>> provide support Markdown files since, afaict, Citar does support them,
>> or should we consider to use Org-mode in Denote?
> 
> Hi Saša,
> 
> Peter's code is crafted to allow for easy changes.  You can try this
> one-line change -- diff in the body of the email below.  It is just to
> change function 'citar-denote--create-note'.
> 
> If you make sure the following, Citar-Denote should work for your
> markdown files (it did for me for my markdown-yaml):
> 
> 1. Configure user option 'denote-file-type' to markdown ('markdown-yaml
>    or 'markdown--toml)
> 
> 2. Have a tag appear as part of the file name (Citar-Denote adds "bib"
>    and it searches for "_bib" in file names)
> 
> One note:
> 
> A) When you create a note, Citar-Denote adds "#+reference:  <cite-key>"
>    around line 10 of your markdown file.  Keep it as it is.  This is
>    Citar-Denote searches for with a regexp.
> 
> Perhaps this something you could have a suggestion for change and
> contribute to Peter's efforts (if he is happy to accept a PR)?
> 
> @@ -78,7 +78,7 @@
> 
>  (defun citar-denote--create-note (key &optional entry)
>    "Create a bibliography note for `KEY' with properties `ENTRY'."
> -  (let ((denote-file-type nil)) ; make sure it is Org
> +  (let ((denote-file-type denote-file-type)) ; make sure it is Org
>      (denote
>       ;;(citar-get-value "title" key)
>       (read-string "Title: " (citar-get-value "title" key))
Details
Message ID
<878rjimkv5.fsf@prevos.net>
In-Reply-To
<86wn72528t.fsf@nobiot.com> (view parent)
DKIM signature
pass
Download raw message
Hi everybody,

I just committed the minor change to the function to create, as 
suggested by Noboru.

This minor change does not impact the code further.

To make it work properly with Markdown, we need to have functions 
to add either YAML or TOML versions of the citation reference.

Regards

P:)


Noboru Ota <me@nobiot.com> writes:

> I hope this email finds itself back in the original thread.
>
> Saša Janiška <sjaniska@atmarama.net> writes:
>
>> I see in the README: "Please note that the Citar-Denote package 
>> only
>> works with Org Mode Denotes files." so I wonder if there is 
>> plan to
>> provide support Markdown files since, afaict, Citar does 
>> support them,
>> or should we consider to use Org-mode in Denote?
>
> Hi Saša,
>
> Peter's code is crafted to allow for easy changes.  You can try 
> this
> one-line change -- diff in the body of the email below.  It is 
> just to
> change function 'citar-denote--create-note'.
>
> If you make sure the following, Citar-Denote should work for 
> your
> markdown files (it did for me for my markdown-yaml):
>
> 1. Configure user option 'denote-file-type' to markdown 
> ('markdown-yaml
>    or 'markdown--toml)
>
> 2. Have a tag appear as part of the file name (Citar-Denote adds 
> "bib"
>    and it searches for "_bib" in file names)
>
> One note:
>
> A) When you create a note, Citar-Denote adds "#+reference: 
> <cite-key>"
>    around line 10 of your markdown file.  Keep it as it is. 
>    This is
>    Citar-Denote searches for with a regexp.
>
> Perhaps this something you could have a suggestion for change 
> and
> contribute to Peter's efforts (if he is happy to accept a PR)?
>
> @@ -78,7 +78,7 @@
>
>  (defun citar-denote--create-note (key &optional entry)
>    "Create a bibliography note for `KEY' with properties 
>    `ENTRY'."
> -  (let ((denote-file-type nil)) ; make sure it is Org
> +  (let ((denote-file-type denote-file-type)) ; make sure it is 
> Org
>      (denote
>       ;;(citar-get-value "title" key)
>       (read-string "Title: " (citar-get-value "title" key))
Details
Message ID
<86h6y598gu.fsf@nobiot.com>
In-Reply-To
<878rjimkv5.fsf@prevos.net> (view parent)
DKIM signature
missing
Download raw message
Peter Prevos <peter@prevos.net> writes:

> Hi everybody,
>
> I just committed the minor change to the function to create, as
> suggested by Noboru.
>
> This minor change does not impact the code further.
>
> To make it work properly with Markdown, we need to have functions
> to add either YAML or TOML versions of the citation reference.

I have quickly coded something more generic -- for markdown (both
flavors) and text, and any others that users might add.  It's working on my
end for markdown-yaml.

I will try to package it up and send a PR soon to you, Peter -- need to
remember how I do it and a bit more testing, I guess.

I'd appreciate Saša could test it when PR is up.

Probably tomorrow or weekend, but potentially tonight...

Cheers,
nobiot
Details
Message ID
<86fsdp8qwd.fsf@nobiot.com>
In-Reply-To
<86h6y598gu.fsf@nobiot.com> (view parent)
DKIM signature
missing
Download raw message
FYI. PR sent to Peter's repo.
https://github.com/pprevos/citar-denote/pull/4

Happy to discuss further in the GitHub and/or here.

Thank you.
nobiot
Reply to thread Export thread (mbox)