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

added new language: solidity

This commit is contained in:
Igor Chubin
2018-07-27 17:31:36 +00:00
parent 22ab569e5d
commit 7ef67a384f
4 changed files with 14 additions and 2 deletions
+2 -1
View File
@@ -22,7 +22,7 @@ Such a thing exists.
**cheat.sh**
* Has a simple curl/browser interface.
* Covers 55 programming languages, several DBMSes, and more than 1000 most important UNIX/Linux commands.
* Covers 56 programming languages, several DBMSes, and more than 1000 most important UNIX/Linux commands.
* Provides access to the best community driven cheat sheets repositories in the world, on par with StackOverflow.
* Available everywhere, no installation needed.
* Ultrafast, returns answers within 100 ms, as a rule.
@@ -675,6 +675,7 @@ At the moment, cheat.sh covers the 55 following programming languages (alphabeti
|`rust/` |Rust |✓ | | |✓ |
|`scala/` |Scala |✓ | | |✓ |
|`scheme/` |Scheme |✓ | | |✓ |
|`solidity/`|Solidity |✓ | | |✓ |
|`swift/` |Swift |✓ | | |✓ |
|`tcsh/` |Tcsh |✓ | | |✓ |
|`tcl/` |Tcl |✓ | | |✓ |
+6
View File
@@ -737,6 +737,12 @@ class LearnRubyAdapter(LearnXYAdapter):
answer = answer[:1]
return answer
class LearnSwiftAdapter(LearnXYAdapter):
"Learn Solidity in Y Minutes"
prefix = "solidity"
_filename = "solidity.html.markdown"
_splitted = False
class LearnSwiftAdapter(LearnXYAdapter):
"Learn Swift in Y Minutes"
prefix = "swift"
+4 -1
View File
@@ -98,7 +98,7 @@ def _get_answers_and_dirs():
answer_dirs = [_remove_initial_underscore(os.path.split(topic)[1]).rstrip('/')+'/'
for topic in topics if _isdir(topic)]
answers = [os.path.split(topic)[1] for topic in topics if not _isdir(topic)]
return answer_dirs, answers
return answers, answer_dirs
def _update_cheat_sheets_topics():
answers = _get_answer_files_from_folder()
@@ -181,6 +181,8 @@ def get_topic_type(topic): # pylint: disable=too-many-locals,too-many-branches,t
result = 'question'
if result == 'unknown' or result == 'question':
print("result = ", result)
print(CHEAT_SHEETS_TOPICS)
if topic in CHEAT_SHEETS_TOPICS:
result = "cheat.sheets"
elif topic.rstrip('/') in CHEAT_SHEETS_DIRS and topic.endswith('/'):
@@ -191,6 +193,7 @@ def get_topic_type(topic): # pylint: disable=too-many-locals,too-many-branches,t
result = "tldr"
elif '/' not in topic:
result = "unknown"
print("result = ", result)
TOPIC_TYPE_CACHE[topic] = result
+2
View File
@@ -54,6 +54,7 @@ LEXER = {
"racket" : pygments.lexers.RacketLexer,
"ruby" : pygments.lexers.RubyLexer,
"rust" : pygments.lexers.RustLexer,
"solidity" : pygments.lexers.JavascriptLexer,
"scala" : pygments.lexers.ScalaLexer,
"scheme": pygments.lexers.SchemeLexer,
"sql" : pygments.lexers.SqlLexer,
@@ -105,6 +106,7 @@ VIM_NAME = {
'python3' : 'python',
'python-3.x': 'python',
'tcsh' : 'sh',
'solidity' : 'js',
}
SO_NAME = {