forked from Bash-it/bash-it
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into bats-precommit
- Loading branch information
Showing
25 changed files
with
363 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
complete -o nospace -S = -W '$(printenv | awk -F= "{print \$1}")' export | ||
# shellcheck shell=bash | ||
|
||
complete -o nospace -S = -W "$(printenv | awk -F= "{print \$1}")" export |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.. _inretio: | ||
|
||
Inretio Theme | ||
============= | ||
|
||
Simple theme showing date and time, username and hostname, current folder, Git details and as a bonus - virtual environment along with Python version available in it. | ||
|
||
Inspired by existing themes: | ||
- metal | ||
- bobby | ||
|
||
Examples | ||
-------- | ||
|
||
In Git-tracked folder: | ||
|
||
.. code-block:: bash | ||
┌──[2024-03-20 12:05:07] 🐧 gytis 💻 gytis-legion 📂 bash-it on 🌵 theme-inretio ⌀1 ✗ | ||
└> ls | ||
aliases clean_files.txt custom hooks lib lint_clean_files.sh profiles template test_lib uninstall.sh | ||
bash_it.sh completion docs install.sh LICENSE plugins scripts test themes vendor | ||
In Python virtual environment: | ||
|
||
.. code-block:: bash | ||
┌──[2024-03-20 12:07:32] 🐧 gytis 💻 gytis-legion 🐍 3.12.2 on [general] 📂 general | ||
└> ls | ||
bin include lib lib64 pyvenv.cfg share | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# shellcheck shell=bash | ||
cite about-plugin | ||
about-plugin 'Basic url handling and manipulation functions' | ||
|
||
function slugify() { | ||
about 'takes the text and transform to slug url, also supports formats like (html,link,rst,md)' | ||
group 'url' | ||
param "1: Text to transform (optional)" | ||
param "2: Output format (html,rst,link,md). Omit or pass any text to return only output" | ||
|
||
local TXT=$1 | ||
local OUTPUT=$2 | ||
local SLUG | ||
|
||
if [[ -z $TXT ]]; then | ||
read -rp "Enter the valid string: " TXT | ||
fi | ||
|
||
# Pass 1 - Clean the url | ||
# Credits: https://stackoverflow.com/a/20007549/10362396 | ||
SLUG=$(echo -n "$TXT" | tr -cd ' [:alnum:]._-' | tr -s ' ') | ||
|
||
# Pass 2 - Transformation | ||
SLUG=$(echo -n "$SLUG" | tr '[:upper:]' '[:lower:]' | tr ' ' '-') | ||
|
||
case "$OUTPUT" in | ||
html | htm) | ||
echo "<a href=\"#$SLUG\">$TXT</a>" | ||
;; | ||
href | link) | ||
echo "#$SLUG" | ||
;; | ||
md) | ||
echo "[$TXT](#$SLUG)" | ||
;; | ||
rst) | ||
echo "\`$TXT <#$SLUG>\`_" | ||
;; | ||
|
||
*) | ||
echo "$SLUG" | ||
;; | ||
esac | ||
|
||
} |
Oops, something went wrong.