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

Rendered Markdown styling and choose what information to print #47

Closed
zePanzerfaust opened this issue Sep 25, 2019 · 9 comments
Closed

Comments

@zePanzerfaust
Copy link

Used version
VS Code Printing Free 0.7.12
VS Code version 1.38.1

I don't know who where and when markdown styling is applied, but would it be possible to have more control over the printed rendered markdown?

Here is an example of a rendered markdown print with Visual Studio 2019 and Markdown Editor extension
vs-markdown-editor

The same file with this plugin
vsc-printing-header-table
vsc-printing-footer

@PeterWone
Copy link
Collaborator

image
image

@PeterWone
Copy link
Collaborator

PeterWone commented Sep 25, 2019

Are you satisfied with this as a solution?

If so, please close the issue.

@zePanzerfaust
Copy link
Author

It's sufficient for the header and footer yes, thank you.
Do you also know how to get styling when using a table as in the image? Or underlining a header?
Can I modify a css or something? Or is this css embedded in the code?

@PeterWone
Copy link
Collaborator

PeterWone commented Sep 26, 2019

Markdown rendering is done by VS Code, not by the printing extension, and VS Code does support the injection of CSS. There is an example of how to do this in the section of the manual concerning KaTeX

"markdown.styles": [
  "https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css"
]

Perhaps I should explicitly call out this information with its own section.

You should also be able to embed CSS directly into your Markdown simply by embedding an HTML <style> block with CSS in it.

<style>
  H1 { font-family: "Comic Sans MS";  }
</style>

# Please stop using Comic Sans
It's horrible. This sample didn't work in GitHub but it worked ok with VS Code. 
At least it did after I fixed the font name.

I'm a bit busy at the moment but I will give some thought on making it more convenient to add your own stylesheet references. Remember that if you use separate stylesheets then either they must be on some globally accessible URL like the KaTeX stylesheet or you must use a relative path and ensure the files remain in the same relative positions. This is pretty fragile so it would be safer to just embed.

@zePanzerfaust
Copy link
Author

Yeah while relative paths are not the best, embedding css clutters up the content too much.
Maybe VS Code will add some other possibilities in the future.
But thank you for the information that's fine for now.

@ryanwwest
Copy link

I would like to be able to modify some, but not all, of the header/footer info. Specifically, I want to hide the date and bottom-left 'localhost' text, and include the full filepath (not just the filename) at the top. Is this possible? I can make a new issue if that would be better.

@PeterWone
Copy link
Collaborator

@ryanwwest yes it would be better to open a new issue.

Actually implementing this is problematic, but I understand why you would want it. After you create the issue I'll explain why it's harder than it looks and how I think I might go about it.

@PeterWone
Copy link
Collaborator

@ryanwwest I just re-read your message and you may be able to achieve your goals which are not as difficult as full control of headers and footers. I'll expand when you open the issue.

@ryanwwest
Copy link

Thanks. See #163.

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

3 participants