Re: [tw] Parsing a tiddler containing structured data

2016-10-18 Thread Steven Schneider
Ask and you shall receive! The TiddlyWiki gods have been kind to me this 
week! Based on Jeremy's BibTex importer plugin (available in pre-release 
), I'm now able to do, well, almost 
everything I imagined with respect to bibliography management using bibtex 
and importing into tiddlywiki.

Have a look:  https://stevesunypoly.updog.co/bibtex/bibliography3.html

More work to be done, but this is huge . 

(duplicate of biblio thread).

On Tuesday, October 18, 2016 at 2:11:22 PM UTC-4, Jeremy Ruston wrote:
>
> Hi Steve
>
> Thanks, Jeremy. Yes, works perfectly! You've made my day!! I'll get to 
> work on macros, that I can handle. A deserializer is way beyond my skills 
> (and only vaguely within my comprehension.
>
>
> Great, I hope it does the trick.
>
> A deserialiser, by the way, is a JS module that extracts tiddlers from a 
> block of text. The same deserialisers are used in the browser during the 
> import process, and under Node.js by the --load command.
>
> This will help me and others who need bibliographic management within 
> TiddlyWiki, and allow us to move TW forward as a serious academic tool, 
> including being able to write (and publish) journal articles, books, etc. 
>
> 40 minutes! It took me 3 days to figure out that I should import a .bib 
> file directly :). Again, thanks, and I'll get on with testing the 
> pre-release version ...
>
>
> I think there's a bit more work needed. The field conversion done at the 
> moment doesn't make any attempt to extract tags, for instance.
>
> When you've had a chance to play around it would be helpful if you could 
> map out a more useful mapping, and we'll figure out a way to configure the 
> conversion process.
>
> Best wishes
>
> Jeremy
>
>
> //steve.
>
> On Tuesday, October 18, 2016 at 1:09:51 PM UTC-4, Jeremy Ruston wrote:
>>
>> Hi Steve
>>
>> > Ideally, TW should read the .bib file directly, of course. But, one 
>> step at a time...
>>
>> OK, I’ve bowed to the inevitable and spent 40 minutes whipping up a basic 
>> BibTeX importer plugin, based on a JavaScript BibTeX parser that I found.
>>
>> You can try it out at:
>>
>> http://tiddlywiki.com/prerelease#%24%3A%2Fplugins%2Ftiddlywiki%2Fbibtex 
>> 
>>
>> I found that your .bib file at 
>> https://stevesunypoly.updog.co/bibtex/first-jabref-bibtex-db.bib gives 
>> an error unless I remove the final line:
>>
>> @Comment{jabref-meta: databaseType:bibtex;}
>>
>> I’ve only done the most basic field conversion:
>>
>> * title comes from citationKey
>> * bibtex-entry-type comes from entryType
>> * all entryTags are assigned to fields with the prefix “bibtex-“
>>
>> Let me know how you get on,
>>
>> Best wishes
>>
>> Jeremy
>>
>>
>> On 18 Oct 2016, at 17:13, Steven Schneider  wrote:
>>
>> As part of my bibliography project (see previous thread, 
>> https://groups.google.com/forum/#!topic/tiddlywiki/ZKiviPin72c) it 
>> occurs to me that I could import a structured file (a bib file) as a 
>> tiddler, and write macros that search for / extract records from that 
>> tiddler. Is something like that even possible?
>>
>> Here, for example, is what a bib file with two entries might look like
>> @InProceedings{Dalgaard2001,
>>   author = {Dalgaard, Rune},
>>   title  = {Hypertext and the Scholarly Archive: Intertexts, 
>> Paratexts and Metatexts at Work},
>>   url= {http://doi.acm.org/10.1145/504216.504262},
>>   urldate= {2016-10-17},
>> }
>>
>> @Article{Rowan2016,
>>   author = {Rowan, Kyle Edward},
>>   title  = {Not Quite a Sunset: a hypertext opera},
>>   date   = {2016},
>>   shorttitle = {Not Quite a Sunset},
>>   url= {http://escholarship.org/uc/item/9830g5pn.pdf},
>>   urldate= {2016-10-17},
>> }
>>
>>
>> How could I write macros that would allow me to transclude fields/values 
>> from this tiddler, for example:
>>
>> {{Rowan2016!!url}} to return http://escholarship.org/uc/item/9830g5pn.pdf
>>
>> {{Rowan2016!!type}} to return @Article (this would be necessary to 
>> generate custom templates based on type)
>>
>> etc.
>>
>>
>> I am still interested in parsing this file into separate tiddlers (one 
>> for each @), but the approach outlined above might be easier for me to 
>> handle.
>>
>> Thanks,
>>
>> //steve.
>>
>> -- 
>> 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 post to this group, send email to tiddl...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/tiddlywiki.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/tiddlywiki/830c0d47-36df-4535-b137-54e93a845c5a%40googlegroups.com
>>  
>> 

Re: [tw] Parsing a tiddler containing structured data

2016-10-18 Thread Jeremy Ruston
Hi Steve

> Thanks, Jeremy. Yes, works perfectly! You've made my day!! I'll get to work 
> on macros, that I can handle. A deserializer is way beyond my skills (and 
> only vaguely within my comprehension.

Great, I hope it does the trick.

A deserialiser, by the way, is a JS module that extracts tiddlers from a block 
of text. The same deserialisers are used in the browser during the import 
process, and under Node.js by the --load command.

> This will help me and others who need bibliographic management within 
> TiddlyWiki, and allow us to move TW forward as a serious academic tool, 
> including being able to write (and publish) journal articles, books, etc. 
> 
> 40 minutes! It took me 3 days to figure out that I should import a .bib file 
> directly :). Again, thanks, and I'll get on with testing the pre-release 
> version ...

I think there's a bit more work needed. The field conversion done at the moment 
doesn't make any attempt to extract tags, for instance.

When you've had a chance to play around it would be helpful if you could map 
out a more useful mapping, and we'll figure out a way to configure the 
conversion process.

Best wishes

Jeremy

> 
> //steve.
> 
>> On Tuesday, October 18, 2016 at 1:09:51 PM UTC-4, Jeremy Ruston wrote:
>> Hi Steve
>> 
>> > Ideally, TW should read the .bib file directly, of course. But, one step 
>> > at a time...
>> 
>> OK, I’ve bowed to the inevitable and spent 40 minutes whipping up a basic 
>> BibTeX importer plugin, based on a JavaScript BibTeX parser that I found.
>> 
>> You can try it out at:
>> 
>> http://tiddlywiki.com/prerelease#%24%3A%2Fplugins%2Ftiddlywiki%2Fbibtex
>> 
>> I found that your .bib file at 
>> https://stevesunypoly.updog.co/bibtex/first-jabref-bibtex-db.bib gives an 
>> error unless I remove the final line:
>> 
>> @Comment{jabref-meta: databaseType:bibtex;}
>> 
>> I’ve only done the most basic field conversion:
>> 
>> * title comes from citationKey
>> * bibtex-entry-type comes from entryType
>> * all entryTags are assigned to fields with the prefix “bibtex-“
>> 
>> Let me know how you get on,
>> 
>> Best wishes
>> 
>> Jeremy
>> 
>> 
>>> On 18 Oct 2016, at 17:13, Steven Schneider  wrote:
>>> 
>>> As part of my bibliography project (see previous thread, 
>>> https://groups.google.com/forum/#!topic/tiddlywiki/ZKiviPin72c) it occurs 
>>> to me that I could import a structured file (a bib file) as a tiddler, and 
>>> write macros that search for / extract records from that tiddler. Is 
>>> something like that even possible?
>>> 
>>> Here, for example, is what a bib file with two entries might look like
>>> @InProceedings{Dalgaard2001,
>>>   author = {Dalgaard, Rune},
>>>   title  = {Hypertext and the Scholarly Archive: Intertexts, Paratexts 
>>> and Metatexts at Work},
>>>   url= {http://doi.acm.org/10.1145/504216.504262},
>>>   urldate= {2016-10-17},
>>> }
>>> 
>>> @Article{Rowan2016,
>>>   author = {Rowan, Kyle Edward},
>>>   title  = {Not Quite a Sunset: a hypertext opera},
>>>   date   = {2016},
>>>   shorttitle = {Not Quite a Sunset},
>>>   url= {http://escholarship.org/uc/item/9830g5pn.pdf},
>>>   urldate= {2016-10-17},
>>> }
>>> 
>>> 
>>> How could I write macros that would allow me to transclude fields/values 
>>> from this tiddler, for example:
>>> 
>>> {{Rowan2016!!url}} to return http://escholarship.org/uc/item/9830g5pn.pdf
>>> 
>>> {{Rowan2016!!type}} to return @Article (this would be necessary to generate 
>>> custom templates based on type)
>>> 
>>> etc.
>>> 
>>> 
>>> I am still interested in parsing this file into separate tiddlers (one for 
>>> each @), but the approach outlined above might be easier for me to handle.
>>> 
>>> Thanks,
>>> 
>>> //steve.
>>> 
>>> -- 
>>> 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 post to this group, send email to tiddl...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/tiddlywiki.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/tiddlywiki/830c0d47-36df-4535-b137-54e93a845c5a%40googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>> 
> 
> -- 
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywiki@googlegroups.com.
> Visit this group at https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/2c3ee137-6b37-4e5d-80e4-1932002ef942%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed 

Re: [tw] Parsing a tiddler containing structured data

2016-10-18 Thread Steven Schneider
Thanks, Jeremy. Yes, works perfectly! You've made my day!! I'll get to work 
on macros, that I can handle. A deserializer is way beyond my skills (and 
only vaguely within my comprehension.

This will help me and others who need bibliographic management within 
TiddlyWiki, and allow us to move TW forward as a serious academic tool, 
including being able to write (and publish) journal articles, books, etc. 

40 minutes! It took me 3 days to figure out that I should import a .bib 
file directly :). Again, thanks, and I'll get on with testing the 
pre-release version ...

//steve.

On Tuesday, October 18, 2016 at 1:09:51 PM UTC-4, Jeremy Ruston wrote:
>
> Hi Steve
>
> > Ideally, TW should read the .bib file directly, of course. But, one step 
> at a time...
>
> OK, I’ve bowed to the inevitable and spent 40 minutes whipping up a basic 
> BibTeX importer plugin, based on a JavaScript BibTeX parser that I found.
>
> You can try it out at:
>
> http://tiddlywiki.com/prerelease#%24%3A%2Fplugins%2Ftiddlywiki%2Fbibtex 
> 
>
> I found that your .bib file at 
> https://stevesunypoly.updog.co/bibtex/first-jabref-bibtex-db.bib gives an 
> error unless I remove the final line:
>
> @Comment{jabref-meta: databaseType:bibtex;}
>
> I’ve only done the most basic field conversion:
>
> * title comes from citationKey
> * bibtex-entry-type comes from entryType
> * all entryTags are assigned to fields with the prefix “bibtex-“
>
> Let me know how you get on,
>
> Best wishes
>
> Jeremy
>
>
> On 18 Oct 2016, at 17:13, Steven Schneider  
> wrote:
>
> As part of my bibliography project (see previous thread, 
> https://groups.google.com/forum/#!topic/tiddlywiki/ZKiviPin72c) it occurs 
> to me that I could import a structured file (a bib file) as a tiddler, and 
> write macros that search for / extract records from that tiddler. Is 
> something like that even possible?
>
> Here, for example, is what a bib file with two entries might look like
> @InProceedings{Dalgaard2001,
>   author = {Dalgaard, Rune},
>   title  = {Hypertext and the Scholarly Archive: Intertexts, Paratexts 
> and Metatexts at Work},
>   url= {http://doi.acm.org/10.1145/504216.504262},
>   urldate= {2016-10-17},
> }
>
> @Article{Rowan2016,
>   author = {Rowan, Kyle Edward},
>   title  = {Not Quite a Sunset: a hypertext opera},
>   date   = {2016},
>   shorttitle = {Not Quite a Sunset},
>   url= {http://escholarship.org/uc/item/9830g5pn.pdf},
>   urldate= {2016-10-17},
> }
>
>
> How could I write macros that would allow me to transclude fields/values 
> from this tiddler, for example:
>
> {{Rowan2016!!url}} to return http://escholarship.org/uc/item/9830g5pn.pdf
>
> {{Rowan2016!!type}} to return @Article (this would be necessary to 
> generate custom templates based on type)
>
> etc.
>
>
> I am still interested in parsing this file into separate tiddlers (one for 
> each @), but the approach outlined above might be easier for me to handle.
>
> Thanks,
>
> //steve.
>
> -- 
> 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 post to this group, send email to tiddl...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/830c0d47-36df-4535-b137-54e93a845c5a%40googlegroups.com
>  
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/2c3ee137-6b37-4e5d-80e4-1932002ef942%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Parsing a tiddler containing structured data

2016-10-18 Thread Jeremy Ruston
Hi Steve

> Ideally, TW should read the .bib file directly, of course. But, one step at a 
> time...

OK, I’ve bowed to the inevitable and spent 40 minutes whipping up a basic 
BibTeX importer plugin, based on a JavaScript BibTeX parser that I found.

You can try it out at:

http://tiddlywiki.com/prerelease#%24%3A%2Fplugins%2Ftiddlywiki%2Fbibtex 


I found that your .bib file at 
https://stevesunypoly.updog.co/bibtex/first-jabref-bibtex-db.bib 
 gives an 
error unless I remove the final line:

@Comment{jabref-meta: databaseType:bibtex;}

I’ve only done the most basic field conversion:

* title comes from citationKey
* bibtex-entry-type comes from entryType
* all entryTags are assigned to fields with the prefix “bibtex-“

Let me know how you get on,

Best wishes

Jeremy


> On 18 Oct 2016, at 17:13, Steven Schneider  wrote:
> 
> As part of my bibliography project (see previous thread, 
> https://groups.google.com/forum/#!topic/tiddlywiki/ZKiviPin72c 
> ) it occurs 
> to me that I could import a structured file (a bib file) as a tiddler, and 
> write macros that search for / extract records from that tiddler. Is 
> something like that even possible?
> 
> Here, for example, is what a bib file with two entries might look like
> @InProceedings{Dalgaard2001,
>   author = {Dalgaard, Rune},
>   title  = {Hypertext and the Scholarly Archive: Intertexts, Paratexts 
> and Metatexts at Work},
>   url= {http://doi.acm.org/10.1145/504216.504262},
>   urldate= {2016-10-17},
> }
> 
> @Article{Rowan2016,
>   author = {Rowan, Kyle Edward},
>   title  = {Not Quite a Sunset: a hypertext opera},
>   date   = {2016},
>   shorttitle = {Not Quite a Sunset},
>   url= {http://escholarship.org/uc/item/9830g5pn.pdf},
>   urldate= {2016-10-17},
> }
> 
> 
> How could I write macros that would allow me to transclude fields/values from 
> this tiddler, for example:
> 
> {{Rowan2016!!url}} to return http://escholarship.org/uc/item/9830g5pn.pdf
> 
> {{Rowan2016!!type}} to return @Article (this would be necessary to generate 
> custom templates based on type)
> 
> etc.
> 
> 
> I am still interested in parsing this file into separate tiddlers (one for 
> each @), but the approach outlined above might be easier for me to handle.
> 
> Thanks,
> 
> //steve.
> 
> -- 
> 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+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to tiddlywiki@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/tiddlywiki 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/830c0d47-36df-4535-b137-54e93a845c5a%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0E661637-FA22-488C-908A-A71FF47EF503%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Parsing a tiddler containing structured data

2016-10-18 Thread Steven Schneider
As part of my bibliography project (see previous thread, 
https://groups.google.com/forum/#!topic/tiddlywiki/ZKiviPin72c) it occurs 
to me that I could import a structured file (a bib file) as a tiddler, and 
write macros that search for / extract records from that tiddler. Is 
something like that even possible?

Here, for example, is what a bib file with two entries might look like
@InProceedings{Dalgaard2001,
  author = {Dalgaard, Rune},
  title  = {Hypertext and the Scholarly Archive: Intertexts, Paratexts 
and Metatexts at Work},
  url= {http://doi.acm.org/10.1145/504216.504262},
  urldate= {2016-10-17},
}

@Article{Rowan2016,
  author = {Rowan, Kyle Edward},
  title  = {Not Quite a Sunset: a hypertext opera},
  date   = {2016},
  shorttitle = {Not Quite a Sunset},
  url= {http://escholarship.org/uc/item/9830g5pn.pdf},
  urldate= {2016-10-17},
}


How could I write macros that would allow me to transclude fields/values 
from this tiddler, for example:

{{Rowan2016!!url}} to return http://escholarship.org/uc/item/9830g5pn.pdf

{{Rowan2016!!type}} to return @Article (this would be necessary to generate 
custom templates based on type)

etc.


I am still interested in parsing this file into separate tiddlers (one for 
each @), but the approach outlined above might be easier for me to handle.

Thanks,

//steve.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/830c0d47-36df-4535-b137-54e93a845c5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.