Code Monkey home page Code Monkey logo

markdown-pdf's Introduction

markdown-pdf Build Status Dependency Status Coverage Status

Node module that converts Markdown files to PDFs.

The PDF looks great because it is styled by HTML5 Boilerplate. What? - Yes! Your Markdown is first converted to HTML, then pushed into the HTML5 Boilerplate index.html. Phantomjs renders the page and saves it to a PDF. You can even customise the style of the PDF by passing an optional path to your CSS and you can pre-process your markdown file before it is converted to a PDF by passing in a pre-processing function, for templating.

Install

npm install -g markdown-pdf --ignore-scripts

Note: elevated (sudo) permissions may be needed for npm install -g

Usage

Usage: markdown-pdf [options] <markdown-file-path>

Options:

  -h, --help                             output usage information
  -V, --version                          output the version number
  <markdown-file-path>                   Path of the markdown file to convert
  -c, --cwd [path]                       Current working directory
  -p, --phantom-path [path]              Path to phantom binary
  -h, --runnings-path [path]             Path to runnings (header, footer)
  -s, --css-path [path]                  Path to custom CSS file
  -z, --highlight-css-path [path]        Path to custom highlight-CSS file
  -m, --remarkable-options [json]        Options to pass to Remarkable
  -f, --paper-format [format]            'A3', 'A4', 'A5', 'Legal', 'Letter' or 'Tabloid'
  -r, --paper-orientation [orientation]  'portrait' or 'landscape'
  -b, --paper-border [measurement]       Supported dimension units are: 'mm', 'cm', 'in', 'px'
  -d, --render-delay [millis]            Delay before rendering the PDF
  -t, --load-timeout [millis]            Timeout before the page is rendered in case `page.onLoadFinished` isn't fired
  -o, --out [path]                       Path of where to save the PDF

markdown-pdf can also be used programmatically:

var markdownpdf = require("markdown-pdf")
  , fs = require("fs")

fs.createReadStream("/path/to/document.md")
  .pipe(markdownpdf())
  .pipe(fs.createWriteStream("/path/to/document.pdf"))

// --- OR ---

markdownpdf().from("/path/to/document.md").to("/path/to/document.pdf", function () {
  console.log("Done")
})

Options

Pass an options object (markdownpdf({/* options */})) to configure the output.

options.cwd

Type: String Default value: process.cwd()

Current working directory.

options.phantomPath

Type: String Default value: Path provided by phantomjs module

Path to the phantomjs binary.

options.cssPath

Type: String Default value: [module path]/markdown-pdf/css/pdf.css

Path to custom CSS file, relative to the current directory.

options.highlightCssPath

Type: String Default value: [module path]/markdown-pdf/css/highlight.css

Path to custom highlight CSS file (for code highlighting with highlight.js), relative to the current directory.

options.paperFormat

Type: String Default value: A4

'A3', 'A4', 'A5', 'Legal', 'Letter' or 'Tabloid'.

options.paperOrientation

Type: String Default value: portrait

'portrait' or 'landscape'.

options.paperBorder

Type: String Default value: 2cm

Supported dimension units are: 'mm', 'cm', 'in', 'px'

options.runningsPath

Type: String Default value: runnings.js

Path to CommonJS module which sets the page header and footer (see runnings.js).

options.renderDelay

Type: Number Default value: Time until page.onLoadFinished event fired

Delay (in ms) before the PDF is rendered.

options.loadTimeout

Type: Number Default value: 10000

If renderDelay option isn't set, this is the timeout (in ms) before the page is rendered in case the page.onLoadFinished event doesn't fire.

options.preProcessMd

Type: Function Default value: function () { return through() }

A function that returns a through2 stream that transforms the markdown before it is converted to HTML.

options.preProcessHtml

Type: Function Default value: function () { return through() }

A function that returns a through2 stream that transforms the HTML before it is converted to PDF.

options.remarkable

Type: object Default value: { breaks: true }

A config object that is passed to remarkable, the underlying markdown parser.

options.remarkable.preset

Type: String Default value: default

Use remarkable presets as a convenience to quickly enable/disable active syntax rules and options for common use cases.

Supported values are default, commonmark and full

options.remarkable.plugins

Type: Array of remarkable-plugin Functions Default value: []

An array of Remarkable plugin functions, that extend the markdown parser functionality.

options.remarkable.syntax

Type: Array of optional remarkable syntax Stringss Default value: []

An array of optional Remarkable syntax extensions, disabled by default, that extend the markdown parser functionality.

API

from.path(path, opts) / from(path, opts)

Create a readable stream from path and pipe to markdown-pdf. path can be a single path or array of paths.

from.string(string)

Create a readable stream from string and pipe to markdown-pdf. string can be a single string or array of strings.

concat.from.paths(paths, opts)

Create and concatenate readable streams from paths and pipe to markdown-pdf.

concat.from.strings(strings, opts)

Create and concatenate readable streams from strings and pipe to markdown-pdf.

to.path(path, cb) / to(path, cb)

Create a writeable stream to path and pipe output from markdown-pdf to it. path can be a single path, or array of output paths if you specified an array of inputs. The callback function cb will be invoked when data has finished being written.

to.buffer(opts, cb)

Create a concat-stream and pipe output from markdown-pdf to it. The callback function cb will be invoked when the buffer has been created.

to.string(opts, cb)

Create a concat-stream and pipe output from markdown-pdf to it. The callback function cb will be invoked when the string has been created.

More examples

From string to path

var markdownpdf = require("markdown-pdf")

var md = "foo===\n* bar\n* baz\n\nLorem ipsum dolor sit"
  , outputPath = "/path/to/doc.pdf"

markdownpdf().from.string(md).to(outputPath, function () {
  console.log("Created", outputPath)
})

From multiple paths to multiple paths

var markdownpdf = require("markdown-pdf")

var mdDocs = ["home.md", "about.md", "contact.md"]
  , pdfDocs = mdDocs.map(function (d) { return "out/" + d.replace(".md", ".pdf") })

markdownpdf().from(mdDocs).to(pdfDocs, function () {
  pdfDocs.forEach(function (d) { console.log("Created", d) })
})

Concat from multiple paths to single path

var markdownpdf = require("markdown-pdf")

var mdDocs = ["chapter1.md", "chapter2.md", "chapter3.md"]
  , bookPath = "/path/to/book.pdf"

markdownpdf().concat.from(mdDocs).to(bookPath, function () {
  console.log("Created", bookPath)
})

Transform markdown before conversion

var markdownpdf = require("markdown-pdf")
  , split = require("split")
  , through = require("through")
  , duplexer = require("duplexer")

function preProcessMd () {
  // Split the input stream by lines
  var splitter = split()

  // Replace occurences of "foo" with "bar"
  var replacer = through(function (data) {
    this.queue(data.replace(/foo/g, "bar") + "\n")
  })

  splitter.pipe(replacer)
  return duplexer(splitter, replacer)
}

markdownpdf({preProcessMd: preProcessMd})
  .from("/path/to/document.md")
  .to("/path/to/document.pdf", function () { console.log("Done") })

Remarkable options and plugins

Example using remarkable-classy plugin:

var markdownpdf = require("markdown-pdf")

var options = {
    remarkable: {
        html: true,
        breaks: true,
        plugins: [ require('remarkable-classy') ],
		syntax: [ 'footnote', 'sup', 'sub' ]
    }
}

markdownpdf(options)
  .from("/path/to/document.md")
  .to("/path/to/document.pdf", function () { console.log("Done") })

Contribute

Feel free to dive in! Open an issue or submit PRs.

License

MIT © Alan Shaw

markdown-pdf's People

Contributors

alanshaw avatar alexwhitman avatar anko avatar bmordan avatar finnp avatar fnogatz avatar ggodreau avatar luisangelorjr avatar mauvm avatar nadavspi avatar ncrazed avatar purtuga avatar shinnn avatar tgeens avatar tn1ck 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  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  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

markdown-pdf's Issues

Links are not created as links

When I use links in markdown with the syntax [description](url) I only get blue highlighted text in the pdf, but not the actual link.

Why different results under mac and linux

I run the following lines in the MacOSX 10.8/node 0.10.26/markdown-pdf2.2/phantomjs1.9.7 and Ubuntu 12.04 server/node 0.10.26/markdown-pdf2.2/phantomjs1.9.7

markdownpdf = require("markdown-pdf");

markdownpdf().from.string("some words here").to("/www/sach/Download/1.pdf",function(){
console.log("done");
});

And i got different files

Under MacOSX, the pdf cannot be selected and i thought it was images render by phantomjs

But under ubuntu, i got pdf with words that could be selected and then the chinese word cannot be displayed normally no matter i use utf-8 or gb2312 charset in hb5 template...

SO How could i got pdf (with images) under ubuntu...???

Empty output files on Windows

Hi, I just updated to the latest markdown-pdf on my Windows and Mac machines. The Mac is OK, although still only produces images because of a phantomjs limitation, I guess. The Windows now generates zero-length output.

It seems to process for the expected amount of time, but the output is empty.

Any ideas of things to try?

Cheers, Jim

Question: Code blocks?

Hey. I want to turn a README.md of a project of mine into a PDF.

This file contains code blocks. I see that no matter if I use ` or code tags, these code blocks are just shown as regular text, as if those tags are just ignored.

I have managed to accomplish this with the CLI like so:

markdown-pdf -s code.css README.pdf

code.css only includes this one-liner with the gitlab markdown, which I thought is a little nicer then the git standard markdown:

code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;white-space:nowrap;border-radius:4px}

Should we maybe make this standard? I don't know. I guess at least some of us developers are using this for code related stuff.

All the best.

images?!

it seems images aren't included in the resulting PDF file.

I put some images into my MD document, using inline span syntax (http://daringfireball.net/projects/markdown/syntax#img)

![Alt text](/path/to/img.jpg)

the resulting image shows in html file, which is an intermediate in your code

function markdownToPdfTask (filePath, opts) {
    ....
    var html = marked(data) // I checked temporal html contains valid <IMG> tags converted from above markdown

however, they're just blank in the resulting PDF.

markdown-pdf test.md # test.pdf has no images

if I save the intermediate html and load it in chrome, they render correctly.

is there any solution for this? markdown-pdf produces very beautiful pdf files, and I really want to use them in my report generation.

Need help to use highlight.js with markdown-pdf

I have some coding in my markdown

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

How can I attach coding below into the HTML before transforming to PDF ?

<script src="js/highlight.pack.js"></script>

<script>
    hljs.configure({
    languages: ['javascript']
})

hljs.initHighlightingOnLoad();
</script>

Or how can I use my own index.html as template instead of the default [module path]/markdown-pdf/html5bp/index.html ?
Please guide
Thanks

Concat not properly ordered

The following example ended up with the steps0x files in an unexpected order. e.g. step 9 after step 10, etc.

var mdDocs = ["README.md", "docs/setup.md", "docs/project.md",
"docs/step01.md", "docs/step02.md", "docs/step03.md", "docs/step04.md",
"docs/step05.md","docs/step06.md","docs/step07.md","docs/step08.md",
"docs/step09.md","docs/step10.md"]
, bookPath = "mft-starter.pdf"

markdownpdf().concat.from(mdDocs).to(bookPath, function () {
console.log("Created", bookPath)
})

<img> tags broken

I'm using the grunt task and am just trying to upgrade to 3.0.0 and noticed that all of my <img> tags are no longer working. Instead of showing the image, it just ends up rendering the markup. I think that markup is allowed in markdown, so this seems like a bug to me.

How can I put a watermark image on every page?

Hi

I am successfully using this package and I think it great.

I have now been told that:

PDF content must have DRM (watermarks, social stamps) to ensure that the IP of content is protected.

I have some text available for each document that represents a copyright statement along the lines of:

copyright:'© My Group Publishing Limited'

Have you any idea how I would go about achieving this?

Thanks

Random image tags disappearance

I'm using this to process markdown files with many images with grunt and your grunt-markdown-pdf plugins, and sometimes the images would randomly appear and disappear from the generated pdf. I've been trying to increase the renderDelay time, but the problem persist.

throw err; ^ TypeError: Object # Test has no method 'replace'

I just installed markdown-pdf using:

#npm install -g markdown-pdf

Then trying to render that simplistic document:

thiblahute ~ $ cat misc.mkd 
# Test
thiblahute ~ $ 

I am getting:

thiblahute ~ $ markdown-pdf misc.mkd -o test.pdf
/usr/lib/node_modules/markdown-pdf/node_modules/tmp/lib/tmp.js:261
  throw err;
        ^
TypeError: Object # Test
 has no method 'replace'
Please report this to https://github.com/chjj/marked.
    at Lexer.lex (/usr/lib/node_modules/markdown-pdf/node_modules/marked/lib/marked.js:132:6)
    at Function.Lexer.lex (/usr/lib/node_modules/markdown-pdf/node_modules/marked/lib/marked.js:123:16)
    at marked (/usr/lib/node_modules/markdown-pdf/node_modules/marked/lib/marked.js:1105:31)
    at /usr/lib/node_modules/markdown-pdf/lib/markdown-pdf.js:129:20
    at fs.readFile (fs.js:176:14)
    at /usr/lib/node_modules/graceful-fs/graceful-fs.js:103:5
    at Object.oncomplete (fs.js:297:15)

Deal with file descriptors from tmp module

The tmp module creates a file and passes back the path and an open file descriptor. Currently markdown-pdf discards the fd, it should be closed or passed to the callback so the client code can close it if necessary.

Spaces in path to image file

Looks like you cannot have spaces in the path to an image file?

![](/Users/jhawkins/Documents/ok.png)

![](/Users/jhawkins/Documents/not ok.png)

header and footer didn't work

I followed the guide to print custom header and footer, here's what I did

  1. create a running.js with content
exports.header = {
    height: "1cm",
    contents: function(pageNum, numPages) {
        return "<h1>HEADER <span style='float:right'>" + pageNum + " / " + numPages + "</span></h1>"
    }
 };

exports.footer = {
    height: "1cm",
    contents: function(pageNum, numPages) {
        if (pageNum == numPages) {
            return "";
        }
        return "<h1>FOOTER <span style='float:right'>" + pageNum + " / " + numPages + "</span></h1>";
    }
}
  1. generate pdf from cli
markdown-pdf xxx.md -f A4 -h running.js

I waited for ten minutes but it generated nothing, on the other hand, it successfully generated a pdf without runnings-path option

what did I do wrong?

Page numbers and footers

Just wondered if anybody knew of a way of getting a custom footer/header and page numbers to be shown on every page of the pdf? Tried the normal media print stuff but doesn't seem to be working.

`cwd` option or similar

Currently, images are interpreted relative to this project's html5bp/ directory. This makes it difficult to include image assets inline. With a cwd option, the consumer code could set the relative location from which to interpret the generated HTML document. This feature would also simplify the cssPath option (where users currently have to specify a path in terms of this module's html5bp/ directory).

I'm thinking this could be implemented using PhantomJS's setContent method, which allows for setting the page content and URL separately. In this case, the HTML5 Boilerplate's index.html file would have to be made into a template so that the resources it references could be loaded independently of the user-specified cwd.

Does the feature make sense? How about the proposed implementation?

CLI Option: Stop After Rendering Intermediate HTML

Most code compilers have a flag that tells the compiler to stop after a certain point and show the intermediate file. For example, when compiling C-code with gcc, you can tell the compiler to stop after the preprocessor has run and show the resulting C code, or to stop after it has been translated to assembly and show the resulting assembly code.

When using this from the command line, it would be nice to be able to tell it to preserve the HTML file, so that I can use that for writing my CSS.

Images in the runnings are not being shown if not present in the document

I have noticed a strange thing: an image is not being shown in the runnings if it is not present in the body of the document. For example:

runnings.js

exports.header = {
 height: "390px",
 contents: function(pageNum, numPages) {
  return "<img src='F:/1/head-2.png'>"
 }
}

exports.footer = {
 height: "204px",
 contents: function(pageNum, numPages) {
  return "<img src='F:/1/foot-2.png'>"
 }
}

doc.md

![](F:/1/head-2.png)

The head-2.png image is displayed in the header, but the foot-2.png is not. If I add

doc.md

![](F:/1/head-2.png)
![](F:/1/foot-2.png)

both images are shown in the header and the footer. If I remove them, none are shown at all.

Am I doing something wrong?

Images not being shown in the runnings at all

A possible variation on #43. I have a script that uses a running script thus:

exports.header = {
  height: '1in',
  contents: function(pageNum, numPages) {
    return '<img src="logo.jpg" height="39px" width="77px"><hr>';
  }
};

It shows a blank image in the header. I've tried absolute paths as well (/path/to/logo.jpg) and altering the height, to no avail. Like #43 I then included the image in the text. No image appears, just a blank rectangle.

Any other HTML fragment in the running - text of various styles, even tables - works, but no images.

Pagebreak-Support

Hi,

does anybody know how to get pagebreaks working?

I tried to enable custom html in remarkable and then add a css-rule like:

pagebreak {
  page-break-before: always;
  break-before: always;
}

Any other ideas?

Support for GFMD

Support for Github Flavored Markdown (fenced code blocks, tables, lists, etc.) would be much appreciated.

Text not selectable

Currently using phantomjs make us unable to select text into the pdf. I'm assuming phantomjs render as png.
What about using another rendering tool like pandoc ?

image in output

Using this from the command line.
But I am not able to insert an image in the output.
Regardless how I reference it. (absolute vs relative path..)
Anyone any hints ?

Batch mode

It should also be possible to specify several files in the cli and get a pdf for each file

Underlying issue with concat-stream?

Hi there. I am running your grunt-markdown-pdf. I seem to be hitting an underlying error with stream-from-to and beneath that concat-stream. I've tried commenting out a couple of things. Unfortunately then I get empty PDFs.

If I comment out , concatStream = require("concat-stream") in stream-from-to, or if I remove ConcatStream from inherits(ConcatStream, Writable) in concat-stream grunt doesn't fail but I get empty PDFs.

$ npm ls
├─┬ [email protected] │ ├── [email protected] │ └─┬ [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├─┬ [email protected] │ │ │ ├─┬ [email protected] │ │ │ │ └── [email protected] │ │ │ ├── [email protected] │ │ │ ├── [email protected] │ │ │ ├─┬ [email protected] │ │ │ │ └── [email protected] │ │ │ ├── [email protected] │ │ │ ├── [email protected] │ │ │ └── [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ ├─┬ [email protected] │ │ ├─┬ [email protected] │ │ │ └─┬ [email protected] │ │ │ ├── [email protected] │ │ │ ├── [email protected] │ │ │ └── [email protected] │ │ ├─┬ [email protected] │ │ │ ├── [email protected] │ │ │ └── [email protected] │ │ └── [email protected] │ ├── [email protected] │ └── [email protected] └── [email protected]
$ grunt test --verbose

Parsing /.../node_modules/grunt-markdown-pdf/package.json...OK
Loading "markdownpdf.js" tasks...ERROR

TypeError: Cannot read property 'prototype' of undefined
at exports.inherits (util.js:538:43)
at Object. (/.../node_modules/grunt-markdown-pdf/node_modules/markdown-pdf/node_modules/stream-from-to/node_modules/concat-stream/index.js:28:1)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object. (/.../node_modules/grunt-markdown-pdf/node_modules/markdown-pdf/node_modules/stream-from-to/index.js:3:20)
at Module._compile (module.js:449:26)
Loading "Gruntfile.js" tasks...OK

  • builddocs, clonedocs, default, docs, install, test, update, updatedocs

Running tasks: test

Running "test" task
Warning: Task "markdownpdf" not found. Use --force to continue.

Concat multiple markdown files

Is there a way from the CLI to generate a PDF from more than one input markdown file? If not, what do you recommend as a workaround, concatenating input files into a single file and running markdown-pdf on that?

Thanks

How to include title or other document information in headers and footers

I'm raising this issue to see if anybody has any bright ideas.
It seems to me that there is be no easy way to include information like a document title or category in a footer or header, i.e. in the runnings.
It is not too hard to write a node Transform that reads the input .md and fishes out, say, the first level one heading. That could be assumed to be the title, and then retained for use in the runnings. However, it looks like the runnings JS has to be a file, it can't be a stream or even just passed by setting a JS variable. (Actually, maybe it would be possible for code in the runnings JS to read a value set by a different module?)

There doesn't seem to be a node module for creating temporary files in a platform independent way, which makes this worse, I think.

errorno:52 code:EXDEV

env:
Windows 8, nodejs v0.10.21

command:
markdown-pdf -f A4 1.md -o 2.pdf

result:
{ [Error: EXDEV, rename 'C:\Users\fwb\AppData\Local\Temp\tmp-145483lvsyao.pdf']
errno: 52,
code: 'EXDEV',
path: 'C:\Users\fwb\AppData\Local\Temp\tmp-145483lvsyao.pdf' }

I can't find a pdf.

create colored pdfs

hey man this is really nice work its very handy and easy , lately i was trying to create a cheat sheet for php using md-pdf and i wanted syntax highlighting so put appropriate css in place of pdf.css but its not working i am not able to get color highlighting . I even added the css file to H5BP index.html but still i get B&W pdf ,
please help

False negatives in header/footer test

As I mentioned in #28 this test was failing even before my modifications and since it's breaking the build of my pull request I decide to dig around a little.

The error is triggered by these two lines:

assert.ok(/Some\s?Header/.test(chunks.join('')))
assert.ok(/Some\s?Footer/.test(chunks.join('')))

I've inspected the the temporary PDF files generated during the test with evince and both Some Header and Some Footer are clearly present in the result. So it looks like the current test for header/footer started throwing false negatives.

I've tried finding the dependency that caused this change by downgrading both node and some of the packages to the ones used in the successful build without success. But since I am not aware of an automated way to perform such checks I ended up doing it manually so it's possible that I missed a package.

Links do not render correctly

The standard markdown link syntax were not rendering correctly with my markdown docs. To test if this was just me I used a standard Lorum Ipsum MD text and got the same result (see screenshot).

Can you help please?

pdf

No error message when runningsPath is incorrect

Hi,
I can't seem to use the runningsPath option, neither in a .js script nor in the CLI with the -h or --runnings-path switch. Whatever I specify as the parameter value, the program hangs and I have to Ctrl-C to kill it.
This even happens if I specify a value that doesn't exist, as in:

var markdownpdf = require("markdown-pdf")
  , fs = require("fs");

fs.createReadStream("../doxygen18plan.md")
  .pipe(markdownpdf({
    "cssPath": "./try.css"
    , "runningsPath": "WRONG_FILENAME.js"
  }))
  .pipe(fs.createWriteStream("goplan.pdf"));

Any tips on what I should check please? It works if I comment out the runningsPath line in the above.
Some version details:

$ markdown-pdf --version
3.0.2
$ node --version
v0.10.29

Cheers, Jim

Nice! Just a few questions...

Can it create a hash table of linked pages and make a bibliography or references list to add at the end of the document automatically? With [n] besides the link and everything? That'd be great for writing dissertations in Markdown and then easily converting it to pdf to print it.

Also, I said hash so there are no repeated links, but, yeah, that's pretty much what I mean.

Please respond soon as I'm writing a book on Markdown and would like to see it printed maybe before next month ends.

Alter callback signature if only one file is processed

markdown-pdf supports passing a string or array of markdown file paths as the first parameter. The callback function however always returns an array of PDF file paths.

If the first argument is a string, the callback return value should be a string.

Cannot use my custome CSS.

Here is command blow:

markdown-pdf --css-path style.css development_guideline.md

and

sudo markdown-pdf -s style.css development_guideline.md

Did I use it wrong way ?

Thanks in advance

Huge file size

I have created simple PDF out of 33 KB .md → 9 MB size... For 8 pages document without pictures it is more than 1 MB/page.

I have checked document in Illustrator and here it is. Text is not stored as text, but as curves. All text. Looks terribly wrong.

text

For my cases this is a surely not acceptable. Maybe there is an option to include text as text, not as curves?

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.