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

No stylesheet when exporting to HTML #468

Closed
pagiraud opened this issue Sep 1, 2019 · 4 comments
Closed

No stylesheet when exporting to HTML #468

pagiraud opened this issue Sep 1, 2019 · 4 comments

Comments

@pagiraud
Copy link

pagiraud commented Sep 1, 2019

Hi,
I have several stylesheets. All are displayed in the live preview panel and Retext tries to use them as far as it can when exporting to PDF or even to ODT. But when I'm exporting to HTML, the stylesheet is not used at all : not even loaded in the sourcecode.

My current config :

[General]
highlightCurrentLine=true
lineNumbersEnabled=true
livePreviewByDefault=true
recentFileList=**********
spellCheck=true
styleSheet=/home/********/.config/ReText project/style.css
useWebKit=true

The header of a generated HTML file:

<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="generator" content="ReText 7.0.4">
<title>presentation_generale</title>
</head>
@mitya57
Copy link
Member

mitya57 commented Sep 2, 2019

Hi!

I would say that it is by design. The stylesheet is a local file on your machine. If I add <link rel="stylesheet" href="path/to/file.css"> to the generated file, and then you copy that HTML file to a remote server, the link will become dead.

However, there is a workaround. If you place the CSS file alongside your Markdown file and with the same basename (e.g.: mydocument.mkd, mydocument.css) then ReText will include the link.

Does that suit you?

@pagiraud
Copy link
Author

pagiraud commented Sep 2, 2019

Hi,
I get your point. Nevertheless, it is quite strange that the style gets used when exporting to some formats and not others. Maybe a solution (optional ?) would be to include the CSS code from the stylesheet directly in the HTML file, using <style></style> tags in the header, as this is something similar that is done with PDF and ODT.
Your solution doesn't quite fit my needs, as I have dozens .md files spread across a hierarchy of directories. But don't worry, I'll deal with it. For now, this is not a deal breaker. ;)

@mitya57 mitya57 closed this as completed in 2163a8a Sep 6, 2019
@mitya57
Copy link
Member

mitya57 commented Sep 6, 2019

OK, the stylesheet will be included now. Can you test master branch?

@pagiraud
Copy link
Author

pagiraud commented Sep 7, 2019

That's perfect! Thanks a lot.

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

2 participants