From d6364fa66584afdfdda7dcbe18ed05b27a96264a Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Fri, 2 Aug 2019 13:03:35 +0000 Subject: [PATCH] initial latex support (#151) --- README.md | 1 + lib/adapter/learnxiny.py | 6 ++++++ lib/languages_data.py | 1 + 3 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 981fa8e..2c86d72 100644 --- a/README.md +++ b/README.md @@ -735,6 +735,7 @@ At the moment, cheat.sh covers the 58 following programming languages (alphabeti |`js/` |JavaScript|✓ |✓ |✓ |✓ | |`julia/` |Julia |✓ | | |✓ | |`kotlin/` |Kotlin |✓ | | |✓ | +|`latex/` |LaTeX |✓ | | |✓ | |`lisp/` |Lisp |✓ | | |✓ | |`lua/` |Lua |✓ | | |✓ | |`matlab/` |MATLAB |✓ | | |✓ | diff --git a/lib/adapter/learnxiny.py b/lib/adapter/learnxiny.py index 8f7029c..8ccb6ec 100644 --- a/lib/adapter/learnxiny.py +++ b/lib/adapter/learnxiny.py @@ -870,4 +870,10 @@ class LearnGitAdapter(LearnXYAdapter): _filename = "git.html.markdown" _splitted = False +class LearnLatexAdapter(LearnXYAdapter): + "Learn Nim in Y Minutes" + prefix = "latex" + _filename = "latex.html.markdown" + _splitted = False + _ADAPTERS = {cls.prefix: cls() for cls in vars()['LearnXYAdapter'].__subclasses__()} diff --git a/lib/languages_data.py b/lib/languages_data.py index c656cc8..f8af212 100644 --- a/lib/languages_data.py +++ b/lib/languages_data.py @@ -39,6 +39,7 @@ LEXER = { "js" : pygments.lexers.JavascriptLexer, "julia" : pygments.lexers.JuliaLexer, "kotlin" : pygments.lexers.KotlinLexer, + "latex" : pygments.lexers.TexLexer, "lisp" : pygments.lexers.CommonLispLexer, "lua" : pygments.lexers.LuaLexer, "mathematica": pygments.lexers.MathematicaLexer,