William Dode | 2 Jun 14:22 2003
Picon

exponent

Hi,

How can we use exponent with rst ? I wonder that i did'nt find anything
in the archive of the mailing list...

We can use substitution like this :

XV |e| century

.. |e| raw:: html

 <sup>e</sup>

But we need a raw for each writer and the space between XV and e is not
typographic (there is the same problem with notes)

What do you think about a special markup for this like XV^e ?

--

-- 
William Dode - http://flibuste.net

-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
bill parducci | 2 Jun 16:53 2003
Picon

ascii[194] chars

i am using reStructuredText (html.py) to generate a FAQ in html. 
everything works fine except that i see ascii char 194 after each of the 
numeric headings:

web page:
3.12Â Â Â Why don't short words or long words show up in the clues?

$ od -b
302 240 302 240 127 150 171 040 144 157 156 047 164 040 163 150

$ od -c
              W   h   y       d   o   n   '   t       s   h

it doesn't happen for any other whitespace chararcter. others have used 
the same text file to generate html pages without this problem. i am 
running reST on linux (2.4.20-13.9) with the docutils package i pulled 
down a few days ago.

any ideas why this is happening?

thanks

b

-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
bill parducci | 2 Jun 17:09 2003
Picon

Re: ascii[194] chars

sure:

http://parducci.net/faq.html

thanks

b

David Goodger wrote:
> I'm not sure what the problem is.  Do you have a URL (temporary's OK) to 
> the generated HTML file, so I can see?

-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
David Goodger | 2 Jun 17:14 2003

Re: ascii[194] chars

bill parducci wrote:
> i am using reStructuredText (html.py) to generate a FAQ in html. 
> everything works fine except that i see ascii char 194 after each of the 
> numeric headings:

Three non-breaking spaces (&#xa0;/&#160;) are inserted after each 
generated section number in titles.  You're seeing the UTF-8 encodings 
of these characters (2 bytes per nbsp character, 194 + 160).

> any ideas why this is happening?

I'm not sure what the problem is.  Do you have a URL (temporary's OK) to 
the generated HTML file, so I can see?

--

-- 
David Goodger    http://starship.python.net/~goodger

Programmer/sysadmin for hire: http://starship.python.net/~goodger/cv

-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
David Goodger | 2 Jun 17:28 2003

Re: ascii[194] chars

bill parducci wrote:
> http://parducci.net/faq.html

The original of that, <http://spambayes.sourceforge.net/faq.html>, 
doesn't have the problem.  It looks like the data is being corrupted 
somehow.

The XML declaration and HTML headers of the parducci.net copy both say 
UTF-8, but my browser (Mozilla 1.3) doesn't recognize it.  Mozilla 
thinks it's Latin-1 (ISO-8859-1).  When I force Mozilla to use UTF-8, it 
looks fine.  When I download the HTML source and look at it locally, it 
looks fine.  I suspect your server isn't transmitting the text encoding 
information properly.

If you can't fix your server, try setting "--output-encoding=latin-1" on 
the Docutils command line (or set it in your docutils.conf file; see 
<http://docutils.sf.net/docs/tools.html>).

--

-- 
David Goodger    http://starship.python.net/~goodger

Programmer/sysadmin for hire: http://starship.python.net/~goodger/cv

-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
David Goodger | 2 Jun 17:33 2003

Re: exponent

William Dode wrote:
> How can we use exponent with rst ?

A "superscript"/"sup" interpreted text role is in the to-do list:

     XV :sup:`e` century

I'll implement it before long.

> We can use substitution like this :
> 
> XV |e| century
> 
> .. |e| raw:: html
> 
>  <sup>e</sup>
> 
> But we need a raw for each writer

That's an indication that it is not the ideal solution.

> and the space between XV and e is not typographic

You can backslash-escape the space to get rid of it:

     XV\ |e| century

     XV\ :sup:`e` century

 > (there is the same problem with notes)
(Continue reading)

William Dode | 2 Jun 18:38 2003
Picon

Re: exponent

David Goodger <goodger <at> python.org> writes:

> William Dode wrote:
> > How can we use exponent with rst ?
> 
> A "superscript"/"sup" interpreted text role is in the to-do list:
> 
>      XV :sup:`e` century
> 
> I'll implement it before long.

ok, it's fine

> 
> > We can use substitution like this :
> > XV |e| century
> > .. |e| raw:: html
> >  <sup>e</sup>
> > But we need a raw for each writer
> 
> That's an indication that it is not the ideal solution.
> 
> > and the space between XV and e is not typographic
> 
> You can backslash-escape the space to get rid of it:
> 
>      XV\ |e| century
> 
>      XV\ :sup:`e` century
> 
(Continue reading)

bill parducci | 2 Jun 19:09 2003
Picon

Re: ascii[194] chars

David Goodger wrote:
> The original of that, <http://spambayes.sourceforge.net/faq.html>, 
> doesn't have the problem.  It looks like the data is being corrupted 
> somehow.

well, it has the utf encoding to match the xml header info, it that's 
what you mean :) (the octal dumps i sent you were from from the html 
file itself.) so, it 'has the problem' in the sense that it is utf-8 
encoded by html.py...

> The XML declaration and HTML headers of the parducci.net copy both say 
> UTF-8, but my browser (Mozilla 1.3) doesn't recognize it.  Mozilla 
> thinks it's Latin-1 (ISO-8859-1).  When I force Mozilla to use UTF-8, it 
> looks fine.  When I download the HTML source and look at it locally, it 
> looks fine.  I suspect your server isn't transmitting the text encoding 
> information properly.

actually, the server is saying that it is ISO-8859-1 (the default 
charset for the server):

     HTTP/1.1 200 OK\r\n
     Date: Mon, 02 Jun 2003 16:24:05 GMT\r\n
     Server: Apache/2.0.40 (Red Hat Linux)\r\n
     Last-Modified: Mon, 02 Jun 2003 14:21:22 GMT\r\n
     ETag: "53db8-b13b-bda89c80"\r\n
     Accept-Ranges: bytes\r\n
     Content-Length: 45371\r\n
     Connection: close\r\n
     Content-Type: text/html; charset=ISO-8859-1\r\n
     \r\n
(Continue reading)

David Goodger | 2 Jun 19:34 2003

Re: exponent

William Dode wrote:
>>> (there is the same problem with notes)
>>
>>I don't understand.
> 
> We need a space before a note [#]_ it's fragile, we often forget to
> write it...

I see: "footnotes".  Examples are very helpful, thanks! ;-)

> What is the reason to don't allow a note without space before ?
> like this[#]_ because this\ [#]_ begin to be difficult to read...

ReStructuredtext requires whitespace or punctuation before and after all
inline markup.  This makes parsing unambiguous, for software and wetware
(people) too.  When I see "this[1]_", the first thing I think of is an
indexed list/array; I don't notice the "_".  And in "this[#]_", is the
"_" indicating a footnote reference from "[#]", or a hyperlink reference
from "this[#]"?  To disambiguate, the former requires whitespace
("this [#]_"), and the latter requires backquotes ("`this[#]`_").

For rendering, it would be possible to have footnote references remove 
the preceding whitespace.  Perhaps this could be an option.

--

-- 
David Goodger    http://starship.python.net/~goodger

Programmer/sysadmin for hire: http://starship.python.net/~goodger/cv

-------------------------------------------------------
(Continue reading)

William Dode | 2 Jun 21:57 2003
Picon

Re: exponent

David Goodger <goodger <at> python.org> writes:

> > What is the reason to don't allow a note without space before ?
> > like this[#]_ because this\ [#]_ begin to be difficult to read...
> 
> ReStructuredtext requires whitespace or punctuation before and after all
> inline markup.  This makes parsing unambiguous, for software and wetware
> (people) too.  When I see "this[1]_", the first thing I think of is an
> indexed list/array; I don't notice the "_".  And in "this[#]_", is the
> "_" indicating a footnote reference from "[#]", or a hyperlink reference
> from "this[#]"?  To disambiguate, the former requires whitespace
> ("this [#]_"), and the latter requires backquotes ("`this[#]`_").
> 
> For rendering, it would be possible to have footnote references remove
> the preceding whitespace.  Perhaps this could be an option.

I understand, it's what i did, a customized writer. An option could be
good (i'll try to do it). Also we could add an option to have a warning 
for ambiguous markup.
Or an external checker, with options to warn things like that...

--

-- 
William Dode - http://flibuste.net

-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5

Gmane