github-flavored-markdown-to-html icon indicating copy to clipboard operation
github-flavored-markdown-to-html copied to clipboard

Embedding CSS for single-file / one file / standalone HTML not working in commandline

Open johentsch opened this issue 2 years ago • 0 comments

Goal

The documentation states:

  • Some common use cases: ...
    • having everything in one file: use -i -c to have everything in one file.

This is consistent with the documentation of the -c argument which states:

  • --css-paths (or -c): You can leave this empty to disable storing the CSS in an external CSS file (useful e.g. if you want to convert only one file)

I would like to convert my README.md into a standalone README.html that does not depend on any other files so I run

gh-md-to-html README.md -c -i 

Bug

The CSS is outsourced to the default folder github-markdown-css

.
├── github-markdown-css
│   ├── code-navigation-banner-illo.svg
│   └── github-css.css
└── README.html

and embedded in the second line of the HTML file which reads

<link href="/github-markdown-css/github-css.css" rel="stylesheet"/>

Desired behaviour

Only a single file, README.html should be created which has the CSS embedded.

Other attempts

Equally unsuccessful:

gh-md-to-html -c -i -- README.md
gh-md-to-html README.md -c -i -o OFFLINE
gh-md-to-html README.md -c -i -o OFFLINE+

Setup

gh-md-to-html==1.21.2
python==3.11.4

johentsch avatar Sep 20 '23 19:09 johentsch