From bcd2f939e136bdbf60968f0314caa72787b47b50 Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 4 Mar 2023 19:56:41 +0100 Subject: [PATCH] use style --- clone_for_markdown.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/clone_for_markdown.py b/clone_for_markdown.py index cedc6af..5acc227 100644 --- a/clone_for_markdown.py +++ b/clone_for_markdown.py @@ -10,17 +10,17 @@ in : a relative path as given by GITEA_PREFIX_SRC (https://docs.gitea.io/en-us/c return : The name of the folder containing the cloned repo """ -# 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" - import sys import subprocess import os -if(len(sys.argv) != 2): - sys.exit("wrong number of args") # wrong number of args +if(len(sys.argv) != 4): + sys.exit("wrong number of args ") # wrong number of args + +# Prefix for the path where repository are saved, can be an url +PATH_PREFIX = sys.argv[2] +# Prefix for where we will clone the repos +CACHE_FOLDER_PATH = sys.argv[3] repo_path = sys.argv[1].split('/',3) if(len(repo_path)<2): @@ -35,4 +35,4 @@ if not os.path.isdir(CACHE_FOLDER_PATH): if not os.path.isdir(repo_name): subprocess.run(["git", "clone", repo_path, repo_name], check=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) -subprocess.run(["asciidoctor", "-s", "-a", "showtitle", "-a", "source-highlighter=rouge", "--out-file=-", f"--base-dir={repo_name}", "-"]) +subprocess.run(["asciidoctor", "-s", "-a", "showtitle", "-a", "source-highlighter=rouge", "-a", "rouge-css=style", "--out-file=-", f"--base-dir={repo_name}", "-"])