jmaupetit / md2pdf

Markdown to PDF conversion tool
MIT License
268 stars 41 forks source link

Add custom style #30

Closed nothanks1 closed 4 years ago

nothanks1 commented 4 years ago

Hi. For example, in document i have construction " [someText]{.someStyle} "

How to update .css file for print "someText" in red.

jmaupetit commented 4 years ago

You can create a new stylesheet (e.g. styles.css) with your own .someStyle rule:

.someStyle {
  color: red;
}

... and add this CSS file to the command line options:

$ md2pdf --css styles.css foo.md foo.pdf
nothanks1 commented 4 years ago

Not work :/

foo.md include:

## Introduce

 This document prepared by [Red text here]{.critical} 
So sad. 
:(

## Tasks

And styles.css include:

.critical {
  color: red;
}

After run command: md2pdf --css styles.css foo.md foo.pdf

image

image

jmaupetit commented 4 years ago

Ok, as this extra syntax is not implemented in the markdown library we are using, you will need to mix HTML in markdown:

## Introduce

This document prepared by <span class="critical">Red text here</span>
nothanks1 commented 4 years ago

Well, thank u!