Giter Site home page Giter Site logo

turpan-remove-space's Introduction

编写文档时,我们提倡英文单词与中文字符之间,有一个空格(参考《中文技术文档写作规范》)。

有空格的写法:学习 JavaScript 语言

无空格的写法:学习JavaScript语言

印刷排版时,往往要求英文单词与中文字符之间,不能有空格。Turpan-remove-space 就是移除这种空格的工具,返回处理后的 HTML 文件。

用法

# 安装
$ npm install -g turpan-remove-space

接着,将所有 Markdown 文件放在一个目录之中。(注意:暂时不支持子目录之中的 Markdown 文件。)

$ trs --dir /path/to/markdown/dir

运行上面的命令之后,会在该目录旁,生成另一个目录,比如docs-1499348264449,里面包含了转码后的 HTML 文件。

转码规则

单个英文词汇与汉字之间的空格,都将被去除。

转码前:学习 JavaScript 语言

转码后:学习JavaScript语言

此外,还可以自己指定去除空格的词汇。

$ tse --dir /path/to/markdown/dir --word '计算机,人工智慧'

上面代码中,多个词汇之间使用半角逗号分隔。注意,逗号前后不能有空格。

转码前:学习 计算机 语言

转码后:学习计算机语言

turpan-remove-space's People

Contributors

ruanyf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

kevinyzy

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.