Plugin: Extract Paragraphs

I've just released my first plugin version of my paragraph extractor. If you're like me you have a lot of varied notes in Joplin covering a number of topics. This plugin allows you to search across any selected notes for a particular topic word or hashtag that is contained within a note's paragraph and the extractor will copy all identified paragraphs from all those notes to a single new note. The original notes are not modified in any way.

For example, let's say I'm doing research on planetary atmospheres, I can search for a specific word like 'neptune' or 'mesosphere' and any paragraph in any note I've selected that contains the word will be added to a single new note. Or, another example is that I have a lot of work notes spanning statuses and projects. I could then use a project name as the keyword and extract/create a single new note of all paragraphs that have any mention of that project from status notes, goals notes, task notes, etc.

The repo is here: GitHub - djsudduth/joplin-plugin-paragraph-extractor: Extract specific paragraphs out of Joplin notes using keywords, hashtags or custom tags

Use

Simply highlight the notes you want to extract paragraphs from and choose "Extract paragraphs from notes"

In this example, the keyword is "hydrogen". Two of the four notes have that keyword within the note. Here is one of those two source notes:

When all four notes are selected to extract the paragraphs with that keyword, the new note looks like:

Features

  • Search and extract by single keyword or hashtag (prefix tags supported #, $, %)
  • Any keyword used is added to the new note's Joplin tags along with any tags used in the source notes
  • Option to extract the paragraph H1-H6 headers along with the paragraph
  • Option to extract from bulleted lists only the bullet that has the keyword
  • Add a title link back to the original note that the paragraph was extracted from
  • Option to append a hashtag to the new note
  • Give the new extraction note a custom title

I hope everyone really finds it useful and please suggest any features you feel would add to your use cases!

4 Likes

Here are some feature suggestions:

  • Search and extract by phrase
  • Search and extract from a specific notebook
  • Option to toggle adding keyword as tag to new note (unless it already exists)
  • Option to show dialog to enter keyword or hashtag and modify custom note title on right-click or keyboard shortcut by default (I didn't expect setting keyword or hashtag in plugin settings)
  • Option to use content blocks like the Note Overview plugin does to define, organize, and auto-update new note content
2 Likes

Thanks for the suggestions, @muzak !

  • Search and extract by phrase - this does work now but I haven't tested it extensively

  • Search and extract from a specific notebook - great idea, I'll look into that

  • Option to toggle adding keyword as tag to new note (unless it already exists) - there is no toggle yet for that option - the tag is added in all cases, but I'll add it in the next version (this will be good to tie to extract by phrase since phrases shouldn't be tags in most cases)

  • Option to show dialog to enter keyword or hashtag and modify custom note title on right-click or keyboard shortcut by default (I didn't expect setting keyword or hashtag in plugin settings) - that is something already in the backlog for the next version

  • Option to use content blocks like the Note Overview plugin does to define, organize, and auto-update new note content - I'm not familiar with that - I'll take a look

PS - I want to thank @JackGruber for the inspiration!

1 Like

very nice @djsudduth !

I think that Joplin deserves more paragraph-level information extraction, and this is a step in the right direction.

in fact, this is similar in some ways to something that I started working on recently. let's see if it's still worth developing a slightly different variation on the same theme.

2 Likes

Paragraph Extractor has been updated to version 1.1.1

New additions:

  • A dialog box has been added to allow setting the keyword and tag to use as the paragraph extraction search. The keyword and tag are then saved as default values
  • You can now just select a notebook and use a toggle to extract paragraphs from all the notes within that specific notebook (right click on either a notebook or just a note within the notebook allows selecting all notes)
  • Keyword phrases are now supported as well

Paragraph Extractor has been updated to version 1.1.2

New additions:

  • Note paragraph blocks can now be extracted to a note with the Joplin tag title that matched either the hashtag or the keyword - similar to Logseq linked block references in tag notes
  • The extraction dialog box was modified to be more clear