use style
This commit is contained in:
parent
f964582814
commit
bcd2f939e1
@ -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 <source repo> <prefix> <cache path>") # 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}", "-"])
|
||||
|
Loading…
x
Reference in New Issue
Block a user