Open flicksolutions opened 1 month ago
Thanks for using this action, sorry you're having some problems.
This action only modifies markdown-style links ([name](URI)
) to make them absolute for the pages domain before using the Github API endpoint POST https://api.github.com/markdown
to render the HTML.
I tested a sample markdown file against this API endpoint as well as the POST https://api.github.com/markdown/raw
endpoint, and it appears that the Github renderer strips non-href
attributes.
There's nothing I can do about that outside of trying to raise an issue with Github to get the API functionality changed.
I'll leave this open as a reference for possibly providing an option to use an external or bundled renderer, but that's just not something that's going to be done anytime soon.
Thanks for your immediate feedback! I looked a little further into this and it seems to be intentional by Github for security reasons, therefore they probably won't change it.
Is there any other way to style the content with your action? Maybe provide our own index.css
with additional styles?
Well, the intent of this action is to render a page exactly as Github would render README files when browsing the repo, so there is not currently a way to inject additional CSS. Regarding a custom CSS file, are you talking about overriding the existing Github styles?
An additional input that specifies a single CSS file probably wouldn't be too much, but we're starting to get into the realm of other static-site generators and I would really like to avoid scope creep.
If you like most of the Github styling, they publish their stylesheets at primer/github-syntax-dark and primer/github-syntax-light. I pull both of those from NPM for this Action, so if you decide to go with some sort of Node-based static-site generator instead you could use those as well.
If you're willing to test something, I hammered out the initial idea I had for being able to add a custom CSS file.
You should be able to use the action off of the new branch if you specify the SHA instead of a version number:
c57a58c1eb398233b610378a18dc311a66a245a4
- uses: wranders/markdown-to-pages-action@c57a58c1eb398233b610378a18dc311a66a245a4
with:
custom_css: index.css
I tested it out, and it's almost working! The custom CSS file ends up in the artefact and is even included, but it points to the domain root.
My file is being imported like this in the head:
<link href="/custom.css" rel="stylesheet">
This would work for custom domains but not for GitHub pages that are usually in a path of the GitHub.io domain.
When I manually change the path, it works like a charm.
Thanks already for this!
Dangit, should've seen that. The main CSS is linked to the root for local development, but to the URL Pages is configured to used when deployed, so should've noticed that and would explain why I didn't.
Here's the updated SHA:
d83f73b992f56824d474cce0486054624488c808
this worked!!
Thank you for your help!
Awesome, thanks for being the guinea pig!
I'll close this with a PR when I clean it up and merge it. If I get the chance to integrate some other markdown processor that lets you retain HTML, I'll tag you in this and let you know.
Thanks again!
Bug Description / What Happened
Thank you for creating this action!
Certain attributes of HTML-Tags the we insert in our README.md are not making it into the final HTML. For example:
results in
Expected Behavior
results in
Steps to reproduce
include html in markdown and add attributes to tags. like
<a target="_blank">
orstyle
-Attributes.Additional Info
No response
OS
not applicable
Version
1
Logs
No response