From 504b5188e38fe4a6268b1e338804b53e20b74f18 Mon Sep 17 00:00:00 2001 From: gardenapple Date: Wed, 23 Mar 2022 15:30:43 +0200 Subject: [PATCH] v2.4.0 release, update README and man page --- README.md | 35 ++++++++++++++++++++++++++++++++--- package.json | 2 +- readability-cli.1 | 8 ++++---- readable.ts | 2 +- 4 files changed, 38 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1b2bb26..931423d 100644 --- a/README.md +++ b/README.md @@ -19,15 +19,44 @@ Here is a before-and-after comparison, using [an article from The Guardian](http ## Installation -**readability-cli** can be installed on any system with [Node.js](https://nodejs.org/en/): +**readability-cli** can run via either [Node.js](https://nodejs.org/en/) or its newer and safer Rust counterpart [Deno](https://deno.land/). + +### Node.js + +Install the program and its man page: `npm install -g readability-cli` -(Note to package maintainers: it might be a good idea to provide a symlink, so the man page can be accessed either as `readability-cli(1)` or as `readable(1)`.) +*(Note to package maintainers: it might be a good idea to provide a symlink, so the man page can be accessed either as `readability-cli(1)` or as `readable(1)`)* + +### Deno + +Deno support is still in development, running the script directly with `deno run ` is not supported. + +However, you can clone this Git repository and easily run the `readable.ts` script. + +```sh +git clone https://gitlab.com/gardenappl/readability-cli/ +cd readability-cli +./readable.ts +``` + +You can use `deno run` with the locally-downloaded script to fine-tune permissions, for example: + +`curl https://example.com | deno run --no-check readable.ts` + +By default Deno does not allow reading & writing files or accessing the network, meaning you have to rely on piping data in and out. + +Read more about Deno permissions [in their manual](https://deno.land/manual/getting_started/permissions). + +*(Package maintainers might consider adding a `readable-sandbox` executable which will run `readable` with restrictions)* ### Arch Linux -Arch Linux users may use the [readability-cli](https://aur.archlinux.org/packages/readability-cli/) AUR package instead. +Arch Linux users may use the "official" AUR packages: + +* [nodejs-readability-cli](https://aur.archlinux.org/packages/nodejs-readability-cli/) +* [deno-readability-cli](https://aur.archlinux.org/packages/deno-readability-cli/) ## Usage diff --git a/package.json b/package.json index 15e0f7c..c843693 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "readability-cli", - "version": "2.3.5", + "version": "2.4.0", "description": "Firefox Reader Mode in your terminal - get useful text from a web page using Mozilla's Readability library", "main": "index.js", "bin": { diff --git a/readability-cli.1 b/readability-cli.1 index dd3a7ca..07f6330 100644 --- a/readability-cli.1 +++ b/readability-cli.1 @@ -1,4 +1,4 @@ -.TH "READABILITY\-CLI" "1" "December 2021" "v2.3.5" "" +.TH "READABILITY\-CLI" "1" "March 2022" "v2.4.0" "" .SH "NAME" \fBreadability-cli\fR \- get useful text from a web page .SH SYNOPSYS @@ -37,7 +37,7 @@ Don't sanitize HTML\. \fB\-K\fP, \fB\-\-insecure\fP .RS 0 .IP \(bu 2 -Allow invalid SSL certificates\. +(Node\.js version only) Allow invalid SSL certificates\. .RE .P @@ -90,7 +90,7 @@ Output specific properties of the document (see \fBProperties\fR subsection)\. \fB\-x\fP, \fB\-\-proxy\fP \fIURL\fR .RS 0 .IP \(bu 2 -Use specified proxy (can also use \fBHTTPS_PROXY\fP environment variable)\. +(Node\.js version only) Use specified proxy\. Node\.js and Deno can also use \fBHTTPS_PROXY\fP environment variable\. .RE .P @@ -201,7 +201,7 @@ T} .P \fBreadability\-cli\fR supports localization, using the environment variables \fBLC_ALL\fP, \fBLC_MESSAGES\fP, \fBLANG\fP and \fBLANGUAGE\fP, in that order\. Only one language at a time is supported\. .P -\fBHTTPS_PROXY\fP will set the HTTPS proxy, as previously stated, however the \fB\-\-proxy\fP option overrides this\. Lowercase \fBhttps_proxy\fP and \fBhttp_proxy\fP are also recognized\. +\fBHTTPS_PROXY\fP will set the HTTPS proxy, as previously stated, however the \fB\-\-proxy\fP option overrides this\. Node\.js also recognizes lowercase \fBhttps_proxy\fP and \fBhttp_proxy\fP, for compatibility with \fBcurl\fP\|\. .SH EXAMPLE .P \fBRead HTML from a file and output the result to the console:\fR diff --git a/readable.ts b/readable.ts index 1e19ba9..70c1255 100644 --- a/readable.ts +++ b/readable.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S deno run --allow-net --allow-read --allow-write --allow-env=HTTPS_PROXY,LC_ALL,LC_MESSAGES,LANG,LANGUAGE --no-prompt --no-check -const version = "2.3.5" +const version = "2.4.0" import * as path from "https://deno.land/std@0.130.0/path/mod.ts"