1
Fork 0

Compare commits

..

No commits in common. "67ebf317cb4ceb1d31c08ca01aeeba83eef08d78" and "9aab3f51326b935a8984d896f9af83a6cd52ac60" have entirely different histories.

4 changed files with 17 additions and 53 deletions

2
Cargo.lock generated
View File

@ -835,7 +835,7 @@ dependencies = [
[[package]] [[package]]
name = "select-html" name = "select-html"
version = "0.1.1" version = "0.1.0"
dependencies = [ dependencies = [
"assert_cmd", "assert_cmd",
"clap", "clap",

View File

@ -1,9 +1,9 @@
[package] [package]
name = "select-html" name = "select-html"
description = "Extract HTML using CSS selectors in the command-line." description = "A command-line tool to extract HTML using CSS selectors"
repository = "https://git.bauke.xyz/Bauke/select-html" repository = "https://github.com/Bauke/select-html"
license = "AGPL-3.0-or-later" license = "AGPL-3.0-or-later"
version = "0.1.1" version = "0.1.0"
authors = ["Bauke <me@bauke.xyz>"] authors = ["Bauke <me@bauke.xyz>"]
edition = "2021" edition = "2021"

View File

@ -1,28 +1,8 @@
# Select 👁️ HTML # select-html
> **Extract HTML using CSS selectors in the command-line.** > A command-line tool to extract HTML using CSS selectors.
## Features *AGPL-3.0-or-later*
* Input HTML using stdin or a file.
* Output full elements, inner text or attribute values.
* Trim excess whitespace from output.
## Installation
### Cargo
With a working [Rust and Cargo](https://www.rust-lang.org/learn/get-started) installation, you can install `select-html` from [Crates.io](https://crates.io/crates/select-html).
```
cargo install select-html
```
### Binaries
Precompiled `x86_64-unknown-linux-gnu` binaries are available on the [Releases page](https://git.bauke.xyz/Bauke/select-html/releases).
## Examples
```sh ```sh
# Use stdin to pipe HTML to select-html. # Use stdin to pipe HTML to select-html.
@ -41,7 +21,14 @@ select-html '.example' --text
select-html '[property^="og:"]' -a 'property' -a 'content' select-html '[property^="og:"]' -a 'property' -a 'content'
``` ```
## Usage ## Installation
You can download a precompiled executable from the [GitHub Releases] page, or install via [crates.io] (`cargo install select-html`).
[GitHub Releases]: https://github.com/Bauke/select-html/releases
[crates.io]: https://crates.io/crates/select-html
## `--help`
``` ```
USAGE: USAGE:
@ -59,11 +46,3 @@ OPTIONS:
--trim Trim whitespace from selected items --trim Trim whitespace from selected items
-V, --version Print version information -V, --version Print version information
``` ```
## Feedback
Found a problem or want to request a new feature? Email [me@bauke.xyz](mailto:me@bauke.xyz) and I'll see what I can do for you.
## License
Distributed under the [AGPL-3.0-or-later](https://spdx.org/licenses/AGPL-3.0-or-later.html) license, see [LICENSE](https://git.bauke.xyz/Bauke/select-html/src/branch/main/LICENSE) for more information.

View File

@ -1,21 +1,6 @@
// Copyright (C) 2022 Bauke <me@bauke.xyz> //! # select-html
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
// details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//! # Select 👁️ HTML
//! //!
//! > **Extract HTML using CSS selectors in the command-line.** //! > A command-line tool to extract HTML using CSS selectors
#![forbid(unsafe_code)] #![forbid(unsafe_code)]
#![warn(missing_docs, clippy::missing_docs_in_private_items)] #![warn(missing_docs, clippy::missing_docs_in_private_items)]