GithubHelp home page GithubHelp logo

sindresorhus / gulp-markdown-pdf Goto Github PK

View Code? Open in Web Editor NEW
65.0 6.0 9.0 26 KB

Markdown to PDF

License: MIT License

JavaScript 100.00%
gulp-plugin javascript markdown-pdf nodejs markdown pdf converter

gulp-markdown-pdf's Introduction

gulp-markdown-pdf

Markdown to PDF with markdown-pdf

Issues with the output should be reported on the markdown-pdf issue tracker.

Install

npm install --save-dev gulp-markdown-pdf

Usage

import gulp from 'gulp';
import markdownPdf from 'gulp-markdown-pdf';

export default () => (
	gulp.src('intro.md')
		.pipe(markdownPdf())
		.pipe(gulp.dest('dist'))
);

API

markdownPdf(options?)

See the markdown-pdf options.

gulp-markdown-pdf's People

Contributors

kenany avatar kgrubb avatar ntwb avatar paultuckey avatar richienb avatar sindresorhus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gulp-markdown-pdf's Issues

cssPath relative root

According to the markdown-pdf docs, cssPath is relative to the html5bp root. This is fine for markdown-pdf module, but in gulp-markdown-pdf it becomes messy:

gulp.task('pdf', function() {
  return gulp.src('index.md')
    .pipe(markdownpdf({
      cssPath: '../../../../../css/main.css'
    }))
    .pipe(gulp.dest('./'));
});

It would be nice if cssPath was relative to the project root.

Images don't appear in PDF

Hello.
Images don't appear in the PDF.
I found a work around by changing the links to the images from relative to absolute but that means that I can move my markdown documents to another machine.
It was suggested to use preProcessHtml option to prefix a full path to a relative image src.
I would really appreciate if you could provide some example code for the gulp file so I could make that happen.
Thanks for making great software and giving it away for free.
Best wishes,
Tony

Need help using gulp-markdown-pdf with highlight.js

I have some coding in my markdown

var hello = 'Hello World';
function sayHello() {
    console.log(hello);
}

How do I use it with highlight.js so this coding can be marked as <pre><code class="javascript">...</code></pre> in the html process before transforming into pdf

I have a css file for highlight style but don't understand about the markdown to html transforming process

gulp.task('pdf', function() {
gulp.src(paths.src)
    .pipe(markdownPdf({
        cwd: __dirname,
        cssPath: 'css/markdownpad.css',
        highlightCssPath: 'css/github.css',
    }))
    .pipe(gulp.dest(paths.dest));
});

Please guide
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.