From 89f73b06a879260b4854b87803e4a3c0020a0c42 Mon Sep 17 00:00:00 2001 From: zeripath Date: Wed, 17 Nov 2021 20:37:00 +0000 Subject: [PATCH] Add .gitattribute assisted language detection to blame, diff and render (#17590) Use check attribute code to check the assigned language of a file and send that in to chroma as a hint for the language of the file. Signed-off-by: Andrew Thornton --- doc/advanced/config-cheat-sheet.en-us.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/advanced/config-cheat-sheet.en-us.md index 3b5d9213..a087b253 100644 --- a/doc/advanced/config-cheat-sheet.en-us.md +++ b/doc/advanced/config-cheat-sheet.en-us.md @@ -982,6 +982,14 @@ Multiple sanitisation rules can be defined by adding unique subsections, e.g. `[ To apply a sanitisation rules only for a specify external renderer they must use the renderer name, e.g. `[markup.sanitizer.asciidoc.rule-1]`. If the rule is defined above the renderer ini section or the name does not match a renderer it is applied to every renderer. +## Highlight Mappings (`highlight.mapping`) + +- `file_extension e.g. .toml`: **language e.g. ini**. File extension to language mapping overrides. + +- Gitea will highlight files using the `linguist-language` or `gitlab-language` attribute from the `.gitattributes` file +if available. If this is not set or the language is unavailable, the file extension will be looked up +in this mapping or the filetype using heuristics. + ## Time (`time`) - `FORMAT`: Time format to display on UI. i.e. RFC1123 or 2006-01-02 15:04:05