This commit is contained in:
leo 2023-03-04 17:16:14 +01:00
parent 6e8c41af46
commit 370ab6f45f
Signed by: leo
GPG Key ID: 0DD993BFB2B307DB
2 changed files with 42 additions and 0 deletions

1
.doc_vars.adoc Normal file
View File

@ -0,0 +1 @@
:repo-url: https://git.leserveurdansmongrenier.uk/leo/gitea-asciidoc.git

41
README.adoc Normal file
View File

@ -0,0 +1,41 @@
:source-highlighter: highlight.js
= Gitea Asciidoc
include::.doc_vars.adoc[]
Un script python pour permettre le rendu de fichier Asciidoc dans gitea avec le support pour les commandes `+include::+`.
= Utilisation
Récuperation du script :
[subs="attributes"]
----
git clone {repo-url}
----
Modification des dossier de récuperation et d'enregistrement :
.clone_for_markdown.py
[source,python]
----
# Prefix for the path where repository are saved, can be an url
PATH_PREFIX = "/var/lib/gitea/git/repositories"
# Prefix for where we will clone the repos
CACHE_FOLDER_PATH = "/var/lib/gitea/markdown_cache"
----
Mise à jour de la configuration Gitea :
.app.ini
[source,diff]
----
[markup.asciidoc]
ENABLED = true
FILE_EXTENSIONS = .adoc,.asciidoc
+ RENDER_COMMAND = "python3 /var/lib/gitea/gitea-asciidoc-script/clone_for_markdown.py $GITEA_PREFIX_SRC"
- RENDER_COMMAND = "asciidoctor -a showtitle --out-file=- -"
; Input is not a standard input but a file
IS_INPUT_FILE = false
----