mirror of
https://github.com/chubin/cheat.sh.git
synced 2025-01-08 14:17:13 +03:00
renamed /:bash => /:cht.sh
This commit is contained in:
parent
e94417233e
commit
7324910ead
@ -24,6 +24,7 @@ import beautifier
|
||||
from globals import MYDIR, PATH_TLDR_PAGES, PATH_CHEAT_PAGES, PATH_CHEAT_SHEETS, COLOR_STYLES
|
||||
from adapter_learnxiny import get_learnxiny, get_learnxiny_list, is_valid_learnxy
|
||||
from languages_data import LANGUAGE_ALIAS, SO_NAME
|
||||
from colorize_internal import colorize_internal
|
||||
# pylint: enable=wrong-import-position,wrong-import-order
|
||||
|
||||
REDIS = redis.StrictRedis(host='localhost', port=6379, db=0)
|
||||
@ -31,7 +32,7 @@ REDIS = redis.StrictRedis(host='localhost', port=6379, db=0)
|
||||
MAX_SEARCH_LEN = 20
|
||||
|
||||
INTERNAL_TOPICS = [
|
||||
':bash',
|
||||
':cht.sh',
|
||||
':bash_completion',
|
||||
':emacs',
|
||||
':emacs-ivy',
|
||||
@ -174,7 +175,6 @@ def get_topic_type(topic): # pylint: disable=too-many-locals,too-many-branches,t
|
||||
#def registered_answer_getter(func):
|
||||
# REGISTERED_ANSWER_GETTERS.append(funct)
|
||||
# return cls
|
||||
|
||||
def _get_internal(topic):
|
||||
if '/' in topic:
|
||||
topic_type, topic_name = topic.split('/', 1)
|
||||
@ -194,7 +194,10 @@ def _get_internal(topic):
|
||||
return _get_stat()+"\n"
|
||||
|
||||
if topic in INTERNAL_TOPICS:
|
||||
return open(os.path.join(MYDIR, "share", topic[1:]+".txt"), "r").read()
|
||||
if topic[1:] == 'intro':
|
||||
return colorize_internal(open(os.path.join(MYDIR, "share", topic[1:]+".txt"), "r").read())
|
||||
else:
|
||||
return open(os.path.join(MYDIR, "share", topic[1:]+".txt"), "r").read()
|
||||
|
||||
return ""
|
||||
|
||||
|
@ -27,14 +27,14 @@ Special pages:
|
||||
:help this page
|
||||
:list list all cheat sheets
|
||||
:post how to post new cheat sheet
|
||||
:bash shell client
|
||||
:cht.sh shell client (cht.sh)
|
||||
:bash_completion bash function for tab completion
|
||||
:styles list of color styles
|
||||
:styles-demo show color styles usage examples
|
||||
|
||||
Shell client:
|
||||
|
||||
$ curl https://cht.sh/:bash > ~/bin/cht.sh
|
||||
$ curl https://cht.sh/:cht.sh > ~/bin/cht.sh
|
||||
$ chmod +x ~/bin/cht.sh
|
||||
$ cht.sh python :learn
|
||||
$ cht.sh --shell
|
||||
@ -42,9 +42,9 @@ Shell client:
|
||||
Tab completion:
|
||||
|
||||
$ mkdir -p ~/.bash.d/
|
||||
$ curl cheat.sh/:bash_completion > ~/.bash.d/cheat.sh
|
||||
$ . ~/.bash.d/cheat.sh
|
||||
$ echo '. ~/.bash.d/cheat.sh' >> ~/.bashrc
|
||||
$ curl cheat.sh/:bash_completion > ~/.bash.d/cht.sh
|
||||
$ . ~/.bash.d/cht.sh
|
||||
$ echo '. ~/.bash.d/cht.sh' >> ~/.bashrc
|
||||
|
||||
Editor integration:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user