Changeset - 2917d2be0106
[Not reviewed]
default
1 2 0
Thomas De Schampheleire - 7 years ago 2018-09-15 21:52:16
thomas.de_schampheleire@nokia.com
cli: front-end-build: generate pygments.css dynamically

Rather than having pygments.css part of the Kallithea sources, generate it
on the fly via front-end-create

Idea comes from Dominik Ruf.
3 files changed with 7 insertions and 69 deletions:
0 comments (0 inline, 0 general)
.hgignore
Show inline comments
 
@@ -20,12 +20,13 @@ syntax: regexp
 
^sql_dumps/
 
^\.settings$
 
^\.project$
 
^\.pydevproject$
 
^\.coverage$
 
^kallithea/public/css/style\.css(\.map)?$
 
^kallithea/public/css/pygments.css$
 
^theme\.less$
 
^kallithea\.db$
 
^test\.db$
 
^Kallithea\.egg-info$
 
^my\.ini$
 
^fabfile.py
kallithea/bin/kallithea_cli_front_end.py
Show inline comments
 
@@ -40,11 +40,17 @@ def front_end_build(install_deps, genera
 
    if install_deps:
 
        click.echo("Running 'npm install' to install front-end dependencies from package.json")
 
        subprocess.check_call(['npm', 'install'], cwd=rootdir)
 

	
 
    if generate:
 
        click.echo("Generating CSS")
 
        with open(os.path.join(rootdir, 'kallithea', 'public', 'css', 'pygments.css'), 'w') as f:
 
            subprocess.check_call(['pygmentize',
 
                    '-S', 'default',
 
                    '-f', 'html',
 
                    '-a', '.code-highlight'],
 
                    stdout=f)
 
        lesscpath = os.path.join(rootdir, 'node_modules', '.bin', 'lessc')
 
        lesspath = os.path.join(rootdir, 'kallithea', 'public', 'less', 'main.less')
 
        csspath = os.path.join(rootdir, 'kallithea', 'public', 'css', 'style.css')
 
        subprocess.check_call([lesscpath, '--relative-urls', '--source-map',
 
                '--source-map-less-inline', lesspath, csspath])
kallithea/public/css/pygments.css
Show inline comments
 
deleted file
0 comments (0 inline, 0 general)