mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
build_pygments_data: Reprioritize and categorize pygment language codes.
We now organize the pygment language codes into meaningful categories - default, custom and aliases. Further the `lang.json` list now contains a dataset extracted from the "language" section of https://insights.stackoverflow.com/survey/2020 and is prioritized based on current language trends.
This commit is contained in:
committed by
Tim Abbott
parent
98253f261e
commit
83a2479a5a
@@ -5,11 +5,15 @@ import os
|
||||
from pygments.lexers import get_all_lexers
|
||||
|
||||
ZULIP_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../")
|
||||
# The current priorities data set is based on StackOverflow's 2020 survey.
|
||||
DATA_PATH = os.path.join(ZULIP_PATH, "tools", "setup", "lang.json")
|
||||
OUT_PATH = os.path.join(ZULIP_PATH, "static", "generated", "pygments_data.json")
|
||||
|
||||
with open(DATA_PATH) as f:
|
||||
priorities = json.load(f)
|
||||
pygments_data = json.load(f)
|
||||
priorities = dict(
|
||||
**pygments_data["default"], **pygments_data["custom"], **pygments_data["aliases"]
|
||||
)
|
||||
|
||||
lexers = get_all_lexers()
|
||||
langs = {
|
||||
|
||||
Reference in New Issue
Block a user