From d20f6a1f19a34e4c2cd872fea7c92910a59b88b0 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Fri, 18 Jun 2021 16:44:27 +0200 Subject: [PATCH] [mod] make themes.all update pygments*.less Add a searx/static/themes/*/src/generated empty folder --- manage | 11 +++++++++++ .../pygments-logicodev.less} | 2 +- .../src/generated/pygments-pointhi.less} | 2 +- .../themes/oscar/src/less/logicodev-dark/oscar.less | 1 + .../static/themes/oscar/src/less/logicodev/code.less | 2 -- .../static/themes/oscar/src/less/logicodev/oscar.less | 1 + searx/static/themes/oscar/src/less/pointhi/code.less | 2 -- searx/static/themes/oscar/src/less/pointhi/oscar.less | 1 + .../pointhi => simple/src/generated}/pygments.less | 2 +- searx/static/themes/simple/src/less/code.less | 2 +- searx_extra/update/update_pygments.py | 6 +++--- 11 files changed, 21 insertions(+), 11 deletions(-) rename searx/static/themes/oscar/src/{less/logicodev/pygments.less => generated/pygments-logicodev.less} (99%) rename searx/static/themes/{simple/src/less/pygments.less => oscar/src/generated/pygments-pointhi.less} (99%) rename searx/static/themes/{oscar/src/less/pointhi => simple/src/generated}/pygments.less (99%) diff --git a/manage b/manage index 167895158..9209f1d7a 100755 --- a/manage +++ b/manage @@ -325,6 +325,16 @@ node.clean() { dump_return $? } +pygments.less() { + [ "$_pyenv_OK" == "OK" ] && return 0 + build_msg PYGMENTS "searx_extra/update/update_pygments.py" + if ! pyenv.cmd python searx_extra/update/update_pygments.py; then + build_msg PYGMENTS "building LESS files for pygments failed" + return 1 + fi + return 0 +} + py.build() { build_msg BUILD "[pylint] python package ${PYDIST}" pyenv.cmd python setup.py \ @@ -462,6 +472,7 @@ test.clean() { themes.all() { ( set -e + pygments.less node.env themes.oscar themes.simple diff --git a/searx/static/themes/oscar/src/less/logicodev/pygments.less b/searx/static/themes/oscar/src/generated/pygments-logicodev.less similarity index 99% rename from searx/static/themes/oscar/src/less/logicodev/pygments.less rename to searx/static/themes/oscar/src/generated/pygments-logicodev.less index cc2f92356..6370a1286 100644 --- a/searx/static/themes/oscar/src/less/logicodev/pygments.less +++ b/searx/static/themes/oscar/src/generated/pygments-logicodev.less @@ -1,6 +1,6 @@ /* this file is generated automatically by searx_extra/update/update_pygments.py - using pygments version 2.8.1 + using pygments version 2.9.0 */ .code-highlight .linenos { diff --git a/searx/static/themes/simple/src/less/pygments.less b/searx/static/themes/oscar/src/generated/pygments-pointhi.less similarity index 99% rename from searx/static/themes/simple/src/less/pygments.less rename to searx/static/themes/oscar/src/generated/pygments-pointhi.less index e5ec9b8d9..0a32707cc 100644 --- a/searx/static/themes/simple/src/less/pygments.less +++ b/searx/static/themes/oscar/src/generated/pygments-pointhi.less @@ -1,6 +1,6 @@ /* this file is generated automatically by searx_extra/update/update_pygments.py - using pygments version 2.8.1 + using pygments version 2.9.0 */ .code-highlight .linenos { diff --git a/searx/static/themes/oscar/src/less/logicodev-dark/oscar.less b/searx/static/themes/oscar/src/less/logicodev-dark/oscar.less index 53ee7ae31..b0dbaee06 100644 --- a/searx/static/themes/oscar/src/less/logicodev-dark/oscar.less +++ b/searx/static/themes/oscar/src/less/logicodev-dark/oscar.less @@ -1,6 +1,7 @@ @import "../logicodev/variables.less"; @import "../../../../__common__/less/new_issue.less"; @import "../../../../__common__/less/stats.less"; +@import "../../generated/pygments-logicodev.less"; @stacked-bar-chart: rgb(213, 216, 215, 1); diff --git a/searx/static/themes/oscar/src/less/logicodev/code.less b/searx/static/themes/oscar/src/less/logicodev/code.less index 3aef9685f..de7613e9e 100644 --- a/searx/static/themes/oscar/src/less/logicodev/code.less +++ b/searx/static/themes/oscar/src/less/logicodev/code.less @@ -2,8 +2,6 @@ pre, code { font-family: 'Ubuntu Mono', 'Courier New', 'Lucida Console', monospace !important; } -@import "pygments.less"; - .code-highlight pre { margin-bottom: 25px; padding: 20px 10px; diff --git a/searx/static/themes/oscar/src/less/logicodev/oscar.less b/searx/static/themes/oscar/src/less/logicodev/oscar.less index 57c351bd9..7457154cb 100644 --- a/searx/static/themes/oscar/src/less/logicodev/oscar.less +++ b/searx/static/themes/oscar/src/less/logicodev/oscar.less @@ -1,6 +1,7 @@ @import "variables.less"; @import "../../../../__common__/less/new_issue.less"; @import "../../../../__common__/less/stats.less"; +@import "../../generated/pygments-logicodev.less"; @import "navbar.less"; @import "footer.less"; diff --git a/searx/static/themes/oscar/src/less/pointhi/code.less b/searx/static/themes/oscar/src/less/pointhi/code.less index 86fe15372..e69de29bb 100644 --- a/searx/static/themes/oscar/src/less/pointhi/code.less +++ b/searx/static/themes/oscar/src/less/pointhi/code.less @@ -1,2 +0,0 @@ -@import "pygments.less"; - diff --git a/searx/static/themes/oscar/src/less/pointhi/oscar.less b/searx/static/themes/oscar/src/less/pointhi/oscar.less index 689fc1471..f5ea85467 100644 --- a/searx/static/themes/oscar/src/less/pointhi/oscar.less +++ b/searx/static/themes/oscar/src/less/pointhi/oscar.less @@ -1,6 +1,7 @@ @import "variables.less"; @import "../../../../__common__/less/new_issue.less"; @import "../../../../__common__/less/stats.less"; +@import "../../generated/pygments-pointhi.less"; @import "footer.less"; @import "checkbox.less"; diff --git a/searx/static/themes/oscar/src/less/pointhi/pygments.less b/searx/static/themes/simple/src/generated/pygments.less similarity index 99% rename from searx/static/themes/oscar/src/less/pointhi/pygments.less rename to searx/static/themes/simple/src/generated/pygments.less index e5ec9b8d9..0a32707cc 100644 --- a/searx/static/themes/oscar/src/less/pointhi/pygments.less +++ b/searx/static/themes/simple/src/generated/pygments.less @@ -1,6 +1,6 @@ /* this file is generated automatically by searx_extra/update/update_pygments.py - using pygments version 2.8.1 + using pygments version 2.9.0 */ .code-highlight .linenos { diff --git a/searx/static/themes/simple/src/less/code.less b/searx/static/themes/simple/src/less/code.less index b732103fb..37d13e6c7 100644 --- a/searx/static/themes/simple/src/less/code.less +++ b/searx/static/themes/simple/src/less/code.less @@ -5,4 +5,4 @@ border: inherit; } -@import "pygments.less"; +@import "../generated/pygments.less"; diff --git a/searx_extra/update/update_pygments.py b/searx_extra/update/update_pygments.py index bdf03227e..de27abcce 100755 --- a/searx_extra/update/update_pygments.py +++ b/searx_extra/update/update_pygments.py @@ -125,17 +125,17 @@ def get_css(cssclass, style): def main(): - fname = 'static/themes/oscar/src/less/logicodev/pygments.less' + fname = 'static/themes/oscar/src/generated/pygments-logicodev.less' print("update: %s" % fname) with open(get_output_filename(fname), 'w') as f: f.write(get_css(CSSCLASS, LogicodevStyle)) - fname = 'static/themes/oscar/src/less/pointhi/pygments.less' + fname = 'static/themes/oscar/src/generated/pygments-pointhi.less' print("update: %s" % fname) with open(get_output_filename(fname), 'w') as f: f.write(get_css(CSSCLASS, 'default')) - fname = 'static/themes/simple/less/pygments.less' + fname = 'static/themes/simple/src/generated/pygments.less' print("update: %s" % fname) with open(get_output_filename(fname), 'w') as f: f.write(get_css(CSSCLASS, 'default'))