Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS is not embedded in inlinehtml. #17

Open
matoken opened this issue May 5, 2020 · 6 comments
Open

CSS is not embedded in inlinehtml. #17

matoken opened this issue May 5, 2020 · 6 comments

Comments

@matoken
Copy link

matoken commented May 5, 2020

Export inlined html files don't have css embedded in them.
It seems to be looking at the CSS in absolute path.

$ head -13 ./slidesInlined.html
<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8">
  
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
    <link rel="stylesheet" href="/home/matoken/.vscode-oss/extensions/flobilosaurus.vscode-asciidoc-slides-1.2.0/libs/reveal.js/css/reset.css">
    <link rel="stylesheet" href="/home/matoken/.vscode-oss/extensions/flobilosaurus.vscode-asciidoc-slides-1.2.0/libs/reveal.js/css/reveal.css">
    <link rel="stylesheet" href="/home/matoken/.vscode-oss/extensions/flobilosaurus.vscode-asciidoc-slides-1.2.0/libs/league-gothic-font/webfonts
/stylesheet.css">
    <link rel="stylesheet" href="/home/matoken/.vscode-oss/extensions/flobilosaurus.vscode-asciidoc-slides-1.2.0/libs/reveal.js/css/theme/simple.
css">
    <link rel="stylesheet" href="/home/matoken/.vscode-oss/extensions/flobilosaurus.vscode-asciidoc-slides-1.2.0/libs/font-awesome/css/font-aweso
me.min.css">
    <link rel="stylesheet" href="/home/matoken/.vscode-oss/extensions/flobilosaurus.vscode-asciidoc-slides-1.2.0/libs/highlight.js/styles/monokai
.css">

The image is embedded correctly.

<img alt="kagolug" src="data:im
age/png;base64,iVBORw0KGgoAAAAN...

My environment is Linux(Debian sid amd64), so this may be a Linux-specific problem.

i use codium 1.44.2 and AsciiDoc Slides 1.2.0.

@sesceu
Copy link

sesceu commented May 6, 2020

+1 same issue here. I love the slides, but unfortunately, no-one else can look at them if I ship them. This kind of makes the inlinehtml feature useless.

On my generated slides, there is actually some additional inline style information (just below of the excerpt from @matoken). So apparently, there is some mechanism in place to inline CSS.

@sesceu
Copy link

sesceu commented May 6, 2020

Another remark. I guess this is not just about CSS, but also about the reveal.js initialization at the end of the document, i.e.

  <script src="/home/q343319/.vscode/extensions/flobilosaurus.vscode-asciidoc-slides-1.2.0/libs/highlight.js/lib/highlight.js"></script>
  <script src="/home/q343319/.vscode/extensions/flobilosaurus.vscode-asciidoc-slides-1.2.0/libs/reveal.js/js/reveal.js"></script>
  
  


<script>
    Reveal.initialize({
        hash: true,
        history: true,
        dependencies: [
            { src: '/home/q343319/.vscode/extensions/flobilosaurus.vscode-asciidoc-slides-1.2.0/libs/reveal.js/plugin/notes/notes.js', async: true } 
        ]
    })
</script>

<script type="text/javascript" src="/home/q343319/.vscode/extensions/flobilosaurus.vscode-asciidoc-slides-1.2.0/libs/reveal.js/plugin/zoom-js/zoom.js"></script>
<script type="text/javascript" src="/home/q343319/.vscode/extensions/flobilosaurus.vscode-asciidoc-slides-1.2.0/libs/reveal.js/plugin/highlight/highlight.js"></script>


  
</body>

</html>

Problem seems to be the templates in https://github.com/flobilosaurus/vscode-asciidoc-slides/tree/master/views. There is a placeholder <%= absolutePath %> used pretty regularly. I think rather than adding the files as references, their content should actually be inlined.

@flobilosaurus
Copy link
Owner

Okay thanks for your feedback. I will look into it later that day...

@flobilosaurus
Copy link
Owner

@matoken @sesceu Does the new version 1.3.0 solve your problems?

@sesceu
Copy link

sesceu commented May 8, 2020

Just tried the new version. Unfortunately, if I select the option Export slides to inlined Html file I get an error (see below). Calling Export slides to Html file however works, although images are of course not inlined.

Here is the error message:

Error while exporting: The file /home/me/git/slides/home/me/git/slides/foo/image.png was not found!

Seems to be a problem with the way the path for the image to be inlined is constructed. You may see, that /home/me/git/slides actually appears twice in the path.

@bentolor
Copy link

bentolor commented Dec 17, 2022

This feature doesn't seem to work for me as well. Regarding line count the result appears to be more or less 1:1 of the "regular" vs. "inline" version.

If this features makes problems, I'd recommend to remove it for now.

I'd suggest that it would be more important to be able to create a HTML file which uses relative paths only, so that someone can create at least some sort of portable presentation result using this plugin.

For now all exports will only work on a specific pc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants