1
0

Import into git

This commit is contained in:
Thibault “Adædra” Hamel 2024-04-27 02:00:14 +02:00
parent 114fc33588
commit c49bf06e1b
4 changed files with 31 additions and 0 deletions

3
Containerfile Normal file
View File

@ -0,0 +1,3 @@
FROM gitea/gitea:1.21
RUN apk --no-cache add asciidoctor ruby-rouge
COPY extended_rouge.rb /opt/extended_rouge.rb

5
README.asciidoc Normal file
View File

@ -0,0 +1,5 @@
= Gitea modifications
My modifications on Gitea for use on my https://gitea.adaedra.eu/[instance].
Currently only adds support for Asciidoc documents with syntax highlighting.

12
app.ini Normal file
View File

@ -0,0 +1,12 @@
; Append to your own app.ini
[markup.sanitizer.chroma]
ELEMENT = pre
ALLOW_ATTR = class
REGEXP = ^chroma$
[markup.asciidoc]
ENABLED = true
FILE_EXTENSIONS = .adoc,.asciidoc
RENDER_COMMAND = "asciidoctor -r /opt/extended_rouge -s -a showtitle -a source-highlighter=rouge --out-file=- -"
IS_INPUT_FILE = false

11
extended_rouge.rb Normal file
View File

@ -0,0 +1,11 @@
class ExtendedRougeSyntaxHighlighter < (Asciidoctor::SyntaxHighlighter.for 'rouge')
register_for 'rouge'
def format(_node, _lang, opts)
opts[:transform] = proc do |pre, code|
pre['class'] = 'chroma'
end
super
end
end