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

Export using VS Code internal styles #112

Open
ldub opened this issue Nov 22, 2018 · 7 comments
Open

Export using VS Code internal styles #112

ldub opened this issue Nov 22, 2018 · 7 comments

Comments

@ldub
Copy link

ldub commented Nov 22, 2018

Out of the box, VC Code previews markdown in a dark mode. Is it possible to export HTML with this dark css built-in? I was not able to configure the settings to do that.

Example VS Code preview:

image

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 30.0 DAI (30.0 USD @ $1.0/DAI) attached to it.

@DanielShteinbok
Copy link

Correct me if I'm wrong: you want a CSS file that will mimic this dark look? That is, just background colour, text colour, and text font?

@gitcoinbot
Copy link

gitcoinbot commented Nov 23, 2018

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 6 months, 2 weeks ago.
Please review their action plans below:

1) obusorezekiel has started work.

I will use and cutomize the HTML built in styles to be able to export files using internal styles in VSCode
2) developerswork has started work.

I am working with Visual Code for such a long time I think I can help you

Learn more on the Gitcoin Issue Details page.

@ldub
Copy link
Author

ldub commented Nov 23, 2018

@DanielShteinbok correct, I need a custom CSS file that mimics the look of the VS Code preview. I can get pretty close with the following CSS that I cooked up, mostly from vscode sources: https://gist.github.com/ldub/63499cc15045f805baf674ced7ca1797

That CSS is not exactly correct, but has a bigger problem still.
Exporting to HTML looks fairly nice:
image

Exporting to PDF leaves white bars around the side:
image

Setting these settings in vscode:

"markdown-pdf.margin.bottom": "0",
"markdown-pdf.margin.left": "0",
"markdown-pdf.margin.right": "0",
"markdown-pdf.margin.top": "0"

and adding a body { margin: 1.5cm 1cm 1cm 1cm; } rule to the CSS creates a decent result:
image

But since the margin is set on the entire body, the line breaks have no padding:
image

So, in summation, if there is a pure-css way to make the white border disappear, then a CSS stylesheet is all I need. From my poking around I believe this may require a code change in the MarkdownPDF plugin itself, as the white border is something that Puppeteer adds (puppeteer options here: https://github.com/GoogleChrome/puppeteer/blob/v1.10.0/docs/api.md#pagepdfoptions , used here: https://github.com/yzane/vscode-markdown-pdf/blob/master/extension.js#L399 )

@ldub
Copy link
Author

ldub commented Nov 23, 2018

@aashutoshrathi I tried that stylesheet and it is the light mode one. Plus I believe the dark mode stylesheet would still leave the white border shown in the comment above.

@bobjiang
Copy link

Here is Bob Jiang from Gitcoin team.
Hi @DanielShteinbok are you still working on this issue?

@Melkor118
Copy link

Is this still being worked on? This would be a nice feature since the look and feel you develop is based on the dark mode.

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

5 participants