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:
@@ -698,7 +698,7 @@ Some languages has the one-liners-cheat sheet, `1line`:
|
||||
|
||||

|
||||
|
||||
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,
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user