1
0
mirror of https://github.com/chubin/cheat.sh.git synced 2026-06-20 13:16:44 +02:00

added Git support

This commit is contained in:
Igor Chubin
2019-07-07 11:16:48 +00:00
parent 668fdcf21f
commit ea055559c4
4 changed files with 25 additions and 4 deletions
+9 -1
View File
@@ -698,7 +698,7 @@ Some languages has the one-liners-cheat sheet, `1line`:
![cheat.sh usage](http://cheat.sh/files/supported-languages-c++.png)
At the moment, cheat.sh covers the 57 following programming languages (alphabetically sorted):
At the moment, cheat.sh covers the 58 following programming languages (alphabetically sorted):
|Prefix |Language |Basics|One-liners|Weirdness|StackOverflow|
|-----------|----------|------|----------|---------|-------------|
@@ -738,6 +738,7 @@ At the moment, cheat.sh covers the 57 following programming languages (alphabeti
|`lisp/` |Lisp |✓ | | |✓ |
|`lua/` |Lua |✓ | | |✓ |
|`matlab/` |MATLAB |✓ | | |✓ |
|`nim/` |Nim |✓ | | |✓ |
|`ocaml/` |OCaml |✓ | | |✓ |
|`octave/` |Octave |✓ | | |✓ |
|`perl/` |Perl |✓ |✓ | |✓ |
@@ -760,6 +761,13 @@ At the moment, cheat.sh covers the 57 following programming languages (alphabeti
|`vb/` |VisualBasic|✓ | | |✓ |
|`vbnet/` |VB.Net |✓ | | |✓ |
And several other topics, that are though related to programming,
are not programming languages:
|Prefix |Topic |Basics|StackOverflow|
|-----------|----------|------|-------------|
|`git/` |Git |✓ |✓ |
## Cheat sheets sources
Instead of creating yet another mediocre cheat sheet repository,
+7 -1
View File
@@ -852,10 +852,16 @@ class LearnVisualBasicAdapter(LearnXYAdapter):
_filename = "visualbasic.html.markdown"
_splitted = False
class LearnVisualBasicAdapter(LearnXYAdapter):
class LearnNimAdapter(LearnXYAdapter):
"Learn Nim in Y Minutes"
prefix = "nim"
_filename = "nim.html.markdown"
_splitted = False
class LearnGitAdapter(LearnXYAdapter):
"Learn Git in Y Minutes"
prefix = "git"
_filename = "git.html.markdown"
_splitted = False
_ADAPTERS = {cls.prefix: cls() for cls in vars()['LearnXYAdapter'].__subclasses__()}
+6 -2
View File
@@ -298,8 +298,12 @@ def beautify(text, lang, options):
text = text.encode('utf-8')
digest = "t:%s:%s:%s" % (hashlib.md5(text).hexdigest(), lang, mode)
# if lang == 'git':
# cache.delete(digest)
# temporary added line that removes invalid cache entries
# that used wrong commenting methods
if lang in ['git']:
cache.delete(digest)
answer = cache.get(digest)
if answer:
return answer
+3
View File
@@ -31,6 +31,7 @@ LEXER = {
"forth" : pygments.lexers.ForthLexer,
"fortran" : pygments.lexers.FortranLexer,
"fsharp" : pygments.lexers.FSharpLexer,
"git" : pygments.lexers.BashLexer,
"go" : pygments.lexers.GoLexer,
"groovy" : pygments.lexers.GroovyLexer,
"haskell" : pygments.lexers.HaskellLexer,
@@ -117,6 +118,8 @@ VIM_NAME = {
'solidity' : 'js',
'mathematica': 'mma',
'wolfram-mathematica': 'mma',
'git' : 'sh',
}
SO_NAME = {