Inlining styles in document (also: reporting)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Inlining styles in document (also: reporting)

Esteban A. Maringolo
Hi,

I need to export an HTML document from Seaside, which is done easily by
creating a new canvas builder and rendering a full document with it.

What I'm rendering in the exported document is very similar to what's
rendered on screen without a few "interactive" elements.

The issue I face is that I should include a minimum set of CSS rules in
the .html file to produce an output that looks as close as possible to
the one displayed on screen.

I've done this manually before to send styled HTML formatted mails, but
now I'd like to integrate something like bootstrap.css. Is there a way
to do it easily? Did anybody create something to ease this?

Also: It would be useful if this HTML output could be converted to PDF
and RTF/DOC/DOCX. For PDF I found wkhtml2pdf, but I couldn't find a
command line based converter for other formats.


Regards!

--
Esteban A. Maringolo
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Inlining styles in document (also: reporting)

Philippe Marschall
On Thu, Sep 13, 2018 at 8:25 PM Esteban A. Maringolo
<[hidden email]> wrote:

>
> Hi,
>
> I need to export an HTML document from Seaside, which is done easily by
> creating a new canvas builder and rendering a full document with it.
>
> What I'm rendering in the exported document is very similar to what's
> rendered on screen without a few "interactive" elements.
>
> The issue I face is that I should include a minimum set of CSS rules in
> the .html file to produce an output that looks as close as possible to
> the one displayed on screen.
>
> I've done this manually before to send styled HTML formatted mails, but
> now I'd like to integrate something like bootstrap.css. Is there a way
> to do it easily? Did anybody create something to ease this?

We have formal support for inline CSS and JavaScript in the upcoming
3.3.0 release [1]. It starts getting tricky when the CSS includes
links to images eg. for backgrounds. In these cases you could try to
"compile" the CSS and replace the image links with data URLs.

 [1] https://github.com/SeasideSt/Seaside/issues/839

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Inlining styles in document (also: reporting)

Paul DeBruicker
In reply to this post by Esteban A. Maringolo
For the CSS, since its a static file with known elements, could you use
something like


https://unused-css.com/




to create the minimum set of CSS rules and then just include them in the
HTML document <head> in your #updateRoot: method e.g.


MyComponent>>#updateRoot: anHTMLRoot

  anHTMLRoot addStyle: self minimumBootstrapCSSString



There may even be an "unused CSS remover" type tool with an API you could
use easily from within your app if the static file you're making changes
elements often.



No ideas about generating RTF/DOC/DOCX but would be interested in what you
learn.  





Esteban A. Maringolo wrote

> Hi,
>
> I need to export an HTML document from Seaside, which is done easily by
> creating a new canvas builder and rendering a full document with it.
>
> What I'm rendering in the exported document is very similar to what's
> rendered on screen without a few "interactive" elements.
>
> The issue I face is that I should include a minimum set of CSS rules in
> the .html file to produce an output that looks as close as possible to
> the one displayed on screen.
>
> I've done this manually before to send styled HTML formatted mails, but
> now I'd like to integrate something like bootstrap.css. Is there a way
> to do it easily? Did anybody create something to ease this?
>
> Also: It would be useful if this HTML output could be converted to PDF
> and RTF/DOC/DOCX. For PDF I found wkhtml2pdf, but I couldn't find a
> command line based converter for other formats.
>
>
> Regards!
>
> --
> Esteban A. Maringolo
> _______________________________________________
> seaside mailing list

> seaside@.squeakfoundation

> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside





--
Sent from: http://forum.world.st/Seaside-General-f86180.html
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside