ref: rayso func
This commit is contained in:
parent
302436f0ea
commit
0f99bf0d21
@ -219,12 +219,16 @@ split-file() {
|
|||||||
|
|
||||||
# returns url to code previewer
|
# returns url to code previewer
|
||||||
rayso() {
|
rayso() {
|
||||||
test -z "$1" && return 1
|
local CODE TITLE
|
||||||
local CODE FILENAME
|
|
||||||
|
|
||||||
|
if [[ -n "$1" ]]; then
|
||||||
CODE="$(cat "$1" | base64)"
|
CODE="$(cat "$1" | base64)"
|
||||||
FILENAME="$(basename "$1")"
|
TITLE="$(basename "$1")"
|
||||||
|
else
|
||||||
|
CODE="$(cat | base64)"
|
||||||
|
TITLE="Code"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "https://ray.so/?colors=candy&background=true&darkMode=true&padding=64&title=${FILENAME}&code=${CODE}&language=auto"
|
echo "https://ray.so/?colors=candy&background=true&darkMode=true&padding=64&title=${TITLE}&code=${CODE}&language=auto"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user