Hello all,
I am proposing code to answer issue 336 
(https://github.com/Jermolene/TiddlyWiki5/issues/336) to support creating 
journal tiddlers with automatically generated titles.  

I am very new.  I'm not "down" with the culture in this dev community, so I 
welcome any advice that would help the cause.

See the new commits at 
https://github.com/PhilipColtharp/TiddlyWiki5/tree/patch-1

Sincerely Grateful,
Philip Coltharp
------------------------------

WidgetMessage: tm-new-journal-tiddler

Messages navigator-message

The new journal tiddler message is similar to the new tiddler message 
<file:///C:/Users/Jason/Downloads/9d46d622-3abf-41c8-93da-a4e52c54b519.htm#WidgetMessage%3A%20tm-new-tiddler>.
 
It...

   1. creates a new draft tiddler
   2. adds the new tiddler to the current story
   3. uses a required reference to a given tiddler as a template for the 
   new tiddler, coping tags, fields, title and text from the template to the 
   new tiddler
   4. uses a field, named "title_template", if it exists in the template, 
   to create a title. Date and time codes are allowed in this field for which 
   date and time information is filled in based on the current date and time 
   of of the tiddler's creation.

This message takes the following properties by the event object:
NameDescriptionparamTitle of a tiddler to use as a template for the new 
tiddler. Unlike new tiddler message 
<file:///C:/Users/Jason/Downloads/9d46d622-3abf-41c8-93da-a4e52c54b519.htm#WidgetMessages%3A%20tm-new-tiddler>,
 
this is required.navigateFromTitleTitle of the tiddler from which the 
navigation to the new tiddler was initiated. Not required.
   
   - The reference to the tiddler template given in the event object 
   property param must reference an existing tiddler or else the event does 
   nothing.
   - The field "title_template" is not required to be a field in the 
   template tiddler. If it exists the value will be parsed and it becomes the 
   title. If not, the event defaults to the behavior of a new tiddler 
   message 
   
<file:///C:/Users/Jason/Downloads/9d46d622-3abf-41c8-93da-a4e52c54b519.htm#WidgetMessage%3A%20tm-new-tiddler>
   .
   - The field "title_template" is not copied to the new tiddler.
   - Similar to new tiddler messages 
   
<file:///C:/Users/Jason/Downloads/9d46d622-3abf-41c8-93da-a4e52c54b519.htm#WidgetMessage%3A%20tm-new-tiddler>,
 
   the new journal tiddler message can be generated with the LinkWidget 
   
<file:///C:/Users/Jason/Downloads/9d46d622-3abf-41c8-93da-a4e52c54b519.htm#LinkWidget>
 or 
   theButtonWidget 
   
<file:///C:/Users/Jason/Downloads/9d46d622-3abf-41c8-93da-a4e52c54b519.htm#ButtonWidget>
   .
   - The new journal tiddler message is handled by the NavigatorWidget 
   
<file:///C:/Users/Jason/Downloads/9d46d622-3abf-41c8-93da-a4e52c54b519.htm#NavigatorWidget>
   .
   - The date and time codes work similarly to that of Classic Tiddlywiki 
   
<file:///C:/Users/Jason/Downloads/9d46d622-3abf-41c8-93da-a4e52c54b519.htm#TiddlyWikiClassic>.
 
   A guide to use these codes is in the Classic Tiddlywiki documentation 
   <http://tiddlywiki.tiddlyspace.com/> under the tiddler DateFormats 
   <http://tiddlywiki.tiddlyspace.com/#DateFormats>.

Example

To make a button that creates a new journal tiddler, tagged "journal", and 
with the title "Journal 10/4/2014 07:00", first create a separate tiddler 
called "JournalTemplate" with the tag "journal" and also a field, named 
"title_template", with the value "Journal MM/DD/YYYY hh:0mm". Secondly, in 
any other tiddler, use codes like the following to make a button to call a 
new instance of the journal tiddler:

<$button message="tm-new-journal-tiddler" param="JournalTemplate">New 
Journal</$button>


-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to