New to auth.wiki - format text as address block with markmin

107 views
Skip to first unread message

Jim S

unread,
Jul 7, 2013, 4:34:40 PM7/7/13
to web...@googlegroups.com
Just started playing with auth.wiki today and am creating some pages.  I want to force line breaks (new line) in some of my text but can't seem to find the way to make it work.

to force a new line I've tried:

\n\n
[[newline]]
<br /><br />

and non of these work, they just display on the page along with the other text.  What am I missing?

-Jim

Alan Etkin

unread,
Jul 7, 2013, 5:28:19 PM7/7/13
to web...@googlegroups.com
Just started playing with auth.wiki today and am creating some pages.  I want to force line breaks (new line) in some of my text but can't seem to find the way to make it work.

You mean you want markmin to add <br/> tags to the output? Then you'll have to pump those lower case letters

>>> m = MARKMIN("ONE [[NEWLINE]] TWO [[NEWLINE]] THREE")
>>> print m
<p>ONE <br /> TWO <br /> THREE</p>
>>> m = MARKMIN("ONE [[newline]] TWO [[newline]] THREE")
>>> print m
<p>ONE <span class="anchor" id="markmin_newline"></span> TWO <span class="anchor" id="markmin_newline"></span> THREE</p>

Jim S

unread,
Jul 7, 2013, 6:08:56 PM7/7/13
to web...@googlegroups.com
I don't think I was clear enough with my description.

I'm using the default auth.wiki as follows in the default controller:

def index():
    return auth.wiki()

Then, in one of the pages I created using the wiki 'create page' I'm trying to get a carriage return displayed.  I've tried all the think listed above, but can't get my address to format correctly.

I want:

John Doe
123 N Main St.
Anytown, WI  53888

When auth.wiki renders it on the page it shows up as:

John Doe 123 N Main St. Anytown, WI  53888

I can't get it to force a carriage return or new line.

I'm not running any python controller code to do anything.

-Jim

Alan Etkin

unread,
Jul 7, 2013, 6:48:48 PM7/7/13
to web...@googlegroups.com

Then, in one of the pages I created using the wiki 'create page' I'm trying to get a carriage return displayed.  I've tried all the think listed above, but can't get my address to format correctly.

Try adding this to a wiki document. I tested this with trunk but should work in any town (make sure your render engine is markmin, the default).

John Doe
[[NEWLINE]]
123 N Main St.
[[NEWLINE]]
Anytown, WI  53888

Jim Steil

unread,
Jul 7, 2013, 6:52:13 PM7/7/13
to web...@googlegroups.com
Same result, no newlines were inserted.  It all appears as one long line.


--
 
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/T28zkNPhBf8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Alan Etkin

unread,
Jul 7, 2013, 8:59:52 PM7/7/13
to web...@googlegroups.com
Same result, no newlines were inserted.  It all appears as one long line.

Odd, It works fine with the mercurial trunk code. what is your version of web2py?

Do you want to force line breaks (separating the html output with <br />) or just add newline characters to the html. For this last option, I don't think that markmin supports it, unless you use a custom render function.

Jim Steil

unread,
Jul 7, 2013, 11:15:58 PM7/7/13
to web...@googlegroups.com
My web2py is Version 2.5.1-stable+timestamp.2013.06.17.10.41.11.

I tried adding a <br /> and didn't see any changes.


Alan Etkin

unread,
Jul 8, 2013, 12:16:51 PM7/8/13
to web...@googlegroups.com
Assuming you want to force html line breaks in auth.wiki documents using its defaullt render engine (markmin), the syntax for doing so is adding [[NEWLINE]] (with uppercase). Here is an example:

>>> print MARKMIN("No. No, I am not the brain specialist.[[NEWLINE]]No I am not.[[NEWLINE]]Yes! Yes I am!").xml()
<p>No. No, I am not the brain specialist.<br />No I am not.<br />Yes! Yes I am!</p>

I tried that command in a web2py shell with the following version
Version 2.6.0-development+timestamp.2013.07.08.01.37.54

If you try that in your system and you get a different output (i.e., no line breaks or mangled text), then probably there's some kind of issue about the markmin render for your specific version.

Jim Steil

unread,
Jul 8, 2013, 1:28:32 PM7/8/13
to web...@googlegroups.com
Yup, that works and I found my error.  I wasn't putting my [[NEWLINE]] in uppercase.


Reply all
Reply to author
Forward
0 new messages