This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // my conventors for https://github.com/domchristie/to-markdown | |
| 'use strict'; | |
| function esc(s) | |
| { | |
| return s.replace(/</g, '<') | |
| .replace(/>/g, '>'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| eyJ2ZXJzaW9uIjoxLjMsImZlYXR1cmVzIjp7ImxvY2F0aW9uIjp7InJvb20iOnRydWUsIm91dHNpZGUiOnRydWUsIndvcmxkIjp0cnVlLCJzcGFjZVNoaXAiOnRydWV9fSwic3RvcmVzIjp7Indvb2QiOjk3MTEsInNjYWxlcyI6MzEyLCJiYWl0IjoyMDE2LCJtZWF0IjozMjg3My41LCJmdXIiOjEyMjUxLCJ0ZWV0aCI6MjEyLCJjbG90aCI6Mzc2LCJsZWF0aGVyIjoyODMwLCJjdXJlZCBtZWF0IjozODgsImNvbXBhc3MiOjEsImNoYXJtIjozMywidG9yY2giOjExLCJib25lIHNwZWFyIjowLCJ3YXRlcnNraW4iOjEsInJ1Y2tzYWNrIjoxLCJsIGFybW91ciI6MSwiaXJvbiI6MjExMCwic3RlZWwiOjM5LCJib2xhcyI6MiwiaXJvbiBzd29yZCI6MCwiY29hbCI6MjU2LCJzdGVlbCBzd29yZCI6MiwibWVkaWNpbmUiOjE5LCJiYXlvbmV0IjowLCJzdWxwaHVyIjoyMCwiYWxpZW4gYWxsb3kiOjAsImxhc2VyIHJpZmxlIjoxLCJ3YWdvbiI6MSwiaSBhcm1vdXIiOjEsImNhc2siOjEsIndhdGVyIHRhbmsiOjEsInMgYXJtb3VyIjoxLCJjb252b3kiOjEsImVuZXJneSBjZWxsIjoxNiwiZ3JlbmFkZSI6MCwiYnVsbGV0cyI6MywicmlmbGUiOjF9LCJjaGFyYWN0ZXIiOnsicHVuY2hlcyI6MTEzNCwiZGVoeWRyYXRlZCI6MTIsInN0YXJ2ZWQiOjExLCJwZXJrcyI6eyJzdGVhbHRoeSI6dHJ1ZSwiZXZhc2l2ZSI6dHJ1ZSwiYm94ZXIiOnRydWUsInNsb3cgbWV0YWJvbGlzbSI6dHJ1ZSwiZGVzZXJ0IHJhdCI6dHJ1ZSwibWFydGlhbCBhcnRpc3QiOnRydWUsInByZWNpc2Ui |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs = require('fs'); | |
| var request = require('sync-request'); | |
| var process = require('process'); | |
| var prefix = ''; | |
| var dirname = process.argv[2]; | |
| if(!dirname) | |
| { | |
| console.log('请指定目录。'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs = require('fs'); | |
| var path = 'D:\\it-ebooks\\source\\_posts'; | |
| var files = fs.readdirSync(path); | |
| var result = '# 计算机开放电子书汇总\n\n' + | |
| '+ [站点](http://it-ebooks.flygon.net/)\n' + | |
| '+ [站点源码](https://github.com/it-ebooks/blog)\n\n'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs = require('fs'); | |
| try {fs.mkdirSync('out');} | |
| catch(ex){} | |
| var co = fs.readFileSync('out.html', 'utf-8'); | |
| var files = co.split(/<!\-\-split\-\->/g); | |
| //var summary = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs = require('fs'); | |
| var request = require('sync-request'); | |
| var crypto = require('crypto'); | |
| var cheerio = require('cheerio'); | |
| var dirname = process.argv[2]; | |
| if(!dirname) | |
| { | |
| console.log('请指定目录。'); | |
| process.exit(0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs = require('fs'); | |
| try {fs.mkdirSync('out');} | |
| catch(ex){} | |
| var co = fs.readFileSync('a.md', 'utf-8'); | |
| var files = co.split(/<split>123<\/split>/g); | |
| var summary = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tokenRE = /^[A-Za-z_]\w{0,31}/; | |
| numeralRE = /^\d+/; | |
| function matchAndReturn(str, re) { | |
| var r = str.match(re); | |
| return r? r[0]: null; | |
| } | |
| isToken = s => matchAndReturn(s, tokenRE); | |
| isNumeral = s => matchAndReturn(s, numeralRE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var cheerio = require('cheerio'); | |
| var request = require('sync-request'); | |
| var fs = require('fs'); | |
| var process = require('process'); | |
| var url = process.argv[2]; | |
| if(!url) | |
| { | |
| console.log('请指定页面。'); | |
| process.exit(0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8" ?> | |
| <package unique-identifier="BookId" version="2.0" xmlns="http://www.idpf.org/2007/opf"> | |
| <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf"> | |
| <dc:identifier id="BookId" opf:scheme="UUID">urn:uuid:<%- uuid %></dc:identifier> | |
| <meta content="1.0.0" name="jianhelper"/> | |
| <dc:language>zh-CN</dc:language> | |
| <dc:date opf:event="modification" xmlns:opf="http://www.idpf.org/2007/opf"><%- date %></dc:date> | |
| </metadata> | |
| <manifest> | |
| <item href="toc.ncx" id="ncx" media-type="application/x-dtbncx+xml"/> |
OlderNewer