Submitted by : simon at: 2004-03-25T23:42:19+00:00 (13 years ago)
Name :
Category : Severity : Status :
Optional subject :  
Optional comment :

Moved from IssueNo0696? .


comments:

Bob's patch --SimonMichael, Mon, 02 Feb 2004 15:51:43 -0800 reply
Copied from GeneralDiscussion. Ok.. well this is a different issue - changing the way citations are rendered on the web (to this ).

Well let me try a diff to test this... Here's what I did yesterday. It renders citations with <blockquote> which I like. An example page is Test. Any complaints if I merge
this?:
 Index: PageTypes.py
 ===================================================================
 RCS file: /cvsroot/zwiki/zwiki/PageTypes.py,v
 retrieving revision 1.11
 diff -c -r1.11 PageTypes.py
 *** PageTypes.py       24 Jan 2004 23:29:44 -0000      1.11
 --- PageTypes.py       2 Feb 2004 19:31:29 -0000
 ***************
 *** 118,132 ****
   class AbstractHtmlPageType(AbstractPageType):
       supportsHtml = yes

 !     def renderCitationsIn(self,page,t):
 !         lines = string.split(t,'\n')
           for i in range(len(lines)):
 !             if lines[i] and lines[i][0] == '>':
 !                 lines[i] = '><i>' + lines[i][1:] + '</i>'
 !                 if i < len(lines)-1 and lines[i+1] and \
 !                    lines[i+1][0] == '>':
 !                     lines[i] += '<br />'
 !         return string.join(lines,'\n')

       def makeCommentHeading(self, page,
                              subject, username, time, 
 --- 118,149 ----
   class AbstractHtmlPageType(AbstractPageType):
       supportsHtml = yes

 !     def renderCitationsIn(self, page, t):
 !         inblock = 0
 !         blocklines = []
 !         blockend=0
 !         lines = string.split(t, '\n')
 !         t = ""
           for i in range(len(lines)):
 !             m = re.match(r'^>\s?(.*)$', lines[i])
 !             if(m):
 !                 if(not inblock):
 !                     if(i>0 and re.match(r':$', lines[i-1])):
 !                         t += string.join(lines[blockend:i-1],'\n')
 !                         t += lines[i] + '\n'
 !                     else:
 !                         t += string.join(lines[blockend:i],'\n')
 !                     t += '\n<blockquote type="cite">\n'
 !                 inblock = 1
 !                 blocklines.append(m.group(1))
 !             elif(inblock):
 !                 inblock = 0
 !                 blockend=i
 !                 t += self.renderCitationsIn(page,string.join(blocklines, '\n'))
 !                 t += '\n\n</blockquote>\n'
 !                 blocklines = []
 !         t += string.join(lines[blockend:], '\n')
 !         return t 

       def makeCommentHeading(self, page,
                              subject, username, time, 

Bob's patch --SimonMichael, Mon, 02 Feb 2004 15:59:00 -0800 reply
And this seems fine, a cosmetic change, and attractive. Down the road I think message rendering style should become at least a bit pluggable/customizable.

trying it out --SimonMichael, Mon, 02 Feb 2004 16:06:21 -0800 reply
PS (last post!) if it was me, at this point I'd plug it into zwiki.org to smoke-test against a large body of existing content. Ok, done. It will take effect when you edit (not just comment!) a page or hit alt-w (/clearCache).

trying it out --Bob McElrath?, Mon, 02 Feb 2004 16:10:38 -0800 reply
SimonMichael [zwiki-wiki@zwiki.org]? wrote:

PS (last post!) if it was me, at this point I'd plug it into zwiki.org to smoke-test against a large body of existing content. Ok, done. It will take effect when you modify a page or run /clearCache (alt-w).

Sweet.

I did a /clearCache on GeneralDiscussion and it gave me a NameError? (LOG is undefined) -- which you recently removed. Though now GeneralDiscussion is fine. (??)

Cheers, Bob McElrath? [Univ. of California at Davis, Department of Physics]?

a keeper --SimonMichael, Mon, 02 Feb 2004 16:29:52 -0800 reply
I see, blockquote type="cite" gives us colour coding etc. Nifty! Please do check in at your leisure.

a keeper --Bob McElrath?, Mon, 02 Feb 2004 17:32:13 -0800 reply
SimonMichael [zwiki-wiki@zwiki.org]? wrote:

I see, blockquote type="cite" gives us "colour coding": http://zwiki.org/GeneralDiscussion200401#msg401B1620.5040909@joyful.co m etc. Nifty! Please do check in at your leisure.

Committed. (with small tweaks)

BTW I checked Opera and Konqueror, and neither render the colored line like Mozilla does. But that can be fixed with a stylesheet:

    blockquote {
        border-left: 1px solid blue;
        margin-left: 0;
        text-indent: 0;
        padding-left: 1em;
    }

Of course, many other neat things are possible by messing with the blockquote's style.

Cheers, Bob McElrath? [Univ. of California at Davis, Department of Physics]?

problem --simon, Fri, 22 Oct 2004 09:59:58 -0700 reply
A citation containing a stx :: quoted paragraph gets confused, the blockquote runs to the end of the page. Maybe it's fixable.

Example:
 quoted paragraph</blockquote>

property change --simon, Fri, 22 Oct 2004 10:37:34 -0700 reply
Severity: wishlist => minor Status: closed => open

problem --Bob McElrath?, Fri, 22 Oct 2004 13:04:06 -0700 reply
simon [zwiki-wiki@zwiki.org]? wrote:

A citation containing a stx :: quoted paragraph gets confused, the blockquote runs to the end of the page. Maybe it's fixable.

This is one of the many bugs fixed by my stx rewrite.

If you have some example text which breaks the existing stx, please try it on my test site:

http://mcelrath.org:9675/newstx/

problem --Bob McElrath?, Fri, 22 Oct 2004 13:11:26 -0700 reply
Bob McElrath? [bob+zwiki@mcelrath.org]? wrote:

simon [zwiki-wiki@zwiki.org]? wrote:
A citation containing a stx :: quoted paragraph gets confused, the blockquote runs to the end of the page. Maybe it's fixable.

This is one of the many bugs fixed by my stx rewrite.

An example:

http://mcelrath.org:9675/newstx/SandBox#bottom

problem --Simon Michael, Fri, 22 Oct 2004 13:35:48 -0700 reply
Nice, thanks. I added an example on the zwiki.org page.

is this still open? --betabug, Wed, 21 Feb 2007 08:27:08 +0000 reply
Name: #765 davide => #765 enhanced citation formatting Category: site-zwiki.org => user-editing-stx Severity: funded => minor Status: closed => open

yes --simon, Thu, 22 Feb 2007 20:08:49 +0000 reply
Yes it is, notice the layout of this page (I'm using firefox 2)