diff --git a/README.md b/README.md index 747092e..28376ba 100644 --- a/README.md +++ b/README.md @@ -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 |✓ | | |✓ | diff --git a/lib/adapter_learnxiny.py b/lib/adapter_learnxiny.py index a623a9e..3fc459b 100644 --- a/lib/adapter_learnxiny.py +++ b/lib/adapter_learnxiny.py @@ -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" diff --git a/lib/get_answer.py b/lib/get_answer.py index ebd6c8b..9bc129c 100644 --- a/lib/get_answer.py +++ b/lib/get_answer.py @@ -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 diff --git a/lib/languages_data.py b/lib/languages_data.py index 8122e9e..9534b5b 100644 --- a/lib/languages_data.py +++ b/lib/languages_data.py @@ -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 = {