Re: [mlview-list]Text wrapping, text editing features, etc. in mlview



Hello all,

Le mar 20/01/2004 à 23:24, Nicolas Centa a écrit :
> Hello,
> 
> Here are some questions / suggestions I wanted to express to know more
> precisely what needs to be done with text wrapping in mlview.
> 
> A question that can be asked, is if every editing widget must cut lines
> at the same place, or if they can cut lines to fit their size. If so,
> the line size specified by the user would be only used for serialization
> (so the user can say "my text node's lines must not exceed 25 char"
> etc.) ; but the editing widgets would be more usable (no useless
> scrollbars whatever the real line width is, etc.).

I think that the editing widget should cut lines to fit its size, the
propoerties suggested by dodji beeing applied only on serialisation.
I don't know if libxml2 allows to set such properties for the
serialisation, if not we then should process the text leaves before
saving the doc in order to replace some space chars with line feeds.

> I think the most important question is the "verbatim mode" : if we wrap
> everything which is edited in "wrap mode", then what to do with nodes
> written in "verbatim mode" if the user tries to edit them in "wrap mode"
> ? Should we wrap them completely, do not wrap on nodes which aren't
> wrapped, wrap what the user modifies ... 

I think there is a difference between wrapping text (it goes to the next
line when it reache a certain limit - which can be the side of the
widget or a user defined value - see above) and and explicit wrap which
is the insertion of a line break in the text by the user. IMHO in the
first case we do not have to go to line in the markup flow, as it just a
presentation issue, in the latter, the editor behavior is constrained by
the presence or not of the xml:space="preserve" attribute value on the
text node (or one of its ancestor), if this attribute is present we
should not reformat the text and save it asit was entered by the user,
if it is not, we are free to reformat the text before the serialization,
reduces sequences of (blank, tab, LF) into a single space, insert line
feeds in order to cut lines after a certain line length, etc.    
> 
> The "verbatim mode" is on a node-by-node basis : the user wants to edit
> some nodes in "verbatim mode", and some others in "wrap mode" (if he
> doesn't there's no problem : he simply disables the mode he does not
> want). So maybe we can use the XML Recommandation (section 2.10) : to
> put automatically in "verbatim mode" nodes which have a xml:space
> attribute set to "preserve". (And then maybe we can apply the "wrap
> everything" method in wrap mode without any inconvenient.)
> 
I think we mix there two concepts : 
1 - a presentation issue wich is : shall the text be wrapped when it
reaches the limit of a widget or do an horiz scrollbar have to appear ?
2 - a serilization issue which is : does mlview have to reformat the
text leaves when a doc is saved. 

I also think we have to well separate both functions in mlview.
Futhermore, the first issue can be issued widget by wiget, Let's imagine
I'm editing a document with mixed litteral text (such as paragraphs) and
code or ascii art figures, I may want to see my paragraphs wrapped as I
input text, but my code or figures. 

My proposition would be the next :
1 - Create a button assiciated to the text input widget (the topright of
the widget could be a great location) that switch between wrapped mode
and scroll mode. This doesn't affect in any way neither the content of
the text node, nor the way text leaves are serialized when saving the
doc.

2 - have some serialisation options :

  - cut lines (on/off)
     (if on)  max line length
  - normalize white chars (on/off) : reduces any sequence of
space,tab,line feed in a single space (or LF if the line has to be
cutted)
   
 These option should not be taken into account when a
xml:space="preserve" is present on one of the ancestor node of the text
leaf.

IMHO this would be the clearer and simpliest way to provide the maximum
of flexibility to the used whitout confusing her in some complicated
options.

My 2 cent of euro

> My 2 cents,
> 
> Nicolas Centa
> 
> _______________________________________________
> Mlview-list mailing list
> Mlview-list gnome org
> http://mail.gnome.org/mailman/listinfo/mlview-list
-- 
    Stéphane Bonhomme - Formations, Conseil et Réalisations
 Ingénierie Documentaire - Technologies Web - Logiciels Libres
   s bonhomme wanadoo fr - http://perso.wanadoo.fr/s.bonhomme
              04 76 17 09 40 / 06 88 57 27 08





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]