Giter Club home page Giter Club logo

typorahtmlpretty's Introduction

说明

使用Typora编辑markdown文件,有时需要导出为HTMl文件,但是样式不是想要的(图片居左、复选框被禁用),此外,由于引用的外链样式表以及字体文件无法访问,在控制台会报错,当然,报错不影响页面显示。针对以上问题,做了个小工具。备注:windows系统下。

依赖说明
  1. 使用Node.js的fs模块,无需安装其他依赖。
  2. 源HTMl文件由Typora 0.9.38编辑导出,未测试其他版本的情况。
使用说明

打开命令行工具,切换到工具根目录,输入命令

npm run pretty filename

其中,filename是由Typora导出的HTML文件名称,包括后缀名,该文件放在file/下。命令执行完毕后,会在dist/下生成美化后的同名HTML文件。

解决的问题
  1. 引用谷歌的样式表,会报错,所以去掉
  2. 引入字体,会报错,所以去掉
  3. 原样式是图片居左,改为居中,且带有边框
  4. 复选框都是禁用状态,改为可选状态
  5. 去掉所有的换行符,即压缩文件

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.