dtesler / medium-to-markdown Goto Github PK
View Code? Open in Web Editor NEWConverts Medium posts to markdown.
License: MIT License
Converts Medium posts to markdown.
License: MIT License
Update the dependency from to-markdown to https://www.npmjs.com/package/turndown
I was learning REACT and built a barebones UI for this library at http://steemtools.bitfolio.org/#/tools/import-from-medium
I tried converting this Medium article into Markdown.
But the Github Gists were missing in the markdown output.
Medium article containing the Gist:
The resultant output (with the Gist snippet missing):
The script I used:
const mediumToMarkdown = require('medium-to-markdown');
const url = "https://towardsdatascience.com/a-minimalist-end-to-end-scrapy-tutorial-part-ii-b917509b73f7";
mediumToMarkdown.convertFromUrl(url)
.then(function (markdown) {
console.log(markdown); //=> Markdown content of medium post
});
Possible solution could be to fetch the HTML of the iframe containing the Gist and then enclose them in a code block in the markdown output.
Hi, I am trying to build a package that can convert Medium post to offline ready content based on markdown (main addition would be downloading the images locally as well after the conversion with an additional script).
I've noticed that the Featured image is not exported correctly, because its markup differs from the rest. Example result:
<img alt="Image for post" class="t u v jm aj" src="https://miro.medium.com/max/1270/1\*ddr6YXSIP72LyVJxeb1dwA.png" width="635" height="283" srcSet="https://miro.medium.com/max/552/1\*ddr6YXSIP72LyVJxeb1dwA.png 276w, https://miro.medium.com/max/1104/1\*ddr6YXSIP72LyVJxeb1dwA.png 552w, https://miro.medium.com/max/1270/1\*ddr6YXSIP72LyVJxeb1dwA.png 635w" sizes="635px"/>
The plugin probably needs an additional rule for this (I'd be glad to help but I am just discovering Turndown)
Edit: actually this happens for all images except the bottom one that is wrapped with a link for me.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.