diff --git a/README.md b/README.md index 6e866fe..52c99ab 100644 --- a/README.md +++ b/README.md @@ -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, diff --git a/lib/adapter/learnxiny.py b/lib/adapter/learnxiny.py index f6eb894..968e86a 100644 --- a/lib/adapter/learnxiny.py +++ b/lib/adapter/learnxiny.py @@ -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__()} diff --git a/lib/fmt/comments.py b/lib/fmt/comments.py index a603e82..9cc2982 100644 --- a/lib/fmt/comments.py +++ b/lib/fmt/comments.py @@ -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 diff --git a/lib/languages_data.py b/lib/languages_data.py index 8581f4d..4a18c57 100644 --- a/lib/languages_data.py +++ b/lib/languages_data.py @@ -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 = {