rest2web-develop Mailing List for rest2web (Page 4)
Brought to you by:
mjfoord
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(74) |
Aug
(71) |
Sep
(6) |
Oct
(6) |
Nov
(3) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(8) |
Feb
(17) |
Mar
(16) |
Apr
(48) |
May
(9) |
Jun
|
Jul
(7) |
Aug
(93) |
Sep
(18) |
Oct
(17) |
Nov
(22) |
Dec
(11) |
2007 |
Jan
(11) |
Feb
|
Mar
(61) |
Apr
(14) |
May
(3) |
Jun
|
Jul
(13) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(6) |
2008 |
Jan
|
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(7) |
Oct
(2) |
Nov
(7) |
Dec
(7) |
2009 |
Jan
(2) |
Feb
|
Mar
(4) |
Apr
|
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2010 |
Jan
(1) |
Feb
(1) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(14) |
Sep
(2) |
Oct
(1) |
Nov
(3) |
Dec
|
2012 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(5) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(2) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(2) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2016 |
Jan
(2) |
Feb
(5) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: WNPP M. <lu...@de...> - 2009-05-06 00:06:43
|
The rest2web package in Debian is orphaned, and someone is interested in maintaining it. For more information, please read <http://bugs.debian.org/470751> (You are receiving this mail because you are subscribed to rest2web on the Debian Package Tracking System.) |
From: Michael F. <fuz...@vo...> - 2009-03-08 23:38:46
|
mon...@ya... wrote: [snip...] >>> I'm using the definition of "body" in the "uservalues" >>> >> to separate the content from the rest of the stuff >> (restindex). >> >>> >>> >> I don't fully understand the question below. >> >> > > I make something like this (in my index.txt): > > restindex > [bla, bla, bla, ...] > /restindex > uservalues > body: ./contents/some_content.txt > /uservalues > > Where the file "./contents/some_content.txt" are the real contents of the page... > > Don't use the name body - this is already in use for the full body of the page. See this page for the list of names used by rest2web: http://www.voidspace.org.uk/python/rest2web/templating.html > > >>> I would like to reference the original contents file >>> >> (assigned to the variable "body") from my website to create >> a link to download the original file contents in >> reStructuredText format .... >> >>> How do I introduce a variable that contains the file >>> >> name of content ("body") in order to handle it in the html >> template? >> >>> >>> >> Do you want a link to the original text file that creates >> the output? >> >> > > Exactly: i want a link to the file "./contents/some_content.txt". I know how to copy the contents file to the output (ussing "file: ./contents/some_content.txt" but how can i construct a link in the html output file?. I need a variable with the value > "./contents/some_content.txt" in order to make the template... Exists this variable? > You could use pagepath and replace the extension with .txt. Michael > Ruben > > >> Michael >> >> >>> Best regards. >>> >>> >>> >>> >>> >>> >> ------------------------------------------------------------------------------ >> >>> Open Source Business Conference (OSBC), March 24-25, >>> >> 2009, San Francisco, CA >> >>> -OSBC tackles the biggest issue in open source: Open >>> >> Sourcing the Enterprise >> >>> -Strategies to boost innovation and cut costs with >>> >> open source participation >> >>> -Receive a $600 discount off the registration fee with >>> >> the source code: SFAD >> >>> http://p.sf.net/sfu/XcvMzF8H >>> _______________________________________________ >>> Rest2web-develop mailing list >>> Res...@li... >>> https://lists.sourceforge.net/lists/listinfo/rest2web-develop >>> >>> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/blog >> >> >> >> > > > > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog |
From: <mon...@ya...> - 2009-03-08 23:19:51
|
Hi, Thanks for your time... --- El dom, 8/3/09, Michael Foord <fuz...@vo...> escribió: > De: Michael Foord <fuz...@vo...> > Asunto: Re: [Rest2web-develop] About the variable "body" > Para: mon...@ya..., "A list to discuss development of rest2web." <res...@li...> > Fecha: domingo, 8 marzo, 2009 11:31 > mon...@ya... > wrote: > > Hi. > > > > First of all, thank you very much for the rest2web > package. It is very useful for me. > > > > Hi, > > Sorry for the late reply - I'm in the middle of conference > season with > waaay to much to do and too little time to do it. > > > I'm using the definition of "body" in the "uservalues" > to separate the content from the rest of the stuff > (restindex). > > > > > > I don't fully understand the question below. > I make something like this (in my index.txt): restindex [bla, bla, bla, ...] /restindex uservalues body: ./contents/some_content.txt /uservalues Where the file "./contents/some_content.txt" are the real contents of the page... > > I would like to reference the original contents file > (assigned to the variable "body") from my website to create > a link to download the original file contents in > reStructuredText format .... > > > > How do I introduce a variable that contains the file > name of content ("body") in order to handle it in the html > template? > > > > > > Do you want a link to the original text file that creates > the output? > Exactly: i want a link to the file "./contents/some_content.txt". I know how to copy the contents file to the output (ussing "file: ./contents/some_content.txt" but how can i construct a link in the html output file?. I need a variable with the value "./contents/some_content.txt" in order to make the template... Exists this variable? Ruben > Michael > > > Best regards. > > > > > > > > > > > ------------------------------------------------------------------------------ > > Open Source Business Conference (OSBC), March 24-25, > 2009, San Francisco, CA > > -OSBC tackles the biggest issue in open source: Open > Sourcing the Enterprise > > -Strategies to boost innovation and cut costs with > open source participation > > -Receive a $600 discount off the registration fee with > the source code: SFAD > > http://p.sf.net/sfu/XcvMzF8H > > _______________________________________________ > > Rest2web-develop mailing list > > Res...@li... > > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > |
From: Michael F. <fuz...@vo...> - 2009-03-08 22:31:12
|
mon...@ya... wrote: > Hi. > > First of all, thank you very much for the rest2web package. It is very useful for me. > Hi, Sorry for the late reply - I'm in the middle of conference season with waaay to much to do and too little time to do it. > I'm using the definition of "body" in the "uservalues" to separate the content from the rest of the stuff (restindex). > > I don't fully understand the question below. > I would like to reference the original contents file (assigned to the variable "body") from my website to create a link to download the original file contents in reStructuredText format .... > > How do I introduce a variable that contains the file name of content ("body") in order to handle it in the html template? > > Do you want a link to the original text file that creates the output? Michael > Best regards. > > > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog |
From: <mon...@ya...> - 2009-03-04 09:00:15
|
Hi. First of all, thank you very much for the rest2web package. It is very useful for me. I'm using the definition of "body" in the "uservalues" to separate the content from the rest of the stuff (restindex). I would like to reference the original contents file (assigned to the variable "body") from my website to create a link to download the original file contents in reStructuredText format .... How do I introduce a variable that contains the file name of content ("body") in order to handle it in the html template? Best regards. |
From: Hans F. <h.f...@so...> - 2009-01-17 00:52:30
|
Dear rest2web community, first many thanks to Michael and all contributors: rest2web is an excellent tool to quickly generate static webpages. I have come across one problem though, which I hope somebody can help me with. In the navigation (mini-)bar, I would like to add one entry that points to an external webpage (let's say to "http://www.google.com" for clarity). I.e. this is a button (or <li> entry in the sidebar) that is not pointing to a page x.html that was generated from x.txt. Instead, it should point to an external URL. Here is the restindex I have used to create that link in the navigation bar: restindex crumb: Google format: rest page-title: Google include: Yes target: http://www.google.com build: no page-description: Google /description /restindex However, once r2w is gone over this, the output for this link in the navigation bar in file, say, index.html reads: <li><a href="http:/www.google.com">Google</a></li> Note that the URL beginning has only one slash ('/') but should have ('//'). This error is somewhat difficult to spot as safari will guess correctly that a double slash was meant, but IE7 and firefox 3 (on Windows) will interpret this as a local page (which doesn't exist). Any suggestions, anybody? Many thanks, Hans -- Hans Fangohr School of Engineering Sciences University of Southampton Phone: +44 (0) 238059 8345 Email: fa...@so... http://www.soton.ac.uk/~fangohr |
From: Senthil K. <ors...@gm...> - 2009-01-09 16:33:59
|
Hello, I maintain all my programming snippets in CVS (http://tinyurl.com/863zsh) and have a site mostly for snippets and notes (http://uthcode.sarovar.org) In order to maintain the site in a better way, I analyzed certain tools and rest2web seems to be the way to go. I see rest2web has developed a lot and has quite a bunch of options. However, I was trying the following with rest2web and have not been able to (yet). 1) Copying a number of .py files directly to output. file: takes a single filename in the template. file: *.py is wrong. listing files one by one may be a bad idea. I was thinking if in template, I execute a code to copy to output directory. What are my options? (Doing it outside of rest2web system would be my last option) 2) Another question is, in the template.txt file which is in /path/to/subdir/ If I use os.listdir(os.getcwd()). it is pointing to directory from where python interpreter is running and not actually /path/to/subdir. os.listdir(os.path.dirname(__file__)) wont work because __file__ is not defined in the template.txt. How do I go about in this case? I want a list of files a in particular directory so that I can index them in template.txt Thanks, Senthil |
From: Michael F. <fuz...@vo...> - 2008-12-18 13:16:49
|
Hello Andrew, That seems like a reasonable suggestion - thanks for the patch. It will have to wait until I have finished my book before I get a chance to apply it I'm afraid. Michael Andrew Ittner wrote: > I noticed that the links from the print_details macro would appear in random > order. This code change sorts them by default. > > Should this perhaps be an option (sort=True) on print_details? > > Andrew Ittner > > Index: rest2web/functions.py > =================================================================== > --- rest2web/functions.py (revision 248) > +++ rest2web/functions.py (working copy) > @@ -457,7 +457,8 @@ > if pages and do_pages: > print page_title > entries = [] > - for page in pages: > + > + for page in sorted(pages): > val = link % (page[0], page[1]) > if do_description: > val += description % page[2] > @@ -467,7 +468,7 @@ > if subsections and do_subsections: > print subsection_title > entries = [] > - for page in subsections: > + for page in sorted(subsections): > val = link % (page[0], page[1]) > if do_description: > val += description % page[2] > > > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > -- http://www.ironpythoninaction.com/ |
From: Andrew I. <and...@us...> - 2008-12-17 21:14:21
|
I noticed that the links from the print_details macro would appear in random order. This code change sorts them by default. Should this perhaps be an option (sort=True) on print_details? Andrew Ittner Index: rest2web/functions.py =================================================================== --- rest2web/functions.py (revision 248) +++ rest2web/functions.py (working copy) @@ -457,7 +457,8 @@ if pages and do_pages: print page_title entries = [] - for page in pages: + + for page in sorted(pages): val = link % (page[0], page[1]) if do_description: val += description % page[2] @@ -467,7 +468,7 @@ if subsections and do_subsections: print subsection_title entries = [] - for page in subsections: + for page in sorted(subsections): val = link % (page[0], page[1]) if do_description: val += description % page[2] |
From: G. M. <mi...@us...> - 2008-12-03 09:48:41
|
On 3.12.08, Ben wrote: > > There seems to be still an invalid character in your file. > Yes, it looks like an invalid character, but there are other clues that it's > not > - as Michael pointed out, it was a pb in writing the file, apparently, not > reading it (encoding vs decoding) > - all the files are perfectly processed by rst2html.py > (for i in `ls -1 *.txt` ; do rst2html.py $i > /dev/null ; done) => no > error on stderr > - it simply perfectly works on Linux. Same files, same rest2web archive. You convinced me. Let us assume that there is no "strange" character in the rst input. rst2html works well, so there must be a problem with rest2web: * is your template file UTF-8 clean? * do you use any of the special replacement features of rest2web? * what is the locale when you run rest2web? > I did, big time! and the files are really utf8 > However, do you know how to jump to byte 1665 with any text editor? you might need a binary editor... or read the file into a string and slice [1660:1670]. However, it might be worth to look at around character 1660 in the *exported* latin-1 file. Günter |
From: Ben <bi...@ma...> - 2008-12-03 08:52:12
|
Hello everyone, first of all, thank you for your help and support! I really appreciate it. > There seems to be still an invalid character in your file. Yes, it looks like an invalid character, but there are other clues that it's not - as Michael pointed out, it was a pb in writing the file, apparently, not reading it (encoding vs decoding) - iconv is perfectly happy with all the files - I've asked a python guru friend to write a program to spot any non-utf8 character in any file and his program, is_unicode.py , is perfectly happy with my files, char by char - all the files are perfectly processed by rst2html.py (for i in `ls -1 *.txt` ; do rst2html.py $i > /dev/null ; done) => no error on stderr - it simply perfectly works on Linux. Same files, same rest2web archive. > May be you can trim down your example file (keeping the bytes around 1665). I did, big time! and the files are really utf8 However, do you know how to jump to byte 1665 with any text editor? I've tried with cat, wc, etc. and I simply didn't find it :< sorry. What I did is to remove all the paragraphs except the intro. It fails. > Do you get the same error with `rst2html myfile.txt`? nope, it works. All of them. > > Can you open this file with an UTF-8 enabled text editor? Yes, vim, emacs 22.2.50.1 with utf8 support, and textwrangler with the explicit mention of utf-8 encoding. I carefully inspected the files, I removed any weird character (even those which are supposedly utf8 like blocked semi space or fancy "). > What does myfil.txt look like in a web browser if you set the > page-encoding manually to UTF-8? I've done that with Firefox, explicitely picking UTF-8 in View -> Character encdoing. The rest source page looks great! > > In any way, we need an example file to investigate. > OK, I'm going to create an archive and post a link to it on this list. Thank you again for your help. -- Ben |
From: G. M. <mi...@us...> - 2008-12-03 07:55:24
|
On 2.12.08, Benoit wrote: > I've created a single new file, using vim or textwrangler on MacOSX. ... > - I've converted the exactly same file with iconv(1). > iconv -f latin1 -t utf8 myfile.txt > myfile.txt.utf8 > mv myfile.txt.utf8 myfile.txt ... > - Second attempt, I fix the restindex: > encoding: utf-8 > output-encoding: utf-8 > => results: rest2web stops with an encoding related error message. ... > [err] error_details)) > [err] UnicodeError: Unable to decode input data. Tried the following > encodings: 'utf-8'. > [err] (UnicodeDecodeError: 'utf8' codec can't decode bytes in position > 1665-1666: invalid data) > [err] There seems to be still an invalid character in your file. This might be a bug in iconv. Or some non-utf8 encoded char "smuggled" in or a byte was taken out after the conversion. May be you can trim down your example file (keeping the bytes around 1665). Do you get the same error with `rst2html myfile.txt`? Can you open this file with an UTF-8 enabled text editor? What does myfil.txt look like in a web browser if you set the page-encoding manually to UTF-8? In any way, we need an example file to investigate. Günter |
From: Michael F. <fuz...@vo...> - 2008-12-02 23:17:06
|
Hello Ben, Very odd. Thanks for your investigation - I'll have to find the time to work out what is going wrong. Very odd. Can you send the errant file (or an example one that causes the issue). All the best, Michael Foord Benoit wrote: > > > Hello everybody > > I've been investigating a bit deeper, from user point of view, the problem > I'm facing with this rest2web encoding issue on MacOSX. > > I've created a single new file, using vim or textwrangler on MacOSX. > Here are the results. > > 1/ Latin1 file > > - the file is encoded in Latin1 (confirmed by file(1)). > - in the file I've set: > encoding: latin1 > output-encoding: utf-8 > > and when I run the Makefile, everything works fine (rest2web seems > happy and > the HTML output looks great in Firefox) > > > 2/ An UTF-8 file > > - I've converted the exactly same file with iconv(1). > iconv -f latin1 -t utf8 myfile.txt > myfile.txt.utf8 > mv myfile.txt.utf8 myfile.txt > > - First attempt, I *DON'T* change the restindex: > encoding: latin1 ## yes the file is now UTF-8! > output-encoding: utf-8 > > => results: rest2web seems happy and runs well, but the html output > has a double-encoding in UTF-8 (e.g. é -> é). > > - Second attempt, I fix the restindex: > encoding: utf-8 > output-encoding: utf-8 > > => results: rest2web stops with an encoding related error message. > > $ make > rest2web version 0.5.1 > > [ skipping lots of files which are OK! ] > > Processing "articles" directory. > Reading "articles/myfile.txt". > [err] Traceback (most recent call last): > [err] File "/Users/benoit/local/rest2web-0.5.1/r2w.py", line 170, in > <module> > [err] count = main(options, config) > [err] File "/Users/benoit/local/rest2web-0.5.1/r2w.py", line 103, in > main > [err] return processor.walk() > [err] File > "/Users/benoit/local/rest2web-0.5.1/rest2web/restprocessor.py", line > 457, in walk > [err] errorcheck = self.execute_safely(ProcessFile) > [err] File > "/Users/benoit/local/rest2web-0.5.1/rest2web/restprocessor.py", line > 218, in execute_safely > [err] val = function(*args, **keywargs) > [err] File > "/Users/benoit/local/rest2web-0.5.1/rest2web/restprocessor.py", line > 452, in ProcessFile > [err] subdir=subdir) > [err] File > "/Users/benoit/local/rest2web-0.5.1/rest2web/restprocessor.py", line > 950, in process > [err] doctitle=doctitle) > [err] File > "/Users/benoit/local/rest2web-0.5.1/rest2web/restutils.py", line 183, > in html_parts > [err] writer_name='html', settings_overrides=overrides) > [err] File "/Library/Python/2.5/site-packages/docutils/core.py", > line 433, in publish_parts > [err] enable_exit_status=enable_exit_status) > [err] File "/Library/Python/2.5/site-packages/docutils/core.py", > line 614, in publish_programmatically > [err] output = pub.publish(enable_exit_status=enable_exit_status) > [err] File "/Library/Python/2.5/site-packages/docutils/core.py", > line 204, in publish > [err] self.settings) > [err] File > "/Library/Python/2.5/site-packages/docutils/readers/__init__.py", line > 68, in read > [err] self.input = self.source.read() > [err] File "/Library/Python/2.5/site-packages/docutils/io.py", line > 357, in read > [err] return self.decode(self.source) > [err] File "/Library/Python/2.5/site-packages/docutils/io.py", line > 124, in decode > [err] error_details)) > [err] UnicodeError: Unable to decode input data. Tried the following > encodings: 'utf-8'. > [err] (UnicodeDecodeError: 'utf8' codec can't decode bytes in position > 1665-1666: invalid data) > [err] > > Well, of course I could use a latin1 encoding, but well, I would > enjoy utf-8! > > Anyone a clue ? > > Kind regards, > > -- Ben > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > ------------------------------------------------------------------------ > > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog |
From: Benoit <be...@ma...> - 2008-12-02 22:13:18
|
Hello everybody I've been investigating a bit deeper, from user point of view, the problem I'm facing with this rest2web encoding issue on MacOSX. I've created a single new file, using vim or textwrangler on MacOSX. Here are the results. 1/ Latin1 file - the file is encoded in Latin1 (confirmed by file(1)). - in the file I've set: encoding: latin1 output-encoding: utf-8 and when I run the Makefile, everything works fine (rest2web seems happy and the HTML output looks great in Firefox) 2/ An UTF-8 file - I've converted the exactly same file with iconv(1). iconv -f latin1 -t utf8 myfile.txt > myfile.txt.utf8 mv myfile.txt.utf8 myfile.txt - First attempt, I *DON'T* change the restindex: encoding: latin1 ## yes the file is now UTF-8! output-encoding: utf-8 => results: rest2web seems happy and runs well, but the html output has a double-encoding in UTF-8 (e.g. é -> Ã(c)). - Second attempt, I fix the restindex: encoding: utf-8 output-encoding: utf-8 => results: rest2web stops with an encoding related error message. $ make rest2web version 0.5.1 [ skipping lots of files which are OK! ] Processing "articles" directory. Reading "articles/myfile.txt". [err] Traceback (most recent call last): [err] File "/Users/benoit/local/rest2web-0.5.1/r2w.py", line 170, in <module> [err] count = main(options, config) [err] File "/Users/benoit/local/rest2web-0.5.1/r2w.py", line 103, in main [err] return processor.walk() [err] File "/Users/benoit/local/rest2web-0.5.1/rest2web/restprocessor.py", line 457, in walk [err] errorcheck = self.execute_safely(ProcessFile) [err] File "/Users/benoit/local/rest2web-0.5.1/rest2web/restprocessor.py", line 218, in execute_safely [err] val = function(*args, **keywargs) [err] File "/Users/benoit/local/rest2web-0.5.1/rest2web/restprocessor.py", line 452, in ProcessFile [err] subdir=subdir) [err] File "/Users/benoit/local/rest2web-0.5.1/rest2web/restprocessor.py", line 950, in process [err] doctitle=doctitle) [err] File "/Users/benoit/local/rest2web-0.5.1/rest2web/restutils.py", line 183, in html_parts [err] writer_name='html', settings_overrides=overrides) [err] File "/Library/Python/2.5/site-packages/docutils/core.py", line 433, in publish_parts [err] enable_exit_status=enable_exit_status) [err] File "/Library/Python/2.5/site-packages/docutils/core.py", line 614, in publish_programmatically [err] output = pub.publish(enable_exit_status=enable_exit_status) [err] File "/Library/Python/2.5/site-packages/docutils/core.py", line 204, in publish [err] self.settings) [err] File "/Library/Python/2.5/site-packages/docutils/readers/__init__.py", line 68, in read [err] self.input = self.source.read() [err] File "/Library/Python/2.5/site-packages/docutils/io.py", line 357, in read [err] return self.decode(self.source) [err] File "/Library/Python/2.5/site-packages/docutils/io.py", line 124, in decode [err] error_details)) [err] UnicodeError: Unable to decode input data. Tried the following encodings: 'utf-8'. [err] (UnicodeDecodeError: 'utf8' codec can't decode bytes in position 1665-1666: invalid data) [err] Well, of course I could use a latin1 encoding, but well, I would enjoy utf-8! Anyone a clue ? Kind regards, -- Ben |
From: Ben <bi...@ma...> - 2008-11-25 17:46:39
|
On Tue, Nov 25, 2008 at 12:01 PM, Michael Foord <fuz...@vo...>wrote: > Hello Ben, Hi Michael, thanks a lot for your email and thanks a million times for rest2web! Sorry for the late reply. No problem at all. I was just wandering if my email ever reached the lidie! > > Interestingly the error is in an encode operation (not a decode) - so it > happens when rest2web is trying to write out a file rather than reading > one in (so I don't *think* it is to do with guessing encoding). OK, interesting and good to know! In fact I've discovered that as well by testing and testing all the files, they are in UTF-8 (a python guru friend of mine has created a little script to test file char by char :)) So the problem seems to be the output. > Can you put the following in the restindex of your main index file and > see if it helps: > > output-encoding: utf8 > Actually, I've tried everything I could, including the directive you mention. Here is what in my updated files: encoding: utf-8 output-encoding: utf-8 in all the files. It doesn't help. I've tried to remove the page-description (because it contained non ascii char). Btw a quick question: the error message is a bit obscure, do you think there is a way to know exactly where it failed? The error message says something like: [err] UnicodeError: Unable to decode input data. Tried the following encodings: 'utf-8'. [err] (UnicodeDecodeError: 'utf8' codec can't decode bytes in position 1689-1690: invalid data) It's not really clear. I would enjoy something like: "can't decode bytes in position 1689-1690: invalid data at "and Hello in Klingon is !@#@#$" But I've been investigating a bit deeper and now I'm completely puzzled: the thing which is really weird is I've copied, with `scp -r` the directory with my faulty website and the rest2web archive (with r2w.py in it) on a Linux box (debian stable). And I run the thing with my Makefile. Guess what? It *works*. Perfectly. Seamlessly. So the problem is probably not the files, and not rest2web. I'm wondering about Python, or HFS+ (?). I know it's weird, but ... I can't say anything else. So here are my python flavors: $ /usr/bin/python --version Python 2.5.1 and using the ports: $ /opt/local/bin/python2.5 --version Python 2.5.2 I've tried to use both by calling directly r2w.py (for the standard python) or /opt/local/bin/python-2.5 r2w.py (for the python-on-ports). I've installed docutils for the 2 separates systems. Both fail in compiling the website. Well, I don't know what to say. I've read your blog, Michael, and I think you have a Mac too. Have you ever get in these issues? Kind regards, -- Ben |
From: Michael F. <fuz...@vo...> - 2008-11-25 12:01:53
|
Hello Ben, Sorry for the late reply. That's certainly a very odd error (that I've not seen before). Interestingly the error is in an encode operation (not a decode) - so it happens when rest2web is trying to write out a file rather than reading one in (so I don't *think* it is to do with guessing encoding). Can you put the following in the restindex of your main index file and see if it helps: output-encoding: utf8 Michael Foord Ben wrote: > > Hello list, > > I have a strange issue with file encoding. Actually, this problem only > occurs on my brand new MacBook -- running MacOSX on a HFS+ filesystem, > but everything used to run fine with my previous OS, Linux. I've > investiguated as much as I could but I can't find a solution, could > you please tell me you opinion about it? > > First I had some weird behaviors with rest2web encoding handling, the > 'file' command returns a file as UTF8 encoded but the log of rest2web > guesses latin1. > I've added: > [uservalues] > __encoding__ = UTF-8 > in my r2w and encoding: utf-8 in files restindex. > Just to let you know my env says: LANG=en_GB.UTF-8. > > Things are still a bit weird (rest2web still guesses apparently a > wrong encoding) but kind of work. Except ONE and last file, an > indexfile in a directory. > > Here is the error output r2w.py procudes (called by a Makefile): > > -----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<--- > Processing indexfile. > [err] Traceback (most recent call last): > [err] File "/Users/benoit/local/rest2web-0.5.1/r2w.py", line 170, in > <module> > [err] count = main(options, config) > [err] File "/Users/benoit/local/rest2web-0.5.1/r2w.py", line 103, in > main > [err] return processor.walk() > [err] File > "/Users/benoit/local/rest2web-0.5.1/rest2web/restprocessor.py", line > 473, in walk > [err] errorcheck = self.execute_safely(self.buildsection) > [err] File > "/Users/benoit/local/rest2web-0.5.1/rest2web/restprocessor.py", line > 218, in execute_safely > [err] val = function(*args, **keywargs) > [err] File > "/Users/benoit/local/rest2web-0.5.1/rest2web/restprocessor.py", line > 1401, in buildsection > [err] self.sections, final_encoding, self.dir_as_url, target) > [err] File > "/Users/benoit/local/rest2web-0.5.1/rest2web/restprocessor.py", line > 1735, in handle_sections > [err] page['page-description'], encoding) > [err] File > "/Users/benoit/local/rest2web-0.5.1/rest2web/restutils.py", line 240, > in encode > [err] return instring.encode(encoding) > [err] UnicodeEncodeError: 'latin-1' codec can't encode character > u'\u2019' in position 138: ordinal not in range(256) > [err] > make: *** [build] Error 1 > > -----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<--- > > And here is the faulty text: > > > -----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<--- > > $ cat src/articles/index.txt > .. > restindex > link-title: Resources > encoding: utf-8 > page-description: > List > /description > /restindex > > ======================================== > List > ======================================== > > test > > -----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<--- > > I first though it could be from my template but once again, other > pages are sucessfully processed. My locales seem ok... > > Any idea? I'm lost. > Thank you very much in advance. > > -- Ben > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > ------------------------------------------------------------------------ > > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > -- http://www.ironpythoninaction.com/ |
From: Ben <bi...@ma...> - 2008-11-22 19:21:35
|
Hello list, I have a strange issue with file encoding. Actually, this problem only occurs on my brand new MacBook -- running MacOSX on a HFS+ filesystem, but everything used to run fine with my previous OS, Linux. I've investiguated as much as I could but I can't find a solution, could you please tell me you opinion about it? First I had some weird behaviors with rest2web encoding handling, the 'file' command returns a file as UTF8 encoded but the log of rest2web guesses latin1. I've added: [uservalues] __encoding__ = UTF-8 in my r2w and encoding: utf-8 in files restindex. Just to let you know my env says: LANG=en_GB.UTF-8. Things are still a bit weird (rest2web still guesses apparently a wrong encoding) but kind of work. Except ONE and last file, an indexfile in a directory. Here is the error output r2w.py procudes (called by a Makefile): -----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<--- Processing indexfile. [err] Traceback (most recent call last): [err] File "/Users/benoit/local/rest2web-0.5.1/r2w.py", line 170, in <module> [err] count = main(options, config) [err] File "/Users/benoit/local/rest2web-0.5.1/r2w.py", line 103, in main [err] return processor.walk() [err] File "/Users/benoit/local/rest2web-0.5.1/rest2web/restprocessor.py", line 473, in walk [err] errorcheck = self.execute_safely(self.buildsection) [err] File "/Users/benoit/local/rest2web-0.5.1/rest2web/restprocessor.py", line 218, in execute_safely [err] val = function(*args, **keywargs) [err] File "/Users/benoit/local/rest2web-0.5.1/rest2web/restprocessor.py", line 1401, in buildsection [err] self.sections, final_encoding, self.dir_as_url, target) [err] File "/Users/benoit/local/rest2web-0.5.1/rest2web/restprocessor.py", line 1735, in handle_sections [err] page['page-description'], encoding) [err] File "/Users/benoit/local/rest2web-0.5.1/rest2web/restutils.py", line 240, in encode [err] return instring.encode(encoding) [err] UnicodeEncodeError: 'latin-1' codec can't encode character u'\u2019' in position 138: ordinal not in range(256) [err] make: *** [build] Error 1 -----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<--- And here is the faulty text: -----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<--- $ cat src/articles/index.txt .. restindex link-title: Resources encoding: utf-8 page-description: List /description /restindex ======================================== List ======================================== test -----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<--- I first though it could be from my template but once again, other pages are sucessfully processed. My locales seem ok... Any idea? I'm lost. Thank you very much in advance. -- Ben |
From: Andreas P. <ap...@au...> - 2008-11-04 18:38:23
|
* Michael Foord <fuz...@vo...> [081104 16:20]: > Do you mean without changing rest2web sourcecode or docutils sourcecode? Without changing any sourcecode. ;-) I'd like to change this docutils setting in rest2web by means of configuration. > Is it something you can set in your default docutils config file? Yes, the option is called ``strip_comments``, the command line argument is ``--strip-comments``. Is there a way to use this option with rest2web exclusively? -- Bye, Andreas |
From: Andreas P. <a.p...@ac...> - 2008-11-04 16:08:07
|
* Michael Foord <fuz...@vo...> [081104 16:20]: > Do you mean without changing rest2web sourcecode or docutils sourcecode? Without changing any sourcecode. ;-) I'd like to change this docutils setting in rest2web by means of configuration. > Is it something you can set in your default docutils config file? Yes, the option is called ``strip_comments``, the command line argument is ``--strip-comments``. Is there a way to use this option with rest2web exclusively? -- Bye, Andreas |
From: Michael F. <fuz...@vo...> - 2008-11-04 15:15:31
|
Andreas Poisel wrote: > Hi all! > > Is there an easy way to remove ReST comments from the resulting HTML > code (just like the Publisher-setting 'strip-comments' does)? > > Or is there even a generic way to add values to ``settings_overrides`` > in docutil's Publisher? > > After a (quick) look at ``restutils.html_parts()`` and its callers, I > can't find a possibility to accomplish that without changing the source > code. > > Am I missing something obvious? > > Do you mean without changing rest2web sourcecode or docutils sourcecode? Is it something you can set in your default docutils config file? All the best, Michael > Thank you! > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog |
From: Andreas P. <ap...@au...> - 2008-11-04 15:08:11
|
Hi all! Is there an easy way to remove ReST comments from the resulting HTML code (just like the Publisher-setting 'strip-comments' does)? Or is there even a generic way to add values to ``settings_overrides`` in docutil's Publisher? After a (quick) look at ``restutils.html_parts()`` and its callers, I can't find a possibility to accomplish that without changing the source code. Am I missing something obvious? Thank you! -- Bye, Andreas |
From: Michael F. <fuz...@vo...> - 2008-10-04 21:10:50
|
Andrew Straw wrote: > Michael Foord wrote: > >> Andrew Straw wrote: >> >>> I'm in the process of updating my websites to use rest2web, but I'm >>> hitting one problem -- I keep my files under subversion, which seems >>> unable to maintain a file's "mtime" ( >>> http://subversion.tigris.org/issues/show_bug.cgi?id=1256 ). Thus, when I >>> check out the source for my site with svn, the modtimes are all screwed >>> up. Does anyone have any solutions? Of course, I could simply remove the >>> <% modtime %> from my template, but there must be a better way. >>> >>> The simplest idea I have at the moment is Python code in my template >>> that calls svn and asks for the svn commit time. This could fail >>> gracefully to the file systems mtime if the file was not under svn. >>> >>> >> I like this idea and I can't think of a better solution off the top of >> my head. >> > > OK, I did this and wrote it up at http://code.astraw.com/this-website.html > Great - thanks! Michael > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ |
From: Andrew S. <str...@as...> - 2008-10-04 20:35:35
|
Michael Foord wrote: > Andrew Straw wrote: >> I'm in the process of updating my websites to use rest2web, but I'm >> hitting one problem -- I keep my files under subversion, which seems >> unable to maintain a file's "mtime" ( >> http://subversion.tigris.org/issues/show_bug.cgi?id=1256 ). Thus, when I >> check out the source for my site with svn, the modtimes are all screwed >> up. Does anyone have any solutions? Of course, I could simply remove the >> <% modtime %> from my template, but there must be a better way. >> >> The simplest idea I have at the moment is Python code in my template >> that calls svn and asks for the svn commit time. This could fail >> gracefully to the file systems mtime if the file was not under svn. >> > > I like this idea and I can't think of a better solution off the top of > my head. OK, I did this and wrote it up at http://code.astraw.com/this-website.html |
From: Michael F. <fuz...@vo...> - 2008-09-29 20:27:29
|
Andrew Straw wrote: > I'm in the process of updating my websites to use rest2web, but I'm > hitting one problem -- I keep my files under subversion, which seems > unable to maintain a file's "mtime" ( > http://subversion.tigris.org/issues/show_bug.cgi?id=1256 ). Thus, when I > check out the source for my site with svn, the modtimes are all screwed > up. Does anyone have any solutions? Of course, I could simply remove the > <% modtime %> from my template, but there must be a better way. > > The simplest idea I have at the moment is Python code in my template > that calls svn and asks for the svn commit time. This could fail > gracefully to the file systems mtime if the file was not under svn. > I like this idea and I can't think of a better solution off the top of my head. Michael > Thoughts? > Andrew > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ |
From: Andrew S. <str...@as...> - 2008-09-29 20:10:04
|
I'm in the process of updating my websites to use rest2web, but I'm hitting one problem -- I keep my files under subversion, which seems unable to maintain a file's "mtime" ( http://subversion.tigris.org/issues/show_bug.cgi?id=1256 ). Thus, when I check out the source for my site with svn, the modtimes are all screwed up. Does anyone have any solutions? Of course, I could simply remove the <% modtime %> from my template, but there must be a better way. The simplest idea I have at the moment is Python code in my template that calls svn and asks for the svn commit time. This could fail gracefully to the file systems mtime if the file was not under svn. Thoughts? Andrew |