From: Leandro L. <ll...@gm...> - 2009-07-03 15:40:31
|
Hi, I saw image maps are not yet supported by docutils. I'd like to know is there is any big problem with image maps (for HTML output) or if it's not implemented just because nobody did it. Is there any way to add the usemap attribute to images to be able to, at least, use image maps with raw HTML? Thanks. -- Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/ ---------------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ---------------------------------------------------------------------------- A veces quisiera ser un avion, para volar como vuelo siendo humano, y no caerme como me caigo. |
From: David G. <go...@py...> - 2009-07-03 16:11:16
|
On Fri, Jul 3, 2009 at 11:37, Leandro Lucarella<ll...@gm...> wrote: > Hi, I saw image maps are not yet supported by docutils. I'd like to know > is there is any big problem with image maps (for HTML output) or if it's > not implemented just because nobody did it. Just that nobody has done it yet. It has been thought of before though: http://docutils.sourceforge.net/docs/ref/rst/directives.html#imagemap > Is there any way to add the usemap attribute to images to be able to, at > least, use image maps with raw HTML? On my personal web site's front page (http://python.net/~goodger), I just use the "raw" directive to import an image map (map, area, p, img tags) from a file: .. raw:: html :file: sitemap.html I found that managing an imagemap (that particular imagemap, anyhow) is an intensive manual process (using a 3rd-party GUI application, no less) that may not lend itself to reST-style markup. IOW, just use raw HTML; a reST solution isn't worth the effort. Maybe you can think of a way that makes it worth the effort though. -- David Goodger <http://python.net/~goodger> |
From: Leandro L. <ll...@gm...> - 2009-07-03 16:45:33
|
David Goodger, el 3 de julio a las 12:10 me escribiste: > On Fri, Jul 3, 2009 at 11:37, Leandro Lucarella<ll...@gm...> wrote: > > Hi, I saw image maps are not yet supported by docutils. I'd like to know > > is there is any big problem with image maps (for HTML output) or if it's > > not implemented just because nobody did it. > > Just that nobody has done it yet. It has been thought of before > though: http://docutils.sourceforge.net/docs/ref/rst/directives.html#imagemap > > > Is there any way to add the usemap attribute to images to be able to, at > > least, use image maps with raw HTML? > > On my personal web site's front page (http://python.net/~goodger), I > just use the "raw" directive to import an image map (map, area, p, img > tags) from a file: > > .. raw:: html > :file: sitemap.html > > I found that managing an imagemap (that particular imagemap, anyhow) > is an intensive manual process (using a 3rd-party GUI application, no > less) that may not lend itself to reST-style markup. IOW, just use raw > HTML; a reST solution isn't worth the effort. > > Maybe you can think of a way that makes it worth the effort though. What I really need is just the ability to associate an image map to an image. I agree that writing an image map by hand in a reST-style markup doesn't worth the effort and it's perfectly fine to just use raw HTML for the map itself. But being able to associate an image map to a reST image could be useful (and needs almost no work, all we need is to add a directive option for that). This is a small patch that can do that job: Index: parsers/rst/directives/images.py =================================================================== --- parsers/rst/directives/images.py (revisión: 6007) +++ parsers/rst/directives/images.py (copia de trabajo) @@ -43,6 +43,7 @@ 'scale': directives.percentage, 'align': align, 'target': directives.unchanged_required, + 'usemap': directives.uri, 'class': directives.class_option} def run(self): Index: writers/html4css1/__init__.py =================================================================== --- writers/html4css1/__init__.py (revisión: 6007) +++ writers/html4css1/__init__.py (copia de trabajo) @@ -941,6 +941,8 @@ def visit_image(self, node): atts = {} atts['src'] = node['uri'] + if 'usemap' in node: + atts['usemap'] = node['usemap'] if 'width' in node: atts['width'] = node['width'] if 'height' in node: This is useful for automatically generated images, which is why I need it =) Comments? -- Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/ ---------------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ---------------------------------------------------------------------------- Es mas posible, que un elefante maneje un cero km a que un camello habite un departamento de un ambiente. -- Peperino Pómoro |
From: Leandro L. <ll...@gm...> - 2009-07-18 03:55:30
|
Leandro Lucarella, el 3 de julio a las 13:41 me escribiste: > David Goodger, el 3 de julio a las 12:10 me escribiste: > > On Fri, Jul 3, 2009 at 11:37, Leandro Lucarella<ll...@gm...> wrote: > > > Hi, I saw image maps are not yet supported by docutils. I'd like to know > > > is there is any big problem with image maps (for HTML output) or if it's > > > not implemented just because nobody did it. > > > > Just that nobody has done it yet. It has been thought of before > > though: http://docutils.sourceforge.net/docs/ref/rst/directives.html#imagemap > > > > > Is there any way to add the usemap attribute to images to be able to, at > > > least, use image maps with raw HTML? > > > > On my personal web site's front page (http://python.net/~goodger), I > > just use the "raw" directive to import an image map (map, area, p, img > > tags) from a file: > > > > .. raw:: html > > :file: sitemap.html > > > > I found that managing an imagemap (that particular imagemap, anyhow) > > is an intensive manual process (using a 3rd-party GUI application, no > > less) that may not lend itself to reST-style markup. IOW, just use raw > > HTML; a reST solution isn't worth the effort. > > > > Maybe you can think of a way that makes it worth the effort though. > > What I really need is just the ability to associate an image map to an > image. I agree that writing an image map by hand in a reST-style markup > doesn't worth the effort and it's perfectly fine to just use raw HTML for > the map itself. But being able to associate an image map to a reST image > could be useful (and needs almost no work, all we need is to add > a directive option for that). > > This is a small patch that can do that job: > > Index: parsers/rst/directives/images.py > =================================================================== > --- parsers/rst/directives/images.py (revisión: 6007) > +++ parsers/rst/directives/images.py (copia de trabajo) > @@ -43,6 +43,7 @@ > 'scale': directives.percentage, > 'align': align, > 'target': directives.unchanged_required, > + 'usemap': directives.uri, > 'class': directives.class_option} > > def run(self): > Index: writers/html4css1/__init__.py > =================================================================== > --- writers/html4css1/__init__.py (revisión: 6007) > +++ writers/html4css1/__init__.py (copia de trabajo) > @@ -941,6 +941,8 @@ > def visit_image(self, node): > atts = {} > atts['src'] = node['uri'] > + if 'usemap' in node: > + atts['usemap'] = node['usemap'] > if 'width' in node: > atts['width'] = node['width'] > if 'height' in node: > > This is useful for automatically generated images, which is why I need it =) > > Comments? Is there any chance that this change goes into the trunk so it can be present en upcoming 0.6 release? -- Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/ ---------------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ---------------------------------------------------------------------------- Se va a licitar un sistema de vuelos espaciales mendiante el cual, desde una plataforma que quizás se instale en la provincia de Córdoba. Esas naves espaciales va a salir de la atmósfera, va a remontar la estratósfera y desde ahí elegir el lugar donde quieran ir de tal forma que en una hora y media podamos desde Argentina estar en Japón, en Corea o en cualquier parte. -- Carlos Saúl Menem (sic) |
From: Aahz <aa...@py...> - 2009-07-18 03:59:11
|
On Sat, Jul 18, 2009, Leandro Lucarella wrote: > > Is there any chance that this change goes into the trunk so it can be > present en upcoming 0.6 release? Did you submit a patch to SourceForge? -- Aahz (aa...@py...) <*> http://www.pythoncraft.com/ "The volume of a pizza of thickness 'a' and radius 'z' is given by pi*z*z*a" |
From: David G. <go...@py...> - 2009-07-18 04:38:08
|
On Fri, Jul 17, 2009 at 23:51, Leandro Lucarella<ll...@gm...> wrote: > Is there any chance that this change goes into the trunk so it can be > present en upcoming 0.6 release? Yes, and a good chance if the patch were more complete. In addition to code, we would need patches for the documentation (docs/ref/rst/directives.txt & docs/ref/docutils.dtd) & new tests. As is, there'd be a lot of work left. -- David Goodger <http://python.net/~goodger> |
From: Leandro L. <ll...@gm...> - 2009-07-18 05:30:28
|
David Goodger, el 18 de julio a las 00:37 me escribiste: > On Fri, Jul 17, 2009 at 23:51, Leandro Lucarella<ll...@gm...> wrote: > > Is there any chance that this change goes into the trunk so it can be > > present en upcoming 0.6 release? > > Yes, and a good chance if the patch were more complete. In addition to > code, we would need patches for the documentation > (docs/ref/rst/directives.txt & docs/ref/docutils.dtd) & new tests. As > is, there'd be a lot of work left. https://sourceforge.net/tracker/?func=detail&aid=2823466&group_id=38414&atid=422032 Please note that I don't know much about DTDs, so the patch to docutils.dtd can be wrong. Let me know if you need anything else. -- Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/ ---------------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ---------------------------------------------------------------------------- He andáu muchos caminos, muchos caminos he andáu, Chile tiene el buen vino y Suecia, el bacalao. Esta'o Unido tiene el hot do', Cuba tiene el mojito, Guatemala, el cornalito y Brasil la feishoada. |