Hi Folks, 

Just reading an other thread in the group: Change initial field/textarea 
setup <https://groups.google.com/forum/#!topic/tiddlywiki/g4dHKMJOSSw>.    
I had an idea about multi line fields, which are requested here quite a 
bit. 

The default UI for inserting fields is a bit "heavy weight", if you have 
many of them. AND because of the concept, how fields are stored in the html 
file and the .tid file, it's not possible to use line breaks atm.

The idea now is, to use the text area for "multi-line" fields. This 
wouldn't change the .tid file spec, because those fields are part of the 
text area. 

We already know macro definition pragma <https://tiddlywiki.com/#Pragma> in 
tiddlers eg: 

\define test()
Paragraph 1

Paragraph 2
\end


<<test>>

A similar "pragma" could be used to define fields. eg: 

\field my-field
Paragraph 1

Paragraph 2
\end

{{!!my-field}}


The macro parser does exist already. So the filed parser should be very 
similar. ... 

PROS

 - This idea, wouldn't need to change the .tid file format, like other 
ideas discussed here. 
 - Database recorde-like tiddlers that contain many different fields, 
wouldn't need much UI witchery
   - They could be easily copy / pasted in text edit mode
 - If new "field-text" is added to old TWs, it will be recognized, as 
"plain text"
 - NO new edit-multiline-field widget needed, since the existing 
edit-widget should do it. 
   - We need to test this. 
 - If users want a form-like UI this is the same work as now. 

CONS

 - There is some overhead for \field start end \end
 - Since existing versions of TW don't ignore unknown pragmas, the new text 
format wouldn't be backwards compatible. 
   - but it wouldn't hurt too much (see pros above)
 - New .tid templates will be needed. 
   - may be fields-widget will need some extensions

-------- *A little bit more "specs"* ----------

1) field names must be lower-case (same a now)
2) Fields, that contain 1 line of text stay in the text area eg:

\field my-field 
1 line of text
\end

3) "1 liners" will be converted into fields when the tiddler is saved eg:
    - they go to the field input area of the edit-template
    (probably worth more discussion)

\field test-field 1 line of text

4) multi-line fields will always be transcluded in "block-mode" like

<$transclude tiddler=x field=y mode=block/> even if the shortcut is used: 
{{!!my-field}}

5) ... ???

just some thoughts

@Jeremy and others
What do you think?

have fun!
mario


-- 
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/c00b3194-23a9-4fa3-aa02-9a2f6aa1fb65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to