Giter VIP home page Giter VIP logo

md2pdf's Introduction

Netlify Status

Deploy gh-pages

Markdown2PDF

https://md2pdf.netlify.com/

https://realdennis.github.io/md2pdf/

It just works!

Upload

Awesome Markdown to PDF!

- Online? Upload resume.md to stranger server?
+ Try Offline Web App!

How to use md2pdf?

  1. Click button choose .md file.
  2. Edit in editor (left panel).
  3. Click Transform!
  4. Switch 'Destination' to Save as PDF.
  5. Chrome recommended

Tips

  • Resize the layout what you want.
  • After click Transform button, inverse the checkbox of 'Headers and Footers'.
  • 反選頁首與頁尾.

What's special?

  • You can use html tag!
Hey I'm in blockquote!

LICENSE MIT © 2019 realdennis

md2pdf's People

Contributors

0xflotus avatar dependabot[bot] avatar gargaj avatar hacklschorsch avatar jacqueslorentz avatar realdennis avatar shizukuichi avatar yiyu0x 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

md2pdf's Issues

anchor tags around a figure don't export correctly to pdf.

I use <a> tags around a <figure> tag with an <img> and a <figcaption> like this:

<a href="https://i.imgur.com/S17rFny.jpg">
<figure class="image">
  <img src="https://i.imgur.com/S17rFny.jpg">
  <figcaption style="color:gray; text-align:center;">An image</figcaption>
</figure>
</a>

I do this so if the reader of the PDF clicks on the image, it opens in a browser window (to view full size). This behavior works in the preview, but not in the exported pdf.

Doesn't generate outline

Doesn't generate a Table of Contents from titles, subtitles, etc.

Thanks for the great project!

Use github.io for hosting to improve trust

It's nice that I could in principle run your code offline, but I only need a quick conversion of my markdown doc to a PDF without installing anything anywhere.

As it stands, this app is hosted by Netlify, and I don't know or have any reason to trust Netlify (or you). (not meaning to be rude)

I would find the online version of this much more trustworthy if it was a static github.io page.

  • I could be sure md2pdf.github.io actually runs the code I can see in the repo
  • I know github.io doesn't allow dynamic server side components guzzling up my sweet document and storing it for whoevers' viewing please
  • AFAIK github.io doesn't even have shitty analytics, which is great if you want this to be a GDPR conforming tool that people can also use at the workplace w/o having their ass busted by IT, legal, or whatever
  • You'd get continuous delivery (CD) for free.

That way, cool hackers that write everything in markdown instantly know you won't collect their data on your server - because (hopefully) you can't. Probably that's not even true, haven't looked into GH pages for a long while, and you always could come up with some way to collect your users' data. But it would make it harder.

Make it extra hard to collect data, even for people who use this software on their own servers. Do set CORS and whatever you can so people have to explicitly disable that if they want to run an instance that does collect data.

While you're at it, also remove that shitty Google Analytics, it smells like vanity and puts an otherwise cool tool to shame. Metadata is data too.

lack of meta tag

  • favicon.ico
  • manifest.json
  • meta tag title/description/preview...etc
  • GA maybe

Links not working in exported PDF

I used the simple markdown link format to add a link

[write your text](write the link)

It worked in the preview format, but when I exported it into a PDF file, all the links vanished, and none of them worked.

Suggestion: Printing a PDF file removes the link(s) attached to the PDF file. Rather saving the PDF file preserves the link. So if you put an option for saving rather than printing then I guess all the links will work perfectly as we get in the preview.

Markdown's table of contents doesn't work in the pdf file.

When converting the markdown file with a table of contents (example below), the links in the converted pdf file do not work.

Instead of the respective header in the pdf file itself, the link in the pdf file points to the app's page (i.e. https://md2pdf.netlify.app/#hello).

<!-- example table of contents -->

- [Hello](#hello)
  - [md2pdf](#md2pdf)
    - [Thank you](#thank-you)

I was wondering if this is something that can be fixed.

Also, thank you so much for the app, it's very useful. 🙌

Remove the 3rd custom hook

import useEventTarget from 'use-event-target';
import uploadFile from '../../Lib/uploadFile.js';
const useReader = useEventTarget(new FileReader());
export default props => {
const [reader] = useReader('load', evt => {

import createEventTargetHook from 'create-event-target-hook';
const useWindowEvent = createEventTargetHook(window);
const Markdown = ({ className }) => {
const [text, setText] = useProvided(TextContainer);
const [isDrag, setDrag] = useState(false);
const [startX, setStartX] = useState(0);
const [width, setWidth] = useState(window.innerWidth / 2);
const markdownRef = useRef(null);
const [uploading, isOver] = useDrop(markdownRef, uploadFile);
// Partial fileText & text
useWindowEvent('mouseup', () => setDrag(false));

Prefer use the native event with useEffect instead of experimental & unstable library (will increase the learning cost to other new contributor)

API availability doesn't exist

This is my first time ever creating an issue on someone else's repo, so I apologize if this is bad form.

I would like to use this service in an API related capacity to send markdown content and print options over a POST request that returns the pdf, is this a possible feature or something that I would be able to collaborate on in the future?

Not support firefox

As title, not support firefox (im using firefox 65.0.1)
the function bar was not show.

Set sensible file name default

Thank you for this very nice service!

Here's a "nice to have" suggestion:

Use case: I already wrote an .md file in my favorite Editor (nvim) and now want to turn it into a PDF.
I find your service on the internet, use it, but when I transform my document the file name is set to md2pdf - Markdown to PDF.pdf because that's (still) the <title> of the web app.
It does so every time - it doesn't even remember the name when Transform multiple times.

Maybe it's easy to suggest a filename, maybe like so.
You could get the filename from the chosen uploaded file, and make that override some other sane default, like choosing the biggest headline title (# h1 head line badumm tuss!) as file name.

It would be even nicer if it remembered the file name I chose the last time, but I don't know if that is easy to do.

XSS Vulnerability

Supplying the following Code on https://md2pdf.netlify.app/ results in JS execution

### XSS PoC
<!-- markdownlint-disable MD038-->
- `<Img src = x onerror = "javascript: window.onerror = alert(document.domain); throw XSS">`

the seperate line just not working

whether a ---/*** in markdown or


in html, they do appear in the preview window, but disappear in the pdf,
may I know the reason? thanks !

File structure flat/refactor

So far when we want to find and do some update for component such as the previewer, we need to access src/App/Components/Markdown/Previewer/Preview.js let's flat the structure.

And also initial state (initialText.js) is in really nested folder, feel wordy src/App/Container/Hooks/InitialText.js

Create a thread to discuss about it, currently we don't have the action items, please don't just send the PR.

Lack of client-side caching

I was using md2pdf as a Markdown editor today and I forgot to back-up my work. Clicking on a link by accident resulted in a loss of progress. Would it be possible to add client-side caching to the app so that if a user goes out and comes back to md2pdf, the last-cached content is restored?

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.