Skip to content

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

@johentsch

Description

@johentsch

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions