On Thu, Feb 28, 2008 at 11:55 AM, David Goodger <goodger@...> wrote:
> On Wed, Feb 27, 2008 at 11:48 PM, Nilton Volpato
> <nilton.volpato@...> wrote:
> > Any info/updates on this?
> I'm a bit busy these days.
> > On Thu, Feb 21, 2008 at 8:50 PM, Nilton Volpato
> > <nilton.volpato@...> wrote:
> > > Hi,
> > >
> > > Can this patch be merged to docutils trunk?
> Not as it stands, no.
> > > It solves two issues and is backwards compatible (will not break anything).
> It will break the tests though, and the documentation will have to be
> updated. If you'd like to see this patch included quickly, please fix
> affected tests, add tests for the new functionality, and update the
Ok. I'll work on that.
> > > - allows `docutils.nodes.image` to accept a style argument which is
> > > correctly included in the html by the html writer.
> This is a CSS style, correct? How would it be used? What is the
> problem that you're trying to solve here?
I wrote a directive (and role) for transforming math equations into
png using LaTeX. However I need to align the baseline of the image
with the baseline of the surrounding text, to do this I need to
generate html somewhat like this:
<p>Surrounding text <img alt="$|A| = |B|$" src="img1.png"
style="vertical-align: -4px" /> more text</p>
> -1. It's HTML-specific. Use a class instead, and add styles to your
> own stylesheet.
Doing like I mentioned above I can make the baselines match. However
for each generated image I need to use a different vertical-align, so
I can't use a class for this.
What if we add a `depth` argument to the image node? Otherwise, I can
use raw node.
> > > - adds an extra `tabular` class to tables (and not to other constructs
> > > implemented in html using table), which makes the job of css writers
> > > *much* easier.
> Why "tabular", and not just "table"?
I just thought that making a class with the same name as an html
element could be somewhat confusing. But I'm fine with table.
> -- David Goodger
> > > Thanks,
> > > -- Nilton
> > >
> > >
> > > Index: docutils/writers/html4css1/__init__.py
> > > ===================================================================
> > > --- docutils/writers/html4css1/__init__.py (revision 5513)
> > > +++ docutils/writers/html4css1/__init__.py (working copy)
> > > @@ -974,6 +974,8 @@
> > > atts[att_name] += 'px'
> > > style.append('%s: %s;' % (att_name, atts[att_name]))
> > > del atts[att_name]
> > > + if node.has_key('style'):
> > > + style.append(node['style'])
> > > if style:
> > > atts['style'] = ' '.join(style)
> > > atts['alt'] = node.get('alt', atts['src'])
> > > @@ -1358,7 +1360,7 @@
> > >
> > > def visit_table(self, node):
> > > self.body.append(
> > > - self.starttag(node, 'table', CLASS='docutils', border="1"))
> > > + self.starttag(node, 'table', CLASS='docutils tabular', border="1"))
> > >
> > > def depart_table(self, node):
> > > self.body.append('</table>\n')