Re: Issues with rendering wiki in html.

113 views
Skip to first unread message

Alan Etkin

unread,
May 22, 2013, 12:16:55 PM5/22/13
to web...@googlegroups.com
Did you ever solve this?  I am having the same issue perhaps this is a bug.
 
On Wednesday, May 15, 2013 4:48:54 PM UTC-4, Noah Lange wrote:
I've been working with web2py for only the last few weeks, so it's likely this is a problem borne mostly of my own ignorance, but I've been having issues rendering a wiki I've been working on.

I cannot reproduce this issue. Passing render="html" to the auth.wiki method in a wiki.py controller does work as expected (at least with the last mercurial version). Perhaps you can post the relevant code so we can help you debugging.

John Fraser

unread,
May 22, 2013, 12:59:15 PM5/22/13
to web...@googlegroups.com
Hi Alan,

I updated to the latest mercurial version, just in case... but the issue still persists for me.  Not sure what I am doing wrong.

Here is my code below:

/init/controllers/wiki.py:

def index():
    response.title = 'Wiki'
    response.subtitle = 'web2py'
    return auth.wiki(render='html')


/init/views/wiki/index.html:

{{extend 'layout.html'}}
{{=content}}


I have this saved in the body of the index wiki page (/init/wiki/index/_edit/index):
# Example
<h1>Example</h1>


However when I visit the view.  I only see the markmin rendered and the html tags.  I am assuming I would see the html rendered and plain text instead of markmin.  See attached image.
screenshot.png

Andrew W

unread,
May 22, 2013, 1:08:11 PM5/22/13
to web...@googlegroups.com
Did you perhaps create your pages first (with markmin) and then add the render=HTML after?

John Fraser

unread,
May 22, 2013, 1:17:34 PM5/22/13
to web...@googlegroups.com
I deleted the old page and created a new one with same 'index' slug....  also tried creating a new page entirely.

Also as this maybe important.  In my init/model/db.py  I have the following after auth tables are defined:
auth.wiki(resolve=False)

Alan Etkin

unread,
May 22, 2013, 1:58:00 PM5/22/13
to web...@googlegroups.com
Also as this maybe important.  In my init/model/db.py  I have the following after auth tables are defined:
auth.wiki(resolve=False)

The auth.wiki method arguments set the Wiki object options the first time, and further configs must be changed with the auth.settings.wiki.option syntax. render="markmin" is the default option and AFAIK is not updated once it was created in the model. Try auth.wiki(resolve=False, render="html"). That should solve the problem.

John Fraser

unread,
May 22, 2013, 3:55:41 PM5/22/13
to web...@googlegroups.com
That works.  Thanks for the help.  Makes sense.  I forgot about the code in db.py when initially troubleshooting.

villas

unread,
May 23, 2013, 8:26:43 AM5/23/13
to web...@googlegroups.com
Hi Alan,

On a general note (for future consideration),   it is useful to have some records in markmin and others in html.  To achieve this I think we really need to add a 'render_type' field to accompany the raw data.  Then we can really mix it up.

In one implementation,  I also added an option for mixed Html and Markmin.  Admittedly this is 'Frankenstein' data,  but it still renders well.  With an extra bit of work from say Beautifulsoup,  you would never know!

I know many will think this is too ugly,  but in some cases we do have some very ugly content originating from various places but still wish to view it as best we can with a minimum of remedial work.

IMO  the "on/off switch" for Html does not provide enough flexibility for this,  but a few alterations could make it so.

Best wishes,  D

Alan Etkin

unread,
May 23, 2013, 1:28:06 PM5/23/13
to web...@googlegroups.com
On a general note (for future consideration),   it is useful to have some records in markmin and others in html.  To achieve this I think we really need to add a 'render_type' field to accompany the raw data.  Then we can really mix it up.
 
I have suggested the same here (without mixing html/markmin):

https://groups.google.com/d/msg/web2py-developers/smnu-k7G6iE/EV3CdD_j3nEJ

Massimo Di Pierro

unread,
May 23, 2013, 11:02:28 PM5/23/13
to web...@googlegroups.com
I think you submitted a patch one. Do you stil have it?

Alan Etkin

unread,
May 24, 2013, 12:40:45 PM5/24/13
to web...@googlegroups.com
I think you submitted a patch one. Do you stil have it?

I did not make the patch because there was no agreement on doing per-record format checks.

BTW: This thread is related to this issue http://code.google.com/p/web2py/issues/detail?id=1298

Alan Etkin

unread,
May 25, 2013, 9:23:26 AM5/25/13
to web...@googlegroups.com
A new enhancement proposal:

http://code.google.com/p/web2py/issues/detail?id=1298#c14

It was only tested with trunk and SQLite, so if anyone finds any incompatibility please post back here or add a comment in the issue page.

Massimo Di Pierro

unread,
May 25, 2013, 11:30:17 AM5/25/13
to web...@googlegroups.com
Will look at it asap. probably tomorrow.
Reply all
Reply to author
Forward
0 new messages