Giter Site home page Giter Site logo

clean-mark's Introduction

➹ Clean-mark

Convert a blog article into a clean Markdown text file.

NPM Version NPM Downloads Build Status Standard Style Guide

Example

For example, this article:

Original article

Is converted into this text file:

Clean text

Usage

$ clean-mark "http://some-website.com/fancy-article"

The article will be automatically named using the URL path name. In the case, above, the name will be fancy-article.md.

The file type can be specified:

$ clean-mark "http://some-website.com/fancy-article" -t html

The available types are: HTML, TEXT and Markdown.

The output file and path can be also specified:

$ clean-mark "http://some-website.com/fancy-article" -o /tmp/article

In that case the output will be /tmp/article.md. The extension is added automatically.

Installation

Simply install with npm:

$ npm install clean-mark --global

Why ?

  • to save interesting articles offline, in a highly readable text format
  • it's easy to read on a tablet, or a Kindle (as it is, or exported to PDF)
  • Markdown is easy to export into different formats
  • for offline text analysis of multiple articles, using machine learning / AI

How ?

Implementation steps:

  1. Downloads the content of a web page
  2. Meta-scrape page details (title, author, date, etc)
  3. Sanitizes the ugly HTML
  4. Minifies the disinfected HTML
  5. Converts the result into clean Markdown text

This project depends on the A-Extractor project, a database of expressions used for extracting content from blogs and articles.

Vision

The goals of the project are are:

  1. Good text extraction
  2. More useless text is preferred, instead of cutting from the actual article by mistake
  3. Extracting media (images, videos, audio) is not that important
  4. Extraction speed is not that important

Contributing

Clean-mark was tested on all major news sites. On some websites, the text, or links are cut from the article. In this case, you have to manually edit the resulted text,

AND

please raise an issue on A-Extractor with the link that doesn't work and we'll add it in the database, so that next time, the text will be extracted correctly.

Also, see how to contribute.

Other readability tools

Web archiving tools

A massive list of Awesome Web Archiving tools: https://github.com/iipc/awesome-web-archiving


License

MIT © Cristi Constantin.

clean-mark's People

Contributors

croqaz avatar gabrielmangiurea avatar dependabot[bot] avatar

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.