diff options
author | Matthäus G. Chajdas <dev@anteru.net> | 2022-03-20 10:29:30 +0100 |
---|---|---|
committer | Matthäus G. Chajdas <dev@anteru.net> | 2022-03-20 10:29:30 +0100 |
commit | 64e8e05307689fe726ce9df2d5907e9c2fb67405 (patch) | |
tree | 1d2f1eb768972ac49933367b9ec127e638cb7466 /pygments/lexers/markup.py | |
parent | 96eaebafc848c989e9fc081768e3156add3128fd (diff) | |
download | pygments-git-64e8e05307689fe726ce9df2d5907e9c2fb67405.tar.gz |
Rework URL information in lexers.
This commit adds a new url field to a lexer, which can be used to link
to the language website, instead of relying on having the link in either
languages.rst or the docstring of the lexer. Additionally, it changes the
languages.rst file to auto-generate the list of lexers from the actual
source code, using the provided URL.
Diffstat (limited to 'pygments/lexers/markup.py')
-rw-r--r-- | pygments/lexers/markup.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/pygments/lexers/markup.py b/pygments/lexers/markup.py index 29472e2a..47feaeb6 100644 --- a/pygments/lexers/markup.py +++ b/pygments/lexers/markup.py @@ -106,7 +106,7 @@ class MoinWikiLexer(RegexLexer): class RstLexer(RegexLexer): """ - For `reStructuredText <http://docutils.sf.net/rst.html>`_ markup. + For reStructuredText markup. .. versionadded:: 0.7 @@ -121,6 +121,7 @@ class RstLexer(RegexLexer): .. versionadded:: 0.8 """ name = 'reStructuredText' + url = 'https://docutils.sourceforge.io/rst.html' aliases = ['restructuredtext', 'rst', 'rest'] filenames = ['*.rst', '*.rest'] mimetypes = ["text/x-rst", "text/prs.fallenstein.rst"] @@ -497,11 +498,12 @@ class MozPreprocCssLexer(DelegatingLexer): class MarkdownLexer(RegexLexer): """ - For `Markdown <https://help.github.com/categories/writing-on-github/>`_ markup. + For Markdown markup. .. versionadded:: 2.2 """ name = 'Markdown' + url = 'https://daringfireball.net/projects/markdown/' aliases = ['markdown', 'md'] filenames = ['*.md', '*.markdown'] mimetypes = ["text/x-markdown"] @@ -606,11 +608,12 @@ class MarkdownLexer(RegexLexer): class TiddlyWiki5Lexer(RegexLexer): """ - For `TiddlyWiki5 <https://tiddlywiki.com/#TiddlerFiles>`_ markup. + For TiddlyWiki5 markup. .. versionadded:: 2.7 """ name = 'tiddler' + url = 'https://tiddlywiki.com/#TiddlerFiles' aliases = ['tid'] filenames = ['*.tid'] mimetypes = ["text/vnd.tiddlywiki"] |