Giter VIP home page Giter VIP logo

doctool's Introduction

安装依赖项

pip install -r requirements.txt
npm install
apt install imagemagick
apt install pngquant

epub-crawler.js

抓取网页和图片并保存 EPUB,解压后可以得到图片和 HTML。

需要 ImageMagick 和 pngquant。包依赖见文件开头。

node epub-crawler

配置文件config.json

  • name:保存的文件名称
  • url:目录页 URL
  • link:链接<a>的选择器
  • base:链接<a>的前缀
  • title:文章页的标题选择器
  • content:文章页的内容选择器
  • remove:文章页需要移除的元素的选择器
  • credit:是否显示原文链接
  • processMath:是否处理 TeX 公式
  • processDecl:是否处理 sphinx 类定义
  • hdrs:HTTP 请求的协议头
  • list:如果这个列表不为空,则抓取这个列表,忽略url

img-better.js

自动压缩图片。需要 ImageMagick 和 pngquant。

node img-better <dir>

img.js

保存 HTML 中的图片到同目录的img中,并更新 HTML 中的链接。

node img <file|dir>

trans.py

调用谷歌翻译按段落翻译 HTML。

python trans.py <file|dir>

tomd.js

将 HTML 转化为 MD

node tomd <file|dir>

规则定义my-conventors.js

RuleObj {

    filter: string|Array[string]|function(Element):boolean,
    replacement: function(string, Element):string
}

module.exports: Array[RuleObj]

sina-short.js

将 MD 中的链接转换为新浪短网址。

node sina-short <file>

process_tex.js

将 MD/HTML 中的 TeX 公式转换为图片。

node process_tex <dir>

doctool's People

Contributors

wizardforcel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

258ch maxinsomnia

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.