## docutils-develop — For developer discussions of the implementation.

You can subscribe to this list here.

2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 Jan Feb Mar Apr (5) May (27) Jun (22) Jul (72) Aug (82) Sep (86) Oct (138) Nov (100) Dec (62) Jan (122) Feb (147) Mar (92) Apr (82) May (101) Jun (153) Jul (37) Aug (34) Sep (46) Oct (46) Nov (6) Dec (38) Jan (64) Feb (81) Mar (36) Apr (194) May (329) Jun (272) Jul (68) Aug (74) Sep (150) Oct (57) Nov (62) Dec (63) Jan (78) Feb (30) Mar (137) Apr (78) May (54) Jun (122) Jul (72) Aug (110) Sep (80) Oct (75) Nov (125) Dec (79) Jan (100) Feb (15) Mar (41) Apr (67) May (30) Jun (11) Jul (14) Aug (22) Sep (20) Oct (14) Nov (11) Dec (15) Jan (17) Feb (16) Mar (35) Apr (21) May (33) Jun (50) Jul (12) Aug (7) Sep (2) Oct (6) Nov (5) Dec (2) Jan (14) Feb (20) Mar (35) Apr (9) May (57) Jun (21) Jul (42) Aug (4) Sep (13) Oct (76) Nov (40) Dec (55) Jan (26) Feb (15) Mar (3) Apr (67) May (32) Jun (39) Jul (59) Aug (31) Sep (59) Oct (64) Nov (21) Dec (10) Jan (21) Feb (3) Mar (116) Apr (33) May (9) Jun (28) Jul (21) Aug (23) Sep (146) Oct (70) Nov (31) Dec (57) Jan (33) Feb (22) Mar (11) Apr (21) May (51) Jun (47) Jul (35) Aug (26) Sep (25) Oct (34) Nov (61) Dec (51) Jan (75) Feb (31) Mar (26) Apr (16) May (24) Jun (24) Jul (31) Aug (46) Sep (36) Oct (28) Nov (37) Dec (21) Jan (16) Feb (56) Mar (31) Apr (44) May (45) Jun (29) Jul (38) Aug (18) Sep (12) Oct (16) Nov (21) Dec (11) Jan (13) Feb (14) Mar (28) Apr (7) May (72) Jun (33) Jul (21) Aug (1) Sep (6) Oct (14) Nov (18) Dec (22) Jan (23) Feb (108) Mar (76) Apr (114) May (60) Jun (9) Jul (8) Aug Sep Oct Nov Dec
S M T W T F S

1
(4)
2

3

4
(1)
5

6

7
(1)
8
(2)
9

10
(8)
11
(9)
12

13

14
(2)
15
(4)
16
(1)
17
(2)
18
(1)
19

20
(1)
21
(1)
22
(1)
23
(2)
24
(2)
25
(6)
26
(5)
27
(1)
28
(6)
29
(1)
30

Showing results of 61

<< < 1 2 3 (Page 3 of 3)
 [Docutils-develop] math in HTML From: Guenter Milde - 2011-11-10 08:33:58 Dear list, currently, HTML math output defaults to embedded MathML: :MathML: Embed math content as presentational MathML_. Pro: The W3C recommendation for math on the web. Self-contained documents (no JavaScript, no external downloads). Con: Docutil's latex2mathml converter supports only a small subset of LaTeX syntax. With the "html4css1" writer, the resulting HTML document does not validate, as there is no DTD for MathML + XHTML Transitional. However, MathML-enabled browsers will render it fine. To avoid generating invalid HTML, options are: a) a different math-output default b) a different HTML format. We need a consensus/decision on how to procede. Different math-output default ============================= Sensible alternatives for the html4css1 writer are: :MathJax: Format math for display with MathJax_, a JavaScript-based math rendering engine that uses HTML/CSS, JavaScript, and unicode fonts for high-quality typesetting that is scalable and prints at full resolution. Pro: Works 'out of the box' across multiple browsers and platforms. Supports a large subset of LaTeX math commands and constructs (see http://www.mathjax.org/docs/1.1/tex.html). Con: Requires an Internet connection or a local MathJax installation. :HTML: Format math in standard HTML enhanced by CSS rules Requires the math.css stylesheet (stored in the same installation-dependent directory as the default stylesheet If HTML output is chosen as default, the math.css stylesheet (~250 lines) would need to be either * included in the default style sheet * auto-loaded if a document needs math different HTML format ===================== The html_strict writer generates valid XHTML + MathML:: ; if the document contains math and math-output is MathML (which should be kept as default for this writer). The writer currently resides in the sandbox. It could be moved to the core, if there is agreement on this beeing sensible. Günter 
 Re: [Docutils-develop] Docutils 0.8.2 release? From: Guenter Milde - 2011-11-10 08:21:10 On 2011-11-10, Arfrever Frehtes Taifersar Arahesis wrote: > [-- Type: text/plain, Encoding: quoted-printable --] > Since 0.8.1 release, there were some useful fixes (e.g. r7126, r7196). > Maybe Docutils 0.8.2 could be released? I would like to find a decision for the "math in HTML problem" first. Currently, with the default settings the html4css1 writer produces invalid HTML when math is used (see the separate thread). With a long awaited new directive, - reStructuredText "code" role and directive with syntax highlighting by Pygments_. - "code" option of the "include" directive. I suggest to call it 0.9. Günter 
 [Docutils-develop] Docutils 0.8.2 release? From: Arfrever Frehtes Taifersar Arahesis - 2011-11-10 02:33:46 Attachments: signature.asc Since 0.8.1 release, there were some useful fixes (e.g. r7126, r7196). Maybe Docutils 0.8.2 could be released? -- Arfrever Frehtes Taifersar Arahesis 
 [Docutils-develop] [ docutils-Patches-3433595 ] Support for more latex math symbols From: SourceForge.net - 2011-11-08 13:36:40 Patches item #3433595, was opened at 2011-11-04 10:01 Message generated for change (Comment added) made by milde You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3433595&group_id=38414 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Stefan Seefeld (stefan) Assigned to: Nobody/Anonymous (nobody) Summary: Support for more latex math symbols Initial Comment: The math support in docutils is a little lacking (and inconsistent). Using the following in ReST: j = 1, 2, …, N-1 will raise an error: the parser correctly recognizes the ellipses, mapping them to 'ldots'. However, the mathml generator then doesn't recognize that symbol and throws an error. The attached patch defines the back mapping from 'ldots' to ' …' to fix this. I took the opportunity to also add support for \gets and \to at the same time (which are aliases to \leftarrow and \rightarrow. ---------------------------------------------------------------------- >Comment By: Günter Milde (milde) Date: 2011-11-08 05:36 Message: Thanks for the patch. I took the chance to add support for a large set of commands matching Unicode characters via a helper module generated from the "unimathchars" database http://milde.users.sourceforge.net/LUCR/Math/ . Math support in formats other than LaTeX is inconsistent, as it largely depends on third party software (except for the unfinished latex2mathml module). Currently, the most complete solution for HTML output is MathJax. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3433595&group_id=38414 
 [Docutils-develop] [ docutils-Patches-3434887 ] latex2e: Propagate figure align to image From: SourceForge.net - 2011-11-08 10:31:01 Patches item #3434887, was opened at 2011-11-08 02:31 Message generated for change (Tracker Item Submitted) made by kirr79 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3434887&group_id=38414 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Kirill Smelkov (kirr79) Assigned to: Nobody/Anonymous (nobody) Summary: latex2e: Propagate figure align to image Initial Comment: latex2e: Propagate figure align to image Previously figure alignment was not taken into account for embedding-in-fugure images -- images were always center-aligned. Fix it, by propagating figure's alignment to image, centering by default. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3434887&group_id=38414 
 [Docutils-develop] [ docutils-Patches-3434355 ] Fix --record-dependencies crashing on non-ascii filenames From: SourceForge.net - 2011-11-07 10:44:38 Patches item #3434355, was opened at 2011-11-07 02:44 Message generated for change (Tracker Item Submitted) made by kirr79 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3434355&group_id=38414 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Kirill Smelkov (kirr79) Assigned to: Nobody/Anonymous (nobody) Summary: Fix --record-dependencies crashing on non-ascii filenames Initial Comment: e.g. for the following example ---- 8< ---- (hello.txt) Hello .. include:: мир.txt ---- 8< ---- (мир.txt) World it crashes: \$ rst2xetex --traceback --record-dependencies hello.dep hello.txt Traceback (most recent call last): File "/home/kirr/src/tools/txt/docutils/docutils/tools/rst2xetex", line 26, in publish_cmdline(writer_name='xetex', description=description) File "/home/kirr/src/tools/txt/docutils/docutils/docutils/core.py", line 339, in publish_cmdline config_section=config_section, enable_exit_status=enable_exit_status) File "/home/kirr/src/tools/txt/docutils/docutils/docutils/core.py", line 211, in publish self.settings) File "/home/kirr/src/tools/txt/docutils/docutils/docutils/readers/__init__.py", line 69, in read self.parse() File "/home/kirr/src/tools/txt/docutils/docutils/docutils/readers/__init__.py", line 75, in parse self.parser.parse(self.input, document) File "/home/kirr/src/tools/txt/docutils/docutils/docutils/parsers/rst/__init__.py", line 162, in parse self.statemachine.run(inputlines, document, inliner=self.inliner) File "/home/kirr/src/tools/txt/docutils/docutils/docutils/parsers/rst/states.py", line 170, in run input_source=document['source']) File "/home/kirr/src/tools/txt/docutils/docutils/docutils/statemachine.py", line 237, in run context, state, transitions) File "/home/kirr/src/tools/txt/docutils/docutils/docutils/statemachine.py", line 458, in check_line return method(match, context, next_state) File "/home/kirr/src/tools/txt/docutils/docutils/docutils/parsers/rst/states.py", line 2283, in explicit_markup nodelist, blank_finish = self.explicit_construct(match) File "/home/kirr/src/tools/txt/docutils/docutils/docutils/parsers/rst/states.py", line 2295, in explicit_construct return method(self, expmatch) File "/home/kirr/src/tools/txt/docutils/docutils/docutils/parsers/rst/states.py", line 2036, in directive directive_class, match, type_name, option_presets) File "/home/kirr/src/tools/txt/docutils/docutils/docutils/parsers/rst/states.py", line 2087, in run_directive result = directive_instance.run() File "/home/kirr/src/tools/txt/docutils/docutils/docutils/parsers/rst/directives/misc.py", line 70, in run self.state.document.settings.record_dependencies.add(path) File "/home/kirr/src/tools/txt/docutils/docutils/docutils/utils.py", line 682, in add print >>self.file, filename UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128) Fix it, by writing counterpart to decode_path() and using it when writing dependency filenames out. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3434355&group_id=38414 
 [Docutils-develop] [ docutils-Patches-3433595 ] Support for more latex math symbols From: SourceForge.net - 2011-11-04 17:01:14 Patches item #3433595, was opened at 2011-11-04 10:01 Message generated for change (Tracker Item Submitted) made by stefan You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3433595&group_id=38414 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Stefan Seefeld (stefan) Assigned to: Nobody/Anonymous (nobody) Summary: Support for more latex math symbols Initial Comment: The math support in docutils is a little lacking (and inconsistent). Using the following in ReST: j = 1, 2, …, N-1 will raise an error: the parser correctly recognizes the ellipses, mapping them to 'ldots'. However, the mathml generator then doesn't recognize that symbol and throws an error. The attached patch defines the back mapping from 'ldots' to ' …' to fix this. I took the opportunity to also add support for \gets and \to at the same time (which are aliases to \leftarrow and \rightarrow. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=422032&aid=3433595&group_id=38414 
 Re: [Docutils-develop] how to write mixed elements with nodes.py From: Paul Tremblay - 2011-11-01 16:42:07 Attachments: Message as HTML On Tue, Nov 1, 2011 at 5:56 AM, Guenter Milde wrote: > On 2011-10-25, Paul Tremblay wrote: > > On 10/24/11 10:04 PM, David Goodger wrote: > >> On Mon, Oct 24, 2011 at 17:38, Paul Tremblay > wrote: > > ... > > > > However, this conversion is only required because the current XML writer > does not support raw content:: > > > <custonElement1> > <customElement2> > > > I'd prefer a more consistent way to deal with the problem: add this > capability to the XML writer. I know this means rather big changes to the > current XML writer, however > > * this would bring it in a line with the other docutils writers, > * a lot of required code could be taken from other writers. > Completely agree! > > This would also solve the "math" problem (without the need to convert an > XML string to a doctree and back to an XML string): Either the "math > transform" would generate raw XML (if so required) or the XML writer be > made to handle "math" nodes (convert to MathML and insert as raw). > > > It seems better to have the math transform do the conversion, since the conversion a string to XML, something more appropriate for a transform. As far as requiring a lot more code in the writer, I'm not so sure that is the case. I'm at work right now so I can't test this out, but I think you can simply iterate through the DOM, and print each element. When a math node is found, unescape this with the SAX.utils. unescpape function, and then print out that string. I'll have to see if this will work at home. If so, it would require very little additional code. I like your suggestion because it kills two birds with one stone--allowing for raw XML (my next suggested patch) and mathML, without the waste of conversion to a node and then to a string. Paul 
 Re: [Docutils-develop] how to write mixed elements with nodes.py From: Guenter Milde - 2011-11-01 09:56:40 On 2011-10-25, Paul Tremblay wrote: > On 10/24/11 10:04 PM, David Goodger wrote: >> On Mon, Oct 24, 2011 at 17:38, Paul Tremblay wrote: ... > The problem is I am trying to come up with a general function to convert > any XML string to docutils node, so I don't always know what elements I > will encounter. For example, > .. raw:: xml > > > Produces elements of unknown name, so I cannot create an Element class > for each. However, this conversion is only required because the current XML writer does not support raw content:: <custonElement1> <customElement2> I'd prefer a more consistent way to deal with the problem: add this capability to the XML writer. I know this means rather big changes to the current XML writer, however * this would bring it in a line with the other docutils writers, * a lot of required code could be taken from other writers. This would also solve the "math" problem (without the need to convert an XML string to a doctree and back to an XML string): Either the "math transform" would generate raw XML (if so required) or the XML writer be made to handle "math" nodes (convert to MathML and insert as raw). I'd like wait for Davids opinion on this issue before the actual implementation. 
 Re: [Docutils-develop] problems with name "math" used for modules From: Paul Tremblay - 2011-11-01 00:39:00 On 10/31/11 5:11 PM, David Goodger wrote: > On Sat, Oct 29, 2011 at 11:55, Paul Tremblay wrote: >> Using the name math for a directory, or for a module, can lead to >> unexpected results, namely because Python itself has a module named math. >> >> If I am in trunk/docutils/docutils (which has a directory called math), >> and type:: >> >> python3 # points to Python 3.2 > Don't do that. > > Never launch Python from inside a package. > Removing "." from your PYTHONPATH might help, but it's a band-aid solution. > > Within Docutils, we avoid issues by using absolute imports. All > imports should be rooted at "docutils": of the form "import > docutils.whatever.etc" or "from docutils.whatever import etc". > >> I suggest we rename the math directory. >> >> Likewise, I think I should rename the module math.py >> (trunk/docutils/docutils/transforms/math.py) to something different, >> such as math_rst.py > And io.py as well? Not gonna happen. Please adjust your behavior first. > Now I see. See my post above. 
 Re: [Docutils-develop] problems with name "math" used for modules From: Paul Tremblay - 2011-11-01 00:37:50 On 10/31/11 4:39 PM, Guenter Milde wrote: > On 2011-10-29, Paul Tremblay wrote: >> Using the name math for a directory, or for a module, can lead to >> unexpected results, namely because Python itself has a module named math. >> If I am in trunk/docutils/docutils (which has a directory called math), >> and type:: >> python3 # points to Python 3.2 >> I get the following error >> Fatal Python error: Py_Initialize: can't initialize sys standard streams >> File "io.py", line 96 >> return decoded.replace(u'\ufeff', u'') >> ^ >> SyntaxError: invalid syntax >> Abort trap: 6 > I cannot reproduce this:: > > ~/Code/Python/docutils-svn/docutils/docutils> python3 > Python 3.2.1rc1 (default, May 18 2011, 11:01:17) > [GCC 4.6.1 20110507 (prerelease)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> > >> However, even with pyton 2.7, I can create a seemingly bizarre problem: >> python >>>>> import tempfile >> Traceback (most recent call last): >> File "", line 1, in >> File >> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", >> line 34, in >> from random import Random as _Random >> File >> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", >> line 45, in >> from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil >> as _ceil >> ImportError: cannot import name log >> Python is looking for log in math, but sees the math directory first, >> and cannot import it. >> I suggest we rename the math directory. >> Likewise, I think I should rename the module math.py >> (trunk/docutils/docutils/transforms/math.py) to something different, >> such as math_rst.py > I am not sure about the need for this change. What is the general > recomendation for module/package names in Python? I am not aware of a "do > not use standard module names for your sub-packages/sub-modules" rule. On > the contrary, I've seen a recommendation to use "generic" names inside > packages. > > > if you really need to start a Python executable from this directory, you > might need to delete the pwd from the first position in sys.path (either > just delete or append instead of prepend). > > The jury is still out at > http://stackoverflow.com/questions/1959188/absolute-import-failing-in-subpackage-that-shadows-a-stdlib-package-name > > The problem is handles in http://www.python.org/dev/peps/pep-0328/ > and the solution are "absolute-imports" (available since 2.5) > > However, it states: > > As Python's library expands, more and more existing package internal > modules suddenly shadow standard library modules by accident. It's a > particularly difficult problem inside packages because there's no way > to specify which module is meant. > > This implies that it is not wise to use the name of a standard > module/package inside a custom package and we might e.g. use "mathematics" > instead. > > Thanks. I had thought the problem was more serious than it is. I had put at the top of docutils/transform/math.py:: import tempfile when I got the error message. I didn't realize the cause was my executing python from within docutils (where I was doing testing). I thought one couldn't use tempfile anywhere in a docutils module. (Note that I am not using it anyway.) Maybe I should not change math.py to mathmatics, since nothing has been committed? Paul `

Showing results of 61

<< < 1 2 3 (Page 3 of 3)