suntong / cascadia Goto Github PK
View Code? Open in Web Editor NEWGo cascadia package command line CSS selector
License: MIT License
Go cascadia package command line CSS selector
License: MIT License
It would be awesome if this was installable using homebrew on macOS:
⇒ brew create --help
Usage: brew create [options] URL
Generate a formula or, with --cask, a cask for the downloadable file at URL
and open it in the editor. Homebrew will attempt to automatically derive the
formula name and version, but if it fails, you'll have to make your own
template. The wget formula serves as a simple example. For the complete API,
see: https://rubydoc.brew.sh/Formula
--autotools Create a basic template for an
Autotools-style build.
--cask Create a basic template for a cask.
--cmake Create a basic template for a CMake-style
build.
--crystal Create a basic template for a Crystal build.
--go Create a basic template for a Go build.
--meson Create a basic template for a Meson-style
build.
--node Create a basic template for a Node build.
--perl Create a basic template for a Perl build.
--python Create a basic template for a Python build.
--ruby Create a basic template for a Ruby build.
--rust Create a basic template for a Rust build.
--no-fetch Homebrew will not download URL to the cache
and will thus not add its SHA-256 to the
formula for you, nor will it check the GitHub
API for GitHub projects (to fill out its
description and homepage).
--HEAD Indicate that URL points to the package's
repository rather than a file.
--set-name Explicitly set the name of the new formula
or cask.
--set-version Explicitly set the version of the new
formula or cask.
--set-license Explicitly set the license of the new
formula.
--tap Generate the new formula within the given
tap, specified as user/repo.
-f, --force Ignore errors for disallowed formula names
and names that shadow aliases.
-d, --debug Display any debugging information.
-q, --quiet Make some output more quiet.
-v, --verbose Make some output more verbose.
-h, --help Show this message.
something like this:
<p><a href="/home">some url</a></p>
$ cascadia --in my.html --out --css 'p > a' --raw-text
some url
$ cascadia --in my.html --out --css 'p > a' --raw-attr 'href'
/home
hi!
any idea how to do that ?
curl --silent https://en.wikipedia.org/wiki/Changelog | cascadia -i -o -c '#mw-content-text > p[0]'
Seems that DenseNormalStyle
is from github.com/mkideal/cli
, but the one imported in cascadia_main.go
is github.com/go-easygen/cli
.
go get github.com/suntong/cascadia 130 ↵
go: finding github.com/suntong/cascadia latest
# github.com/suntong/cascadia
../../go/pkg/mod/github.com/suntong/[email protected]/cascadia_main.go:55:20: undefined: "github.com/go-easygen/cli".DenseNormalStyle
Add contributors
Is it possible to better use stderr when I meet this output ?
I mean, see this
[mh-cbon@pc4 emd] $ curl --silent https://en.wikipedia.org/wiki/Changelog | cascadia -i -o -c 'div#mw-content-text > p:nth-child(2)' 1&>/dev/null
[mh-cbon@pc4 emd] $ curl --silent https://en.wikipedia.org/wiki/Changelog | cascadia -i -o -c 'div#mw-content-text > p:nth-child(2)' 2&>/dev/null
[mh-cbon@pc4 emd] $ curl --silent https://en.wikipedia.org/wiki/Changelog | cascadia -i -o -c 'div#mw-content-text > p:nth-child(2)'
1 elements for 'div#mw-content-text > p:nth-child(2)':
<p>A <b>changelog</b> is a log or record of all notable changes made to a project. The project is often a <a href="/wiki/Website" title="Website">website</a> or software project, and the changelog usually includes records of changes such as bug fixes, new features, etc. Some <a href="/wiki/Open_source" class="mw-redirect" title="Open source">open source</a> projects include a changelog as one of the top level files in their distribution.</p>
I thin this part 1 elements for 'div#mw-content-text > p:nth-child(2)':
should be sent on stderr,
everything else to stdout.
what do you think ?
Or a -q|--quiet
option ?
While attempting to install cascadia
as per:
I get the following error while trying to build:
==> go build -ldflags=-s -w Last 15 lines from /Users/devalias/Library/Logs/Homebrew/cascadia/01.go: 2023-01-08 01:25:31 +0000 go build -trimpath -o=/usr/local/Cellar/cascadia/1.2.6/bin/cascadia -ldflags=-s -w go: go.mod file not found in current directory or any parent directory; see 'go help modules'
Originally posted by @0xdevalias in #12 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.