cakebake / markdown-themeable-pdf

ARCHIVED. NOT MAINTAINED. Themeable Markdown Converter (Print to PDF, HTML, JPEG or PNG)
https://atom.io/packages/markdown-themeable-pdf
133 stars 37 forks source link

[Enhancement] Multiple output template #102

Closed nekloth closed 3 years ago

nekloth commented 6 years ago

In my day-to-day work, I write several different types of documents that could have different renders.

It could be interesting to be able to manage several export profiles, to be selected on PDF generation, each with a specific:

What do you think?

(By the way, thanks for the great job already done!)

cakebake commented 6 years ago

Thanks!

I think you mean overwriting CSS, header and footer per project. That is already possible: https://github.com/cakebake/markdown-themeable-pdf#custom-header--custom-footer

Tip: Alternatively, you can define with project-path/markdown-themeable-pdf/header.js or project-path/markdown-themeable-pdf/footer.js for each project its own header and footer.

Hmm, but you bring me to another idea... I would even go further and create a way (json file in this folder) to override all options if possible... Paper-Size, Margin, CSS file, Header, Footer, highlightJs Theme, ... and so on

nekloth commented 6 years ago

Thank you for the tip, but no, that is ot what I meant.

Let me explain, with a real use case.

I have a document, readme.md. I need to convert it with 3 different templates: one for internal local communication (with team logo), one for subsidiaries (with team and company logo) and one for external communication (with company logo only).

Using the custom header/footer in markdown-themeable-pdf folder, I can set up one of this template (let's say, internal).

But today, the only way I have to handle a second and thrid one, is to rename files in project folder, to let them be considered or not.

In addition to that, I cannot shared custom header/footer if I use the project folder's one (I will have then to copy/paste files for all my docs, and update will be a nightmare).

So, YES definitely, the idea of a JSON beside my MD including all you mentionned is the solution I expect! :)) I hope you'll be able to code that soon ! :))

May you need help to test, you can ping me!

Thanks!

cakebake commented 6 years ago

Your use is very special. I'll think about it.

That would be nice! Do you know a little about Atom? Otherwise, I will do a short tutorial on how to test an unpublished package version.

nekloth commented 6 years ago

No, my use is not so special: it reproduces exactly the principle of HTML/LaTeX --> split the content from the format ! :P That's what I like in MD :)))

Thank you for your time considering this need ! 👍

Unfortunately, no, I'm not skilled enough on Atom... A short tutorial will definitely help me, thank you!

cakebake commented 6 years ago

Your use is very special

I meant that you need different formats for each Convert at the same time. ;)

Maybe a config file would be so realizable:

{
  "default": {
    "format": "A4",
    "customStylesPath": "./path/to/file.css",
    ...
  },
  "internal": {
    "format": "A4",
    "customStylesPath": "./path/to/internal-file.css",
    ...
  },
  "fancyprofile": {
    ...
  },
  ...
}

The options of the respective profile override the global settings. For each profile, an output file is generated. :thinking:

nekloth commented 6 years ago

:) No problem, yes, my use is maybe special (but I am :P)

If in each profile you also include header.js, footer.js and global settings (margin, paper format, etc), yes, that could do the job !

How do you imagine the profile selection? At "Generate PDF" click? My idea was not to generate all the profile at once, but to have the possibility to choose one at generation time.

cakebake commented 5 years ago

Only the settings within the file with front matter have been added. Not the profiles.

This feature is implemented with a3ffd31b284d2872bfeeaad7c96af9bc899dd753. Documentation will follow.

cakebake commented 3 years ago

Hello, sorry, but I will no longer maintain the project.

This project is archived because the owner no longer uses the Atom Editor.

It would be very good to find a new owner for this project, who will take care of updating and expanding the Atom package. A new version based on Chrome Headless has already been prepared in a feature branch.