Re: HTML <div style="width:40%">

Gökçe Aydos <[email protected]>
Newsgroups gmane.text.docutils.user
Message-ID <[email protected]>
Thank you Günter and David. It makes sense that rST does not support 
direct styling — this is what stylesheets are for.

I'll explain the background of my question: Pandoc can generate beamer 
slides. For slides, it is also possible to generate columns and specify 
the width in Pandoc's Markdown as follows [1]:

:::::::::::::: {.columns}
::: {.column width="40%"}
contents...
:::
::: {.column width="60%"}
contents...
:::
::::::::::::::

This block generates the following HTML:

<div class="columns">
   <div class="column" style="width:40%;">
     <p>contents…</p>
   </div>
   <div class="column" style="width:60%;">
     <p>contents…</p>
   </div>
</div>

I wanted to do the same with rST. As you have suggested I tried with 
container:: and class:: directives, which could generate a beamer slide 
with columns in pandoc:

.. class:: columns

    .. class:: column

       - first

    .. class:: column

       - second

Note that also container:: directive can be used in the preceding 
example. I could not figure out how to create the style attribute when 
using rST as input in Pandoc. Although Pandoc accepts CSS for 
HTML/CSS-to-pdf output, it does not support CSS input along with rST I 
suppose. I will create a request for that.

Gökçe

[1] https://pandoc.org/MANUAL.html#columns


Am 2017-11-22 22:43, schrieb David Goodger:
> Yes, it's possible. But not recommended. Directly, the only way is
> with the "raw" directive:
> http://docutils.sourceforge.net/docs/ref/rst/directives.html#raw-data-pass-through
> But that is a last resort only. I do NOT recommend it.
> 
> What you're talking about is styling your HTML. You should use
> stylesheets for that:
> http://docutils.sourceforge.net/docs/howto/html-stylesheets.html
> 
> Use the "class" directive (or "class" option on an existing directive)
> to assign custom classes if necessary:
> http://docutils.sourceforge.net/docs/ref/rst/directives.html#class
> 
> What, in your document, are you trying to style?
> 
> David Goodger
> <http://python.net/~goodger>
> 
> 
> On Wed, Nov 22, 2017 at 8:55 AM, Gökçe Aydos
> <[email protected]> wrote:
>> Is it possible to generate HTML output as follows?
>> 
>> <div style="width:40%">
>> contents...
>> </div>
>> 
>> Regards, Gökçe
>> 
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Docutils-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/docutils-users
>> 
>> Please use "Reply All" to reply to the list.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Docutils-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.