ousia / from-pandoc-to-context

Environment to parse XHTML from pandoc with ConTeXt
http://www.from-pandoc-to-context.tk
GNU General Public License v2.0
13 stars 3 forks source link

context ignores css rules #23

Closed flaviolazzarini closed 4 years ago

flaviolazzarini commented 4 years ago

Thank you for this great repository. I was trying the example that you wrote, but I came up with an issue. The rules inside of the .css file are being ignored by context. I can convert without any problem to XML using pandoc (the CSS rules are being respected), but when I convert it to pdf using context the CSS file has no effect. Am I missing something?

I tried these two commands: pandoc -s --section-divs -o "document.xml" -t html doc/from-pandoc-to-context.md contextjit --purgeall --environment=../pandoc-xhtml --usemodule=from-pandoc-to-context document.xml

ousia commented 4 years ago

@flaviolazzarini,

I think CSS rules are out of the scope of ConTeXt XML handling.

I don’t think pandoc follows any CSS rule generating other documents. Of course, you may generate an ePub document with a stylesheet inside (but this is something different).

Or do you mean something different? (Please, include minimal samples.)

BTW, there is no from-pandoc-to-context module πŸ˜….

flaviolazzarini commented 4 years ago

@ousia Thank you for your reply. In your document, you explain how one can create hidden titles (page 26 in the A4 pdf). To achieve that you use the following snippet:

h1.hidden {
visibility: hidden; margin: 0%; padding: 0%; font-size: 0pt;
}

So I thought that you could somehow style your document using CSS. Maybe I didn't understand something. What do you use the .css file for?

BTW, there is no from-pandoc-to-context module πŸ˜….

I loaded your from-pandoc-to-context.tex as a module to test what would happen. Thought that was the right way to do it πŸ˜‚

ousia commented 4 years ago

In your document, you explain how one can create hidden titles (page 26 in the A4 pdf). To achieve that you use the following snippet:

h1.hidden {
visibility: hidden; margin: 0%; padding: 0%; font-size: 0pt;> 
}

So I thought that you could somehow style your document using CSS. Maybe I didn't understand something. What do you use the .css file for?

@flaviolazzarini, the CSS code for the h1.hidden selector is required for the ePub file.

I loaded your from-pandoc-to-context.tex as a module to test what would happen. Thought that was the right way to do it πŸ˜‚.

Technically speaking, a module is what you load using the \usemodule[...] command.

I hope your issues have been solved.

flaviolazzarini commented 4 years ago

the CSS code for the h1.hidden selector is required for the ePub file.

@ousia aha, now I see. Ok got it. Thank You!