* How to prevent CSS from being embedded? @ 2023-06-10 16:31 Mahela Munasinghe [not found] ` <CAPfJ9TiL1sEvMaMOa_Z1UVW_u6=Dz8xZOMaN_vqw36SP+A1EzQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 2+ messages in thread From: Mahela Munasinghe @ 2023-06-10 16:31 UTC (permalink / raw) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw [-- Attachment #1: Type: text/plain, Size: 1647 bytes --] Hello. I am using pandoc to convert some markdown study notes to html. The final html is hosted on GitHub pages so that I can access it from anywhere. Becuase my notes contain images, I have to use the --embed-resources option with pandoc in order for the html to display correctly. The problem arises when I went to add CSS to style the notes. I have found many css sheets to style the html. ( https://markdowncss.github.io/) However, because of the --embed-sources pandoc encodes the CSS as base 64 and somehow the CSS in the rendered HTML does not render on any browsers. I know the raw CSS itself works because I manually added the CSS to the html and it formats the page properly. I feel that if I can prevent the CSS from being encoded (even when using the --embed- resources option) and preserve it as a link to an external css, my page should display properly. I have searched for possible solutions and some posts suggest using a data-external="1" flag to prevent a source from being embedded. See here: https://github.com/jgm/pandoc/issues/8362#issuecomment-1272612851 But that describes how to do it for mathjax, not css. Could someone show me an example of how to do the same thing for css? Thank you! -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAPfJ9TiL1sEvMaMOa_Z1UVW_u6%3DDz8xZOMaN_vqw36SP%2BA1EzQ%40mail.gmail.com. [-- Attachment #2: Type: text/html, Size: 2604 bytes --] ^ permalink raw reply [flat|nested] 2+ messages in thread
[parent not found: <CAPfJ9TiL1sEvMaMOa_Z1UVW_u6=Dz8xZOMaN_vqw36SP+A1EzQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: How to prevent CSS from being embedded? [not found] ` <CAPfJ9TiL1sEvMaMOa_Z1UVW_u6=Dz8xZOMaN_vqw36SP+A1EzQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2023-06-21 1:27 ` John MacFarlane 0 siblings, 0 replies; 2+ messages in thread From: John MacFarlane @ 2023-06-21 1:27 UTC (permalink / raw) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw [-- Attachment #1: Type: text/plain, Size: 2701 bytes --] Does adding data-external="1" to your <link> tag for the stylesheet do the trick? If it's true, though, that browsers can't handle data URIs in the <link> tag, then we should change how pandoc embeds stylesheets. I hadn't heard that before. It would be worth putting up an issue on the tracker. > 7@gmail.com> wrote: > > Hello. > I am using pandoc to convert some markdown study notes to html. > The final html is hosted on GitHub pages so that I can access it from anywhere. > Becuase my notes contain images, I have to use the > --embed-resources option with pandoc in order for the html to display correctly. > > The problem arises when I went to add CSS to style the notes. > I have found many css sheets to style the html. (https://markdowncss.github.io/) > > However, because of the --embed-sources pandoc encodes the CSS as base 64 and somehow the CSS in the rendered HTML does not render on any browsers. > I know the raw CSS itself works because I manually added the CSS to the html and it formats the page properly. > > I feel that if I can prevent the CSS from being encoded (even when using the --embed- resources option) and preserve it as a link to an external css, my page should display properly. > I have searched for possible solutions and some posts suggest using a > data-external="1" flag to prevent a source from being embedded. > > See here: https://github.com/jgm/pandoc/issues/8362#issuecomment-1272612851 > > But that describes how to do it for mathjax, not css. > Could someone show me an example of how to do the same thing for css? > > Thank you! > > > -- > You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>. > To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAPfJ9TiL1sEvMaMOa_Z1UVW_u6%3DDz8xZOMaN_vqw36SP%2BA1EzQ%40mail.gmail.com <https://groups.google.com/d/msgid/pandoc-discuss/CAPfJ9TiL1sEvMaMOa_Z1UVW_u6%3DDz8xZOMaN_vqw36SP%2BA1EzQ%40mail.gmail.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/7D726040-F99B-44F5-A9CD-B256F4BD1AE5%40gmail.com. [-- Attachment #2: Type: text/html, Size: 4008 bytes --] ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-21 1:27 UTC | newest] Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2023-06-10 16:31 How to prevent CSS from being embedded? Mahela Munasinghe [not found] ` <CAPfJ9TiL1sEvMaMOa_Z1UVW_u6=Dz8xZOMaN_vqw36SP+A1EzQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2023-06-21 1:27 ` John MacFarlane
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).