limodou wrote:
On Thu, Nov 27, 2008 at 11:06 PM, werner <[EMAIL PROTECTED]> wrote:
Hi limodou,

It seems that all which is needed to make "publish_string" in
mRestFileType.py work correctly is to change:

       return publish_string(content, writer_name = 'html')
to
       return publish_string(content, writer_name = 'html',
source_path=provideFileSourcePathincluding file )
EG
       return publish_string(content, writer_name = 'html',
source_path=r'C:\Dev\twcb-doc\en\source\hs10.rst' )

Couldn't figure out how to get this, so I tested it by hard coding the
path to the file in question (i.e. the file containing an include
instruction).

Is this enough for you to change it?

Best regards
Werner

I think I've fixed it, so you can try it from latest svn version.

Just about.  The full path including file has to be provided.

I attach the patch against your latest version.

Werner
Index: mixins/mRestFileType.py
===================================================================
--- mixins/mRestFileType.py     (revision 468)
+++ mixins/mRestFileType.py     (working copy)
@@ -86,7 +86,7 @@
 
     if not obj:
         if win.document.documenttype == 'texteditor':
-            text = html_fragment(document.GetText().encode('utf-8'), 
os.path.dirname(win.document.filename))
+            text = html_fragment(document.GetText().encode('utf-8'), 
win.document.filename)
             if text:
                 page = RestHtmlView(win.panel.createNotebook(side), text, 
document)
                 win.panel.addPage(side, page, dispname)
@@ -219,7 +219,7 @@
             
             def f():
                 try:
-                    text = html_fragment(win.GetText().encode('utf-8'), 
os.path.dirname(win.filename))
+                    text = html_fragment(win.GetText().encode('utf-8'), 
win.filename)
                     page.refresh(text)
                 finally:
                     page.rendering = False

Reply via email to