[mod] typification of SearXNG: add new result type KeyValue

This patch adds a new result type: KeyValue

- Python class:   searx/result_types/keyvalue.py
- Jinja template: searx/templates/simple/result_templates/keyvalue.html
- CSS (less)      client/simple/src/less/result_types/keyvalue.less

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2025-03-05 17:46:23 +01:00 committed by Markus Heiser
parent 8769b7c6d6
commit af5dbdf768
8 changed files with 127 additions and 1 deletions

View file

@ -57,6 +57,10 @@
/// Answer Colors
--color-answer-font: #444; // same as --color-base-font
--color-answer-background: #fff;
// colors of the KeyValue result class
--color-result-keyvalue-col-table: #fdfbff;
--color-result-keyvalue-odd: #fdfbff;
--color-result-keyvalue-even: #fff;
/// Results Colors
--color-result-background: #fff;
--color-result-border: #ddd;
@ -180,6 +184,10 @@
/// Answer Colors
--color-answer-font: #bbb; // same as --color-base-font
--color-answer-background: #26292f;
// colors of the KeyValue result class
--color-result-keyvalue-col-table: #1e1e22;
--color-result-keyvalue-odd: #1e1e22;
--color-result-keyvalue-even: #26292f;
/// Results Colors
--color-result-background: #26292f;
--color-result-border: #333;

View file

@ -0,0 +1,35 @@
/*
Layout of the KeyValue result class
*/
#main_results .result-keyvalue {
caption {
padding: 0.8rem 0.5rem;
font-style: italic;
caption-side: bottom;
background-color: var(--color-result-keyvalue-table);
}
.col-key {
width: 25%;
}
table {
word-break: break-word;
table-layout: fixed;
width: 100%;
background-color: var(--color-result-keyvalue-table);
}
tr.odd {
background-color: var(--color-result-keyvalue-odd);
}
tr.even {
background-color: var(--color-result-keyvalue-even);
}
th,
td {
padding: 0.3rem 0.5rem;
}
}

View file

@ -1164,3 +1164,6 @@ summary.title {
pre code {
white-space: pre-wrap;
}
// import layouts of the Result types
@import "result_types/keyvalue.less";