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

No css in rendered html #12

Open
Demonsthere opened this issue Sep 7, 2019 · 1 comment
Open

No css in rendered html #12

Demonsthere opened this issue Sep 7, 2019 · 1 comment

Comments

@Demonsthere
Copy link

Hi there,
I wanted to try this, as I usually use markdown for my dnd game notes and content, but I couldn't manage to get the CSS working.

I have a simple script that i run on my md files:

const Markdown = require('markdown-it');
const brewdown = require('brewdown');
var fs = require('fs');

const contentFile = "test.md";
const md = new Markdown().use(brewdown, {style: "two-col", pageSize: "letter"});
var content = fs.readFileSync(contentFile, "utf-8");
const html = md.render(content);
// console.log(html)
fs.writeFile('content.html', html, (err) => { 
    if (err) throw err;
})

But the result of an example from Your projects looks like this:
Zrzut ekranu 2019-09-7 o 13 58 12

Could you point me in the right direction here?
Cheers

@VictorK1902
Copy link

VictorK1902 commented Jan 13, 2020

So the way I did it is after running

npm install brewdown --save

brewdown should be installed to

node_modules\brewdown

There you will find

dist\js\brewdown.js
dist\styles\styles.css
dist\styles\images\...

You need to reference this styles.css in your output content.html. Just open the html file in a text editor and add a reference to the top of it. For example:

<link rel="stylesheet" href="dist/styles/styles.css">

Then save and double click on it. If everything is done right, it should render your content using the css correctly. It's my first time messing with this too. Hopefully I'm not missing anything here.


Unfortunately this doesn't seem to translate well to pdf-printing

c1
c2

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

2 participants