diff --git a/AUTHORS.rst b/AUTHORS.rst index 265a9fd41..95d154b12 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -173,4 +173,5 @@ features or generally made searx better: - Austin Olacsi `` - @micsthepick - Daniel Kukula `` -- Patrick Evans `https://github.com/holysoles` \ No newline at end of file +- Patrick Evans `https://github.com/holysoles` +- Daniel Mowitz `` diff --git a/Makefile b/Makefile index 073b4de27..de4a7e5f0 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ search.checker.%: install $(Q)./manage pyenv.cmd searxng-checker -v "$(subst _, ,$(patsubst search.checker.%,%,$@))" PHONY += test ci.test test.shell -ci.test: test.yamllint test.black test.pyright test.pylint test.unit test.robot test.rst test.pybabel +ci.test: test.yamllint test.black test.pyright test.pylint test.unit test.robot test.rst test.pybabel test.themes test: test.yamllint test.black test.pyright test.pylint test.unit test.robot test.rst test.shell test.shell: $(Q)shellcheck -x -s dash \ @@ -83,8 +83,9 @@ MANAGE += node.env node.env.dev node.clean MANAGE += py.build py.clean MANAGE += pyenv pyenv.install pyenv.uninstall MANAGE += format.python -MANAGE += test.yamllint test.pylint test.pyright test.black test.pybabel test.unit test.coverage test.robot test.rst test.clean -MANAGE += themes.all themes.simple themes.simple.test pygments.less +MANAGE += test.yamllint test.pylint test.pyright test.black test.pybabel test.unit test.coverage test.robot test.rst test.clean test.themes +MANAGE += themes.all themes.fix themes.test +MANAGE += themes.simple themes.simple.pygments themes.simple.fix MANAGE += static.build.commit static.build.drop static.build.restore MANAGE += nvm.install nvm.clean nvm.status nvm.nodejs diff --git a/docs/dev/quickstart.rst b/docs/dev/quickstart.rst index 917d90c12..1b15a5b4a 100644 --- a/docs/dev/quickstart.rst +++ b/docs/dev/quickstart.rst @@ -6,7 +6,8 @@ Development Quickstart .. _npm: https://www.npmjs.com/ .. _Node.js: https://nodejs.org/ - +.. _eslint: https://eslint.org/ +.. _stylelint: https://stylelint.io/ .. sidebar:: further read @@ -40,7 +41,8 @@ to our ":ref:`how to contribute`" guideline. If you implement themes, you will need to setup a :ref:`Node.js environment `. Before you call *make run* (2.), you need to compile the -modified styles and JavaScript: ``make node.clean themes.all`` +modified styles and JavaScript: ``make node.clean themes.all``. If eslint_ or +stylelint_ report some issues, try ``make themes.fix``. Alternatively you can also compile selective the theme you have modified, e.g. the *simple* theme. diff --git a/searx/engines/astrophysics_data_system.py b/searx/engines/astrophysics_data_system.py new file mode 100644 index 000000000..a1d942b50 --- /dev/null +++ b/searx/engines/astrophysics_data_system.py @@ -0,0 +1,93 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""".. sidebar:: info + +The Astrophysics Data System (ADS) is a digital library portal for researchers in astronomy and physics, +operated by the Smithsonian Astrophysical Observatory (SAO) under a NASA grant. +The engine is adapted from the solr engine. + +""" + +# pylint: disable=global-statement + +from datetime import datetime +from json import loads +from urllib.parse import urlencode +from searx.exceptions import SearxEngineAPIException + +about = { + "website": 'https://ui.adsabs.harvard.edu/', + "wikidata_id": 'Q752099', + "official_api_documentation": 'https://ui.adsabs.harvard.edu/help/api/api-docs.html', + "use_official_api": True, + "require_api_key": True, + "results": 'JSON', +} + +base_url = 'https://api.adsabs.harvard.edu/v1/search' +result_base_url = 'https://ui.adsabs.harvard.edu/abs/' +rows = 10 +sort = '' # sorting: asc or desc +field_list = ['bibcode', 'author', 'title', 'abstract', 'doi', 'date'] # list of field names to display on the UI +default_fields = '' # default field to query +query_fields = '' # query fields +paging = True +api_key = 'unset' + + +def init(_): + if api_key == 'unset': + raise SearxEngineAPIException('missing ADS API key') + + +def request(query, params): + query_params = {'q': query, 'rows': rows} + if field_list: + query_params['fl'] = ','.join(field_list) + if query_fields: + query_params['qf'] = ','.join(query_fields) + if default_fields: + query_params['df'] = default_fields + if sort: + query_params['sort'] = sort + + query_params['start'] = rows * (params['pageno'] - 1) + + params['headers']['Authorization'] = f'Bearer {api_key}' + params['url'] = f"{base_url}/query?{urlencode(query_params)}" + + return params + + +def response(resp): + try: + resp_json = loads(resp.text) + except Exception as e: + raise SearxEngineAPIException("failed to parse response") from e + + if 'error' in resp_json: + raise SearxEngineAPIException(resp_json['error']['msg']) + + resp_json = resp_json["response"] + result_len = resp_json["numFound"] + results = [] + + for res in resp_json["docs"]: + author = res.get("author") + + if author: + author = author[0] + ' et al.' + + results.append( + { + 'url': result_base_url + res.get("bibcode") + "/", + 'title': res.get("title")[0], + 'author': author, + 'content': res.get("abstract"), + 'doi': res.get("doi"), + 'publishedDate': datetime.fromisoformat(res.get("date")), + } + ) + + results.append({'number_of_results': result_len}) + + return results diff --git a/searx/settings.yml b/searx/settings.yml index c29994227..a774b0fc0 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -380,6 +380,14 @@ engines: require_api_key: false results: JSON + # - name: astrophysics data system + # engine: astrophysics_data_system + # sort: asc + # weight: 5 + # categories: [science] + # api_key: your-new-key + # shortcut: ads + - name: alpine linux packages engine: alpinelinux disabled: true diff --git a/searx/static/themes/simple/css/searxng-rtl.min.css b/searx/static/themes/simple/css/searxng-rtl.min.css index 94075b096..abacadeee 100644 Binary files a/searx/static/themes/simple/css/searxng-rtl.min.css and b/searx/static/themes/simple/css/searxng-rtl.min.css differ diff --git a/searx/static/themes/simple/css/searxng-rtl.min.css.map b/searx/static/themes/simple/css/searxng-rtl.min.css.map index 37b9ff471..cbdd116d5 100644 Binary files a/searx/static/themes/simple/css/searxng-rtl.min.css.map and b/searx/static/themes/simple/css/searxng-rtl.min.css.map differ diff --git a/searx/static/themes/simple/css/searxng.min.css b/searx/static/themes/simple/css/searxng.min.css index 68a053d97..dfccd41b1 100644 Binary files a/searx/static/themes/simple/css/searxng.min.css and b/searx/static/themes/simple/css/searxng.min.css differ diff --git a/searx/static/themes/simple/css/searxng.min.css.map b/searx/static/themes/simple/css/searxng.min.css.map index 03c3941c1..21706751f 100644 Binary files a/searx/static/themes/simple/css/searxng.min.css.map and b/searx/static/themes/simple/css/searxng.min.css.map differ diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js index bd04b2468..a40e48120 100644 --- a/searx/static/themes/simple/gruntfile.js +++ b/searx/static/themes/simple/gruntfile.js @@ -21,9 +21,10 @@ module.exports = function (grunt) { pkg: grunt.file.readJSON('package.json'), watch: { scripts: { - files: ['gruntfile.js', 'src/**'], + files: ['gruntfile.js', 'eslint.config.mjs', '.stylelintrc.json', 'src/**'], tasks: [ 'eslint', + 'stylelint', 'copy', 'uglify', 'less', @@ -49,6 +50,7 @@ module.exports = function (grunt) { stylelint: { options: { formatter: 'unix', + fix: grunt.option('fix') }, src: [ 'src/less/**/*.less', @@ -298,7 +300,7 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-stylelint'); grunt.loadNpmTasks('grunt-eslint'); - grunt.registerTask('test', ['eslint']); + grunt.registerTask('test', ['eslint', 'stylelint']); grunt.registerTask('default', [ 'eslint', diff --git a/searx/static/themes/simple/package.json b/searx/static/themes/simple/package.json index 5ff49057a..e56adbaa7 100644 --- a/searx/static/themes/simple/package.json +++ b/searx/static/themes/simple/package.json @@ -29,12 +29,13 @@ "scripts": { "all": "npm install && grunt", "build": "grunt", - "test": "grunt test", + "clean": "rm -Rf node_modules", "eslint": "grunt eslint", "eslint-fix": "grunt eslint --fix", - "watch": "grunt watch", - "clean": "rm -Rf node_modules", + "fix": "grunt test --fix", "stylelint": "grunt stylelint", - "stylelint-fix": "grunt stylelint --fix" + "stylelint-fix": "grunt stylelint --fix", + "test": "grunt test", + "watch": "grunt watch --fix" } } diff --git a/searx/static/themes/simple/src/less/autocomplete.less b/searx/static/themes/simple/src/less/autocomplete.less index 32c016e06..8285ff2c6 100644 --- a/searx/static/themes/simple/src/less/autocomplete.less +++ b/searx/static/themes/simple/src/less/autocomplete.less @@ -53,7 +53,7 @@ color: var(--color-autocomplete-font); max-height: 32rem; overflow-y: auto; - z-index: 100; + z-index: 5000; margin-top: 3.5rem; border-radius: 0.8rem; diff --git a/searx/static/themes/simple/src/less/definitions.less b/searx/static/themes/simple/src/less/definitions.less index 802b3abf1..7501305fc 100644 --- a/searx/static/themes/simple/src/less/definitions.less +++ b/searx/static/themes/simple/src/less/definitions.less @@ -280,7 +280,7 @@ @results-image-row-height-phone: 10rem; @search-width: 44rem; // heigh of #search, see detail.less -@search-height: 7.6rem; +@search-height: 13rem; /// Device Size /// @desktop > @tablet diff --git a/searx/static/themes/simple/src/less/detail.less b/searx/static/themes/simple/src/less/detail.less index ad4e3d5ff..fd5cd8e05 100644 --- a/searx/static/themes/simple/src/less/detail.less +++ b/searx/static/themes/simple/src/less/detail.less @@ -22,7 +22,7 @@ article.result-images .detail { bottom: 0; background: var(--color-result-detail-background); border: 1px solid var(--color-result-detail-background); - z-index: 10000; + z-index: 1000; padding: 4rem 3rem 3rem 3rem; a.result-images-source { @@ -148,7 +148,7 @@ article.result-images .detail { height: 1.5rem; position: absolute; filter: opacity(40%); - z-index: 2000002; + z-index: 1200; span { display: block; diff --git a/searx/static/themes/simple/src/less/search.less b/searx/static/themes/simple/src/less/search.less index ce755e17e..a46e4bf06 100644 --- a/searx/static/themes/simple/src/less/search.less +++ b/searx/static/themes/simple/src/less/search.less @@ -158,7 +158,7 @@ button.category_button { outline: none; color: var(--color-search-font); font-size: 1.1rem; - z-index: 10000; + z-index: 1000; &:hover { color: var(--color-search-background-hover); @@ -183,7 +183,7 @@ html.no-js #clear_search.hide_if_nojs { outline: none; color: var(--color-search-font); font-size: 1.1rem; - z-index: 2; + z-index: 100; } #q { @@ -332,7 +332,7 @@ html.no-js #clear_search.hide_if_nojs { top: 0; height: 100%; width: 100%; - z-index: 10000; + z-index: 2000; .search_box { border-bottom: 1px solid var(--color-search-border); diff --git a/searx/static/themes/simple/src/less/style.less b/searx/static/themes/simple/src/less/style.less index b46bd2591..7dca47402 100644 --- a/searx/static/themes/simple/src/less/style.less +++ b/searx/static/themes/simple/src/less/style.less @@ -543,7 +543,13 @@ article[data-vim-selected].category-social { margin-bottom: 0; .ltr-margin-left(@results-offset); display: grid; - grid-template: "corrections sidebar" min-content "answers sidebar" min-content "urls sidebar" 1fr "pagination sidebar" min-content / @results-width @results-sidebar-width; + grid-template: + "corrections sidebar" min-content + "answers sidebar" min-content + "urls sidebar" 1fr + "pagination sidebar" min-content + / @results-width @results-sidebar-width + ; gap: 0 @results-gap; } @@ -967,7 +973,14 @@ summary.title { margin: 0 auto; justify-content: center; display: grid; - grid-template: "corrections" min-content "answers" min-content "sidebar" min-content "urls" 1fr "pagination" min-content min-content / @results-width; + grid-template: + "corrections" min-content + "answers" min-content + "sidebar" min-content + "urls" 1fr + "pagination" min-content + / @results-width + ; gap: 0; } } @@ -1005,7 +1018,13 @@ summary.title { #main_results div#results.only_template_images { margin: 1rem @results-tablet-offset 0 @results-tablet-offset; display: grid; - grid-template: "corrections" min-content "answers" min-content "sidebar" min-content "urls" 1fr "pagination" min-content / 100%; + grid-template: + "corrections" min-content + "answers" min-content + "sidebar" min-content + "urls" 1fr + "pagination" min-content + / 100%; gap: 0; #sidebar { diff --git a/searx/static/themes/simple/src/less/toolkit.less b/searx/static/themes/simple/src/less/toolkit.less index c256aef1a..d3fb2273b 100644 --- a/searx/static/themes/simple/src/less/toolkit.less +++ b/searx/static/themes/simple/src/less/toolkit.less @@ -203,7 +203,7 @@ div.selectable_url { left: 50%; margin: 0 auto; transform: translate(-50%, -50%); - z-index: 10000000; + z-index: 5000; h3 { margin-top: 0; @@ -339,7 +339,7 @@ select { padding: 0.2rem !important; color: var(--color-search-font); font-size: 0.9rem; - z-index: 2; + z-index: 100; &:hover, &:focus { @@ -413,7 +413,7 @@ input.checkbox-onoff[type="checkbox"] { border: 1px solid var(--color-btn-background); border-radius: 12px; box-shadow: var(--color-btn-background) 0 0 3px; - z-index: 10000; + z-index: 1200; top: -0.55em; left: -0.6em; } @@ -573,7 +573,7 @@ input.checkbox-onoff.reversed-checkbox[type="checkbox"] { background: var(--color-toolkit-engine-tooltip-background); font-size: 14px; font-weight: normal; - z-index: 1000000; + z-index: 5000; text-align: left; .rounded-corners; } diff --git a/searx/translations/ar/LC_MESSAGES/messages.mo b/searx/translations/ar/LC_MESSAGES/messages.mo index ae5b49135..5efc106c5 100644 Binary files a/searx/translations/ar/LC_MESSAGES/messages.mo and b/searx/translations/ar/LC_MESSAGES/messages.mo differ diff --git a/searx/translations/ar/LC_MESSAGES/messages.po b/searx/translations/ar/LC_MESSAGES/messages.po index c3d5d069d..bbad62153 100644 --- a/searx/translations/ar/LC_MESSAGES/messages.po +++ b/searx/translations/ar/LC_MESSAGES/messages.po @@ -25,20 +25,20 @@ # Yahya-Lando , 2025. msgid "" msgstr "" -"Project-Id-Version: searx\n" +"Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2025-01-06 16:16+0000\n" -"PO-Revision-Date: 2025-01-06 15:52+0000\n" -"Last-Translator: Yahya-Lando \n" +"PO-Revision-Date: 2025-01-15 06:48+0000\n" +"Last-Translator: return42 \n" +"Language-Team: Arabic \n" "Language: ar\n" -"Language-Team: Arabic " -"\n" -"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : " -"n%100>=3 && n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " +"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n" +"X-Generator: Weblate 5.9.2\n" "Generated-By: Babel 2.16.0\n" #. CONSTANT_NAMES['NO_SUBGROUPING'] @@ -1380,23 +1380,23 @@ msgstr "تغيير لغة واجهة البحث" #: searx/templates/simple/preferences/urlformatting.html:2 msgid "URL formatting" -msgstr "" +msgstr "تنسيق العنوان" #: searx/templates/simple/preferences/urlformatting.html:8 msgid "Pretty" -msgstr "" +msgstr "جميل" #: searx/templates/simple/preferences/urlformatting.html:13 msgid "Full" -msgstr "" +msgstr "ممتلىء" #: searx/templates/simple/preferences/urlformatting.html:18 msgid "Host" -msgstr "" +msgstr "مضيف" #: searx/templates/simple/preferences/urlformatting.html:23 msgid "Change result URL formatting" -msgstr "" +msgstr "تغيير تنسيق العنوان للنتيجة" #: searx/templates/simple/result_templates/code.html:13 msgid "repo" @@ -2004,4 +2004,3 @@ msgstr "إخفاء الفيديو" #~ msgid "dummy" #~ msgstr "" - diff --git a/searx/translations/ja/LC_MESSAGES/messages.mo b/searx/translations/ja/LC_MESSAGES/messages.mo index b591fd599..ec462c3c2 100644 Binary files a/searx/translations/ja/LC_MESSAGES/messages.mo and b/searx/translations/ja/LC_MESSAGES/messages.mo differ diff --git a/searx/translations/ja/LC_MESSAGES/messages.po b/searx/translations/ja/LC_MESSAGES/messages.po index 5acf90f39..13b5eab4c 100644 --- a/searx/translations/ja/LC_MESSAGES/messages.po +++ b/searx/translations/ja/LC_MESSAGES/messages.po @@ -27,19 +27,19 @@ # syobon , 2025. msgid "" msgstr "" -"Project-Id-Version: searx\n" +"Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2025-01-06 16:16+0000\n" -"PO-Revision-Date: 2025-01-06 15:53+0000\n" -"Last-Translator: return42 " -"\n" +"PO-Revision-Date: 2025-01-17 07:09+0000\n" +"Last-Translator: tentsbet \n" +"Language-Team: Japanese \n" "Language: ja\n" -"Language-Team: Japanese " -"\n" -"Plural-Forms: nplurals=1; plural=0;\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.9.2\n" "Generated-By: Babel 2.16.0\n" #. CONSTANT_NAMES['NO_SUBGROUPING'] @@ -1348,23 +1348,23 @@ msgstr "表示する言語を変更" #: searx/templates/simple/preferences/urlformatting.html:2 msgid "URL formatting" -msgstr "" +msgstr "URL 書式" #: searx/templates/simple/preferences/urlformatting.html:8 msgid "Pretty" -msgstr "" +msgstr "相当" #: searx/templates/simple/preferences/urlformatting.html:13 msgid "Full" -msgstr "" +msgstr "一杯" #: searx/templates/simple/preferences/urlformatting.html:18 msgid "Host" -msgstr "" +msgstr "ホスト" #: searx/templates/simple/preferences/urlformatting.html:23 msgid "Change result URL formatting" -msgstr "" +msgstr "検索結果のURL書式を変更" #: searx/templates/simple/result_templates/code.html:13 msgid "repo" @@ -1947,4 +1947,3 @@ msgstr "動画を隠す" #~ msgid "dummy" #~ msgstr "" - diff --git a/searx/translations/lt/LC_MESSAGES/messages.mo b/searx/translations/lt/LC_MESSAGES/messages.mo index d7add1279..3774e14e2 100644 Binary files a/searx/translations/lt/LC_MESSAGES/messages.mo and b/searx/translations/lt/LC_MESSAGES/messages.mo differ diff --git a/searx/translations/lt/LC_MESSAGES/messages.po b/searx/translations/lt/LC_MESSAGES/messages.po index 5bb1b3807..ed1be1ce7 100644 --- a/searx/translations/lt/LC_MESSAGES/messages.po +++ b/searx/translations/lt/LC_MESSAGES/messages.po @@ -14,20 +14,21 @@ # Mooo , 2025. msgid "" msgstr "" -"Project-Id-Version: searx\n" +"Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2025-01-06 16:16+0000\n" -"PO-Revision-Date: 2025-01-06 15:53+0000\n" -"Last-Translator: Mooo \n" +"PO-Revision-Date: 2025-01-15 06:48+0000\n" +"Last-Translator: return42 \n" +"Language-Team: Lithuanian \n" "Language: lt\n" -"Language-Team: Lithuanian " -"\n" -"Plural-Forms: nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100" -" < 11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < " -"11) ? 1 : n % 1 != 0 ? 2: 3);\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100 < " +"11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 1 :" +" n % 1 != 0 ? 2: 3);\n" +"X-Generator: Weblate 5.9.2\n" "Generated-By: Babel 2.16.0\n" #. CONSTANT_NAMES['NO_SUBGROUPING'] @@ -168,7 +169,7 @@ msgstr "tamsi" #. STYLE_NAMES['BLACK'] #: searx/searxng.msg msgid "black" -msgstr "" +msgstr "juoda" #. BRAND_CUSTOM_LINKS['UPTIME'] #: searx/searxng.msg @@ -1981,4 +1982,3 @@ msgstr "slėpti vaizdo įrašą" #~ msgid "dummy" #~ msgstr "" - diff --git a/searx/translations/si/LC_MESSAGES/messages.mo b/searx/translations/si/LC_MESSAGES/messages.mo index f79f2e4fd..99504239b 100644 Binary files a/searx/translations/si/LC_MESSAGES/messages.mo and b/searx/translations/si/LC_MESSAGES/messages.mo differ diff --git a/searx/translations/si/LC_MESSAGES/messages.po b/searx/translations/si/LC_MESSAGES/messages.po index a3d4afcfd..7c3429d49 100644 --- a/searx/translations/si/LC_MESSAGES/messages.po +++ b/searx/translations/si/LC_MESSAGES/messages.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2025-01-06 16:16+0000\n" -"PO-Revision-Date: 2025-01-10 07:09+0000\n" +"PO-Revision-Date: 2025-01-15 06:48+0000\n" "Last-Translator: hirushaadi " "\n" "Language-Team: Sinhala /dev/null ( set -e - # build the themes + # fix & build the themes + themes.fix themes.all # add build files diff --git a/utils/lib_sxng_test.sh b/utils/lib_sxng_test.sh index 9ac71aeeb..895a338fa 100755 --- a/utils/lib_sxng_test.sh +++ b/utils/lib_sxng_test.sh @@ -89,7 +89,6 @@ test.robot() { dump_return $? } - test.rst() { build_msg TEST "[reST markup] ${RST_FILES[*]}" @@ -98,6 +97,12 @@ test.rst() { done } +test.themes() { + build_msg TEST 'SearXNG themes' + themes.test + dump_return $? +} + test.pybabel() { TEST_BABEL_FOLDER="build/test/pybabel" build_msg TEST "[extract messages] pybabel" diff --git a/utils/lib_sxng_themes.sh b/utils/lib_sxng_themes.sh index a276dd8c5..95d38ae8d 100755 --- a/utils/lib_sxng_themes.sh +++ b/utils/lib_sxng_themes.sh @@ -7,21 +7,41 @@ declare _creset themes.help(){ cat <&1 \ - | prefix_stdout "${_Blue}THEME ${1} ${_creset} " \ - | grep -E --ignore-case --color 'error[s]?[:]? |warning[s]?[:]? |' + } # 2>&1 \ + # | prefix_stdout "${_Blue}THEME ${1} ${_creset} " \ + # | grep -E --ignore-case --color 'error[s]?[:]? |warning[s]?[:]? |' } themes.simple() { ( set -e - node.env themes.simple.pygments + build_msg SIMPLE "theme: run build" + # "run build" includes tests from eslint and stylelint + npm --prefix searx/static/themes/simple run build ) - build_msg GRUNT "theme: simple" - npm --prefix searx/static/themes/simple run build dump_return $? } @@ -67,11 +87,14 @@ themes.simple.pygments() { return 0 } +themes.simple.fix() { + build_msg SIMPLE "theme: fix" + npm --prefix searx/static/themes/simple run fix + dump_return $? +} themes.simple.test() { - build_msg TEST "theme: simple" - node.env - npm --prefix searx/static/themes/simple install + build_msg SIMPLE "theme: run test" npm --prefix searx/static/themes/simple run test dump_return $? }