mirror of
https://gitea.com/gitea/docs.git
synced 2026-07-22 02:37:42 +00:00
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 <art27@cantab.net>
This commit is contained in:
@@ -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]`.
|
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.
|
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`)
|
## Time (`time`)
|
||||||
|
|
||||||
- `FORMAT`: Time format to display on UI. i.e. RFC1123 or 2006-01-02 15:04:05
|
- `FORMAT`: Time format to display on UI. i.e. RFC1123 or 2006-01-02 15:04:05
|
||||||
|
|||||||
Reference in New Issue
Block a user