Code Monkey home page Code Monkey logo

rdr's Introduction

rdr

rdr is a command-line tool that converts web pages to Markdown format and displays the content in a pager or terminal. It uses the go-readability library to extract the main content from a web page and the html-to-markdown library to convert the HTML to Markdown.

Usage

rdr [url]

If a URL is provided as an argument, rdr will fetch the content from that URL. If no URL is provided, rdr will read the input from stdin.

Options

  • --no-pager: Don't pipe the output to a pager (e.g., less). Instead, print the output directly to the terminal.
  • --no-links: Don't display any links in the output. Links will be replaced with their text content.
  • --raw: Print the raw Markdown output without any formatting or rendering.

Examples

  1. Convert a web page to Markdown and display it in a pager:
rdr https://example.com
  1. Convert a local HTML file to Markdown and display it in the terminal:
cat index.html | rdr -
  1. Convert a web page to Markdown, remove all links, and display it in the terminal:
rdr --no-links --no-pager https://example.com
  1. Convert a web page to raw Markdown and print it to stdout:
rdr --raw https://example.com

Dependencies

  • github.com/JohannesKaufmann/html-to-markdown: Library for converting HTML to Markdown.
  • github.com/PuerkitoBio/goquery: Library for parsing HTML.
  • github.com/charmbracelet/glamour: Library for rendering Markdown with syntax highlighting.
  • github.com/go-shiori/go-readability: Library for extracting the main content from a web page.
  • github.com/spf13/cobra: Library for creating command-line applications.

rdr's People

Contributors

bart-jaskulski 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.