On Thursday, May 9, 2019 at 3:04:16 AM UTC+2, TonyM wrote:
...

> This sounds interesting can you please clarify. Are you saying, Such 
> "field" definitions would make the content in the field pragma become a 
> value of this "Virtual Field".
>

Not a "Virtual Field" a real field. The same as existing fields, but with 
the possibility to have line-breaks in the text. It would be the exact same 
behaviour as line-breaks in the text field. ... With some CSS magic, it 
would even display single line breaks. Which is already part of the core 
for plain text .. see: TW-Docs about hard linebreaks 
<https://tiddlywiki.com/#Hard%20Linebreaks%20with%20CSS%20-%20Example:%5B%5BHard%20Linebreaks%20with%20CSS%20-%20Example%5D%5D%20%5B%5BHard%20Linebreaks%20with%20CSS%5D%5D%20%5B%5BHow%20to%20apply%20custom%20styles%5D%5D>
.
 

> If I use edit-text I can name such fields and edit them as if they were 
> independent fields but I would only be editing part of the text field where 
> this definition resides?
>

That's right. If tiddler content is rendered, the \filed pragma will be 
"ignored". The tiddler-save action and several other widgets actions can 
modify the new fields. The core internal API may be the same, except of a 
new "multi-line" parameter for several widgets. 

With multi-line fields, it should also be possible to define field-types. 
eg: 

   - \field my-text-field(type:text) -> default
   - \field my-date-field(type:date) or
   - \field my-currency-field(type:currency) or
   - ... you name it. 
   
This behaviour has been discussed some time ago. It would give as a lot of 
new possibilities for "input-validation"
 

>
>    - If my above understanding is correct perhaps it would be misleading 
>    to call them fields, although they will behave as such. 
>
> I don't think so. They should exactly behave like fields, with some new 
functionality. 
 

>
>    - Perhaps they could be considered "sections" that are addressable 
>    like fields.
>
> For me a "section" is a term, that was used in TWclassic for 
"heading-sections". Sadly ... This function didn't make it to TW5 :/
 

>
>    - Will they be able to be made global, or defined in a tiddler tagged 
>    view template?
>
> They will be displaied with:

 - {{tiddlerName!!field-name}} .. Exactly the way you do it now. or 
 - {{!!fieldName}} if you want to work with currentTiddler
 

>
>    - Can we then display them conditionally?
>    
> Yes with the reveal-widget. Same as you do with fields now. 
 

> If this interpretation that they are like sections is correct then it 
> could allow code modularisation within a Tiddler, such that sections of 
> code are defined at the top and included below in a structured form.
>

As shown in the OP 

\field my-field       <-- Definition
Paragraph 1

Paragraph 2
\end

{{!!my-field}}        <-- Usage

This would be also easy to use with tables. eg: 

\field a1()
Multi Line text

Some more text
\end

| Cell | 1        | 2        |
| a    | {{!!a1}} | {{!!a2}} | 

The table will be simple copy paste action and the fields are convenient to 
be edited. ....

 

> Thanks for your innovative thinking
>

You are welcome!

In the future, it should be also possible to create a specialised 
EditTemplate, that works with a GUI for GUI type of users. ... But the 
first run could be text only mode, which should be much faster for 
experienced users.  

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 [email protected].
To post to this group, send email to [email protected].
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/cac88cae-2a2d-42d6-bc4b-864d1483b3b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to