Re: [web2py] Re: Two questions: one about markmin and one about SQLFORM

2011-05-17 Thread Martín Mulone
   1. Paragraphs were invented for a reason. Try modifying paragraph margins
   using CSS without using paragraph tags and you see what we mean.
   2. The IE WYSIWYG environment is built on handling paragraphs when it
   comes to alignment/list management and much more. TinyMCE and other editors
   will start producing lots of strange results if you enable
   
force_br_newlines
   .
   3. The space between the paragraphs can be removed using a simple CSS
   trick like this. p {margin:0; padding: 0;}. This is not possible with BR
   elements, since the whole line is not wrapped in a container. So P elements
   gives you the flexibility to choose.
   4. If you really must have BR instead of paragraph elements for some
   reason – for example to interface with Flash or send e-mail messages –, then
   simply post process them away by replacing  with
   , which takes care of P tags with class or style attributes.
   The same process but from BR tags to P tags can not be done since you don't
   have a reference for the start element.
   5. Paragraphs make more semantically correct XHTML markup, and we are
   trying to make an XHTML editor, not an old HTML editor.
   6. Paragraphs are mostly more valid containers for text in a W3C strict
   environment since plain text nodes are not allowed in all containers.
   7. BR elements can still be produced if you really need one at a specific
   place for some reason using Shift+Enter/Return this is exactly the same
   behavior popular Word processors have. Check this
video
   .
   8. We have never seen one single valid reason why paragraphs must not be
   used unless it's for e-mail software or for integration with Flash, and both
   cases can and should be solved with post processing if you want the user to
   be able to modify the contents again with TinyMCE. If you have a good reason
   please drop us a e-mail describing it and I will put it on my exceptions
   list.


Copy - paste from web.
http://tinymce.moxiecode.com/wiki.php/TinyMCE_FAQ#TinyMCE_produce_P_elements_on_enter.2Freturn_instead_of_BR_elements.3F

http://stackoverflow.com/questions/1103594/p-instead-of-br

but, Perhaps double space can be transformed in  

2011/5/17 JayShaffstall 

> On May 16, 4:30 pm, Massimo Di Pierro 
> wrote:
> > form=SQLFORM(...)
> > form.element('textarea')['_rows'] = random.randint(10,20)
>
> This works, in that the attributes are passed through to the HTML
> page.
>
> It doesn't work, in that the cols attribute seems to be ignored.  When
> I change rows, the number of rows changed in the HTML does change.
> When I change cols, it still displays the default number of columns.
>
> Here's the code I'm using in the controller:
>
>form.element('textarea')['_rows']=30
>form.element('textarea')['_cols']=80
>
> That generates the following HTML:
>
> name="description" rows="30">
>
> 30 rows display, but the columns are still the default.
>
> Where could the number of columns for the text area be getting
> overriden?
>
>


-- 
 http://martin.tecnodoc.com.ar


Re: [web2py] Re: Two questions: one about markmin and one about SQLFORM

2011-05-17 Thread Martín Mulone
There are a minor issue with markmin in welcome, when you mix order list and
paragraph, there are no separation because the css definition:

p, blockquote {
margin-bottom: 10px;
}

I use:

p, blockquote, ul, ol, code, table {
margin-top: 15px;
margin-bottom: 15px;
}

2011/5/17 Tom Atkins 

> OK - agreed.
>
>
> On 17 May 2011 14:21, Massimo Di Pierro wrote:
>
>> Why? I think using whitespaces in wiki syntax is bad because they are
>> invisible.
>>
>> On May 17, 1:34 am, Tom Atkins  wrote:
>> > Two spaces at the end of a line makes a new line in Markdown... would it
>> be
>> > possible to have the same behavior in Markmin?
>> >
>> > On 17 May 2011 04:09, Bruno Rocha  wrote:
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > > On Mon, May 16, 2011 at 11:34 PM, JayShaffstall <
>> jshaffst...@gmail.com>wrote:
>> >
>> > >> Just enough of rain
>> > >> To bring the smell of silk
>> > >> From umbrellas
>> >
>> > > You can do that in this way:
>> >
>> > > --- Create a custom markmin dictionary ---
>> >
>> > > customtags = dict(
>> > >  br=lambda n:''*int(n),
>> >
>> > >  template=lambda code:gluon.template.render(code,context=globals()),
>> > >  )
>> >
>> > > --- Yout markup ---
>> > > markup = """
>> > > Just enough of rain ``1``:br
>> > > To bring the smell of silk ``1``:br
>> > > From Umbrellas ``1``:br
>> > > """
>> >
>> > > --- alternative markup ---
>> > > markup = """
>> > > Just enough of rain :template
>> > > To bring the smell of silk :template
>> > > From Umbrellas :template
>> > > """
>> >
>> > > --- rendering ---
>> >
>> > > {{=MARKMIN(markup, customtags)}}
>>
>
>


-- 
 http://martin.tecnodoc.com.ar


Re: [web2py] Re: Two questions: one about markmin and one about SQLFORM

2011-05-17 Thread Tom Atkins
OK - agreed.

On 17 May 2011 14:21, Massimo Di Pierro  wrote:

> Why? I think using whitespaces in wiki syntax is bad because they are
> invisible.
>
> On May 17, 1:34 am, Tom Atkins  wrote:
> > Two spaces at the end of a line makes a new line in Markdown... would it
> be
> > possible to have the same behavior in Markmin?
> >
> > On 17 May 2011 04:09, Bruno Rocha  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > On Mon, May 16, 2011 at 11:34 PM, JayShaffstall  >wrote:
> >
> > >> Just enough of rain
> > >> To bring the smell of silk
> > >> From umbrellas
> >
> > > You can do that in this way:
> >
> > > --- Create a custom markmin dictionary ---
> >
> > > customtags = dict(
> > >  br=lambda n:''*int(n),
> >
> > >  template=lambda code:gluon.template.render(code,context=globals()),
> > >  )
> >
> > > --- Yout markup ---
> > > markup = """
> > > Just enough of rain ``1``:br
> > > To bring the smell of silk ``1``:br
> > > From Umbrellas ``1``:br
> > > """
> >
> > > --- alternative markup ---
> > > markup = """
> > > Just enough of rain :template
> > > To bring the smell of silk :template
> > > From Umbrellas :template
> > > """
> >
> > > --- rendering ---
> >
> > > {{=MARKMIN(markup, customtags)}}
>


Re: [web2py] Re: Two questions: one about markmin and one about SQLFORM

2011-05-16 Thread Tom Atkins
Two spaces at the end of a line makes a new line in Markdown... would it be
possible to have the same behavior in Markmin?

On 17 May 2011 04:09, Bruno Rocha  wrote:

> On Mon, May 16, 2011 at 11:34 PM, JayShaffstall wrote:
>
>> Just enough of rain
>> To bring the smell of silk
>> From umbrellas
>>
>
>
> You can do that in this way:
>
> --- Create a custom markmin dictionary ---
>
> customtags = dict(
>  br=lambda n:''*int(n),
>
>  template=lambda code:gluon.template.render(code,context=globals()),
>  )
>
>
> --- Yout markup ---
> markup = """
> Just enough of rain ``1``:br
> To bring the smell of silk ``1``:br
> From Umbrellas ``1``:br
> """
>
> --- alternative markup ---
> markup = """
> Just enough of rain :template
> To bring the smell of silk :template
> From Umbrellas :template
> """
>
> --- rendering ---
>
> {{=MARKMIN(markup, customtags)}}
>
>
>
>
>


Re: [web2py] Re: Two questions: one about markmin and one about SQLFORM

2011-05-16 Thread Bruno Rocha
On Mon, May 16, 2011 at 11:34 PM, JayShaffstall wrote:

> Just enough of rain
> To bring the smell of silk
> From umbrellas
>


You can do that in this way:

--- Create a custom markmin dictionary ---

customtags = dict(
 br=lambda n:''*int(n),

 template=lambda code:gluon.template.render(code,context=globals()),
 )


--- Yout markup ---
markup = """
Just enough of rain ``1``:br
To bring the smell of silk ``1``:br
>From Umbrellas ``1``:br
"""

--- alternative markup ---
markup = """
Just enough of rain :template
To bring the smell of silk :template
>From Umbrellas :template
"""

--- rendering ---

{{=MARKMIN(markup, customtags)}}