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

Feature request: per document settings #173

Open
regisin opened this issue Jan 27, 2020 · 5 comments
Open

Feature request: per document settings #173

regisin opened this issue Jan 27, 2020 · 5 comments

Comments

@regisin
Copy link

regisin commented Jan 27, 2020

I'm using markdown and this plugin for work and it works great. One thing that would be useful, although not urgent at all, would be to edit the settings on a per file basis. In my specific case I have some documents that need to be output in a single column (i.e. all the content will be on the left half of the page, while the right is blank). Since not all files I create need this specific setting, I find myself editing the "markdown-pdf.margin.right" property very often.

@thiloplanz
Copy link

I imagine this could take the form of a file x.markdown-pdf.json placed next to its x.md and it would provide an additional override using the same format as the Workspace configuration JSON.

@regisin
Copy link
Author

regisin commented Feb 18, 2020

That didn't work. But my workaround is to just subdivide those files into sub folders and use workspace settings instead.

I know md files have that front-matter with some settings at the top sometimes, for ex.:

---
title: something-that-wont-be-printed
---
# Header
Text

Could that be used somehow?

@Morikko
Copy link

Morikko commented Sep 14, 2022

Just sharing a workaround applicable for some type of settings, by using a style tag at the beginning of the markdown document:

For the case asked in the first message:

<style>
  body {  margin-right: 150px;}
</style>

Any valid CSS could be tried, like:

<style>
  @media print{@page {size: landscape}}
</style>

@goyalyashpal
Copy link

I came here in search of being able to specify the orientation (landscape) for an odd document.

the extension: jebbs.markdown-extended supports the following "per-file settings", i thought maybe yzane.markdown-pdf would be having something similar as well.

per-file settings inside markdown to override user settings
- export-configurations at qjebbs/vscode-markdown-extended/REAMDE.md#L82

---
puppeteer:
    pdf:
        format: A4
        displayHeaderFooter: true
        margin:
            top: 1cm
            right: 1cm
            bottom: 1cm
            left: 1cm
    image:
        quality: 90
        fullPage: true
---

contents goes here...

@reddishz
Copy link

已实现。 #376

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