# Re: [tw5] Re: IDEA Multi-line Fields ... Possible implementation

On Saturday, May 11, 2019 at 5:18:20 PM UTC+2, Jeremy Ruston wrote:
...

> If I understand the proposal correctly, the idea is that one could type
> multiline fields into the main textarea of a tiddler with the following
> syntax:
>
> \field my-field
> Paragraph 1
>
> Paragraph 2
> \end
>
>
Exactly.


> Then, when the user saves the tiddler, the content of the textarea is
> parsed, the field value(s) extracted and saved into the tiddler in the
> usual way. I’m assuming that the field pragma wouldn’t be replicated in the
> text field as well as the specified field?
>

I don't want to store the content 2 times. So the permanent storage would
be the text area. ... The wiki-store json format may only contain a
reference, where to find the content. ....

.tid file may look something like this

title: test-tiddler
tags: a b c d
my-field: @@@my-field

\field my-field(type:binary)
0
\end

or something similar. .. Hoping that nobody starts field content with 3 @ :)

If a tiddler is saved, the fields are parsed and stored into the internal
tiddler store. ...

The textarea as a permanent store is needed, since the field content needs
to survive a store-to-html / reload round-trip, which is the main problem
atm.

> Conversely, when initiating editing a tiddler, multiline fields are
> prepended to the text of the tiddler and placed in the textarea.
>

right

> If I’ve got that right, my first thought is that the idea of a process to
> convert a tiddler back and forth to a single textarea representation is
> interesting, and doesn’t present any particular issues if it’s just a UI
> thing.
>

I think, it's not an UI thing only, since multi line fields need to survive
the save/reload roundtrip with HTML and the .tid file format.

> Re-using the pragma syntax is confusing because this “parsing” is nothing
> to do with the main wikitext parser; perhaps it would be clearer to use an
> extended .tid file syntax.
>

code, that can read the existing \define ... pragma. ... So it will be easy
to create _new_ code the can parse the multi line definitions. ... No
reusing of the existing mechanism involved.

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