在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):netgusto/upndown开源软件地址(OpenSource Url):https://github.com/netgusto/upndown开源编程语言(OpenSource Language):JavaScript 99.0%开源软件介绍(OpenSource Introduction):upndownJavascript HTML to Markdown converter, for Node.js and the browser. Aboutupndown converts HTML documents to Markdown documents. upndown is designed to offer a fast, reliable and whitespace perfect conversion for HTML documents. Install / UsageBrowserStandard loading Download the zip archive on github, unzip, copy in your web folder, and in your HTML: <script type="text/javascript" src="/assets/upndown/lib/upndown.bundle.min.js"></script>
<script type="text/javascript">
var und = new upndown();
und.convert('<h1>Hello, World !</h1>', function(err, markdown) {
if(err) { console.err(err); }
else { console.log(markdown); } // Outputs: # Hello, World !
});
</script> Using RequireJS Download the zip archive on github, unzip, copy in your web folder, and in your HTML: <script type="text/javascript" src="http://requirejs.org/docs/release/2.1.11/minified/require.js"></script>
<script type="text/javascript">
require.config({
paths: {
'upndown': '/assets/upndown/lib/upndown.bundle.min'
}
});
require(['upndown'], function(upndown) {
var und = new upndown();
und.convert('<h1>Hello, World !</h1>', function(err, markdown) {
if(err) { console.err(err);
else { console.log(markdown); } // Outputs: # Hello, World !
});
});
</script> NodejsInstall npm install upndown Use var upndown = require('upndown');
var und = new upndown();
und.convert('<h1>Hello, World !</h1>', function(err, markdown) {
if(err) { console.err(err);
else { console.log(markdown); } // Outputs: # Hello, World !
}); Warning: With Node < 0.12.8, you'll have to require a polyfill for the Options
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论