Drag and Drop and specified deserializer for string data

112 views
Skip to first unread message

Mohammad Rahmani

unread,
May 6, 2021, 2:39:17 AM5/6/21
to tiddl...@googlegroups.com
Recently Saq has extended the dropzone functionality to support specified deserializer for string data!
This gives huge flexibility for drag and drop contents.

One use case is to drop the bibtex entry copied from another site like Google Scholar!

e.g drag and drop the below text to create a bibtex entry!

@book{noauthor_numerical_2018,
	address = {New York, NY},
	title = {Numerical python},
	isbn = {9781484242452},
	publisher = {Springer Science+Business Media},
	year = {2018},
}
Note that, you need to have the specific deserializer, here the bibtex plugin!

I am thinking of other possibilities and invite all you to share ideas and comment.
I also kindly ask Saq to give us some examples!

One playground for online test can be 


Saq Imtiaz

unread,
May 6, 2021, 4:34:25 AM5/6/21
to TiddlyWiki
Wait wait, Mohammad you wanted this feature but I have to explain it? ;)

Until now, if you drag and drop or paste any text into TiddlyWiki, it treats it as plain text and offers to create a tiddler with that content. Now, if a deserializer has been specified for a dropzone, it is used to parse the text content and import it. Note however that once you specify a deserializer, that dropzone will only accept that content type.

We do still need better affordances for seeing the list of available deserializers in a wiki, the docs for Dropzone widget currently state:

> The list of available deserializers can be inspected by executing Object.keys($tw.Wiki.tiddlerDeserializerModules).sort().join("\n") in the browser JavaScript console.

This should probably be a filter operator, deserializers[].

With the Bibtex plugin installed the deserializer for bibtex format is application/x-bibtex

A use case would look something like having a special dropzone for pasting/dragging and dropping bibtex entries in plain text or in files and importing them. For the challenge of coming up with a good workflow and UX for this, I'll pass the ball back to Mohammad.

One of the things that would be nice to have in the future is to be able to specify a cascade of deserializers for a dropzone to use, so that you can use a single dropzone to import plain text from multiple formats. 

Cheers,
Saq







Mohammad Rahmani

unread,
May 6, 2021, 6:33:04 AM5/6/21
to tiddl...@googlegroups.com
Hi Saq!

Many thanks for all your efforts!

On Thu, May 6, 2021 at 1:04 PM Saq Imtiaz <saq.i...@gmail.com> wrote:

Wait wait, Mohammad you wanted this feature but I have to explain it? ;)

Ah, I think explaining this by you as an expert in the field is one hundred times better than what I explain! ;-)

 

Until now, if you drag and drop or paste any text into TiddlyWiki, it treats it as plain text and offers to create a tiddler with that content. Now, if a deserializer has been specified for a dropzone, it is used to parse the text content and import it. Note however that once you specify a deserializer, that dropzone will only accept that content type.

We do still need better affordances for seeing the list of available deserializers in a wiki, the docs for Dropzone widget currently state:

> The list of available deserializers can be inspected by executing Object.keys($tw.Wiki.tiddlerDeserializerModules).sort().join("\n") in the browser JavaScript console.

This should probably be a filter operator, deserializers[].

With the Bibtex plugin installed the deserializer for bibtex format is application/x-bibtex

A use case would look something like having a special dropzone for pasting/dragging and dropping bibtex entries in plain text or in files and importing them. For the challenge of coming up with a good workflow and UX for this, I'll pass the ball back to Mohammad.

Sure, I will add examples and demos in Refnotes and work on the UX. For students, researchers who like academic referencing, this feature is very useful and gives them flexibility to simply add bibliography data from many online sources like Google Scholar!



One of the things that would be nice to have in the future is to be able to specify a cascade of deserializers for a dropzone to use, so that you can use a single dropzone to import plain text from multiple formats. 

That is great! I am also thinking to have deserializers to create bookmarks from dropping url with some meta data!

Cheers,
Saq

Thank you again!







On Thursday, May 6, 2021 at 8:39:17 AM UTC+2 Mohammad wrote:
Recently Saq has extended the dropzone functionality to support specified deserializer for string data!
This gives huge flexibility for drag and drop contents.

One use case is to drop the bibtex entry copied from another site like Google Scholar!

e.g drag and drop the below text to create a bibtex entry!

@book{noauthor_numerical_2018,
	address = {New York, NY},
	title = {Numerical python},
	isbn = {9781484242452},
	publisher = {Springer Science+Business Media},
	year = {2018},
}
Note that, you need to have the specific deserializer, here the bibtex plugin!

I am thinking of other possibilities and invite all you to share ideas and comment.
I also kindly ask Saq to give us some examples!

One playground for online test can be 


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/31eb6e81-07e2-4e67-b29f-3af49a6d1c02n%40googlegroups.com.

Saq Imtiaz

unread,
May 6, 2021, 9:07:12 AM5/6/21
to TiddlyWiki
I have made a PR to add a deserializers[] filter operator, to make it easier to see which ones are available:

Mohammad Rahmani

unread,
May 6, 2021, 9:49:31 AM5/6/21
to tiddl...@googlegroups.com
On Thu, May 6, 2021 at 5:37 PM Saq Imtiaz <saq.i...@gmail.com> wrote:
I have made a PR to add a deserializers[] filter operator, to make it easier to see which ones are available:

Brilliant! I follow up there!

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

Odin

unread,
May 6, 2021, 10:41:16 AM5/6/21
to TiddlyWiki
Knipsel.JPG

"Sure, I will add examples and demos in Refnotes and work on the UX. For students, researchers who like academic referencing, this feature is very useful and gives them flexibility to simply add bibliography data from many online sources like Google Scholar!"

This is really great! It quickens the workflow as you don't have to save a BibTeX file before importing any more. Just highlight the text and drag 'n drop. To try it out, I made this little dropzone in a sidebar with an icon from TW-icons. Works perfect and is easy to find.
Op donderdag 6 mei 2021 om 15:49:31 UTC+2 schreef Mohammad:

Mohammad Rahmani

unread,
May 6, 2021, 6:25:44 PM5/6/21
to tiddl...@googlegroups.com
Hi Odin,
 Nice UX! I will start implementing the bibtex dropzone soon!



Reply all
Reply to author
Forward
0 new messages