mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-14 10:57:54 +02:00
chore(editor): rename constant, simplify Makefile help comment
Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
This commit is contained in:
parent
f905f5e138
commit
693752eb49
2
Makefile
2
Makefile
@ -662,7 +662,7 @@ generate-images: | node_modules ## generate images
|
|||||||
cd tools && node generate-images.ts $(TAGS)
|
cd tools && node generate-images.ts $(TAGS)
|
||||||
|
|
||||||
.PHONY: generate-codemirror-languages
|
.PHONY: generate-codemirror-languages
|
||||||
generate-codemirror-languages: | node_modules ## refresh assets/codemirror-languages.json from github-linguist
|
generate-codemirror-languages: | node_modules ## generate codemirror-languages.json
|
||||||
node tools/generate-codemirror-languages.ts
|
node tools/generate-codemirror-languages.ts
|
||||||
|
|
||||||
.PHONY: generate-manpage
|
.PHONY: generate-manpage
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
import {load as parseYaml} from 'js-yaml';
|
import {load as parseYaml} from 'js-yaml';
|
||||||
import {writeFile} from 'node:fs/promises';
|
import {writeFile} from 'node:fs/promises';
|
||||||
|
|
||||||
const LINGUIST_URL = 'https://raw.githubusercontent.com/github-linguist/linguist/main/lib/linguist/languages.yml';
|
const linguistUrl = 'https://raw.githubusercontent.com/github-linguist/linguist/main/lib/linguist/languages.yml';
|
||||||
|
|
||||||
// Map github-linguist language names to the names CodeMirror's @codemirror/language-data
|
// Map github-linguist language names to the names CodeMirror's @codemirror/language-data
|
||||||
// uses. Only languages that we want to load with extended extension/filename data are
|
// uses. Only languages that we want to load with extended extension/filename data are
|
||||||
@ -106,8 +106,8 @@ type CmLanguage = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const res = await fetch(LINGUIST_URL); // eslint-disable-line no-restricted-globals -- node build script, not browser code
|
const res = await fetch(linguistUrl); // eslint-disable-line no-restricted-globals -- node build script, not browser code
|
||||||
if (!res.ok) throw new Error(`fetch ${LINGUIST_URL} failed: ${res.status}`);
|
if (!res.ok) throw new Error(`fetch ${linguistUrl} failed: ${res.status}`);
|
||||||
const linguist = parseYaml(await res.text()) as Record<string, LinguistEntry>;
|
const linguist = parseYaml(await res.text()) as Record<string, LinguistEntry>;
|
||||||
|
|
||||||
const out: CmLanguage[] = [];
|
const out: CmLanguage[] = [];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user