calc fixes and update readme
This commit is contained in:
parent
90b962e3b0
commit
c7633f68c1
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1,3 @@
|
|||||||
/target
|
/target
|
||||||
|
|
||||||
|
/deploy.sh
|
||||||
|
12
README
12
README
@ -1 +1,13 @@
|
|||||||
a cute metasearch engine
|
a cute metasearch engine
|
||||||
|
|
||||||
|
it sources from google, bing, brave, and a few others.
|
||||||
|
|
||||||
|
it's written in rust using no templating engine and with as little client-side
|
||||||
|
javascript as possible.
|
||||||
|
|
||||||
|
metasearch is a single binary with no cli or configuration file. if you want to
|
||||||
|
configure it (like to change the default port or weights of engines) then you
|
||||||
|
have to modify the source.
|
||||||
|
|
||||||
|
build it with `cargo b -r`, the resulting binary will be in `target/release/metasearch2`.
|
||||||
|
it runs on port 28019.
|
||||||
|
@ -57,7 +57,10 @@ fn evaluate(query: &str, html: bool) -> Option<String> {
|
|||||||
let mut result_html = String::new();
|
let mut result_html = String::new();
|
||||||
for span in result.get_main_result_spans() {
|
for span in result.get_main_result_spans() {
|
||||||
let class = match span.kind() {
|
let class = match span.kind() {
|
||||||
fend_core::SpanKind::Number | fend_core::SpanKind::Boolean => "answer-calc-constant",
|
fend_core::SpanKind::Number
|
||||||
|
| fend_core::SpanKind::Boolean
|
||||||
|
| fend_core::SpanKind::Date => "answer-calc-constant",
|
||||||
|
fend_core::SpanKind::String => "answer-calc-string",
|
||||||
_ => "",
|
_ => "",
|
||||||
};
|
};
|
||||||
if !class.is_empty() {
|
if !class.is_empty() {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
// add a datalist after the search input
|
|
||||||
const searchInputEl = document.getElementById("search-input");
|
const searchInputEl = document.getElementById("search-input");
|
||||||
|
|
||||||
|
// add a datalist after the search input
|
||||||
const datalistEl = document.createElement("datalist");
|
const datalistEl = document.createElement("datalist");
|
||||||
datalistEl.id = "search-input-datalist";
|
datalistEl.id = "search-input-datalist";
|
||||||
searchInputEl.setAttribute("list", datalistEl.id);
|
searchInputEl.setAttribute("list", datalistEl.id);
|
||||||
|
@ -137,3 +137,9 @@ h1 {
|
|||||||
color: #d2a6ff;
|
color: #d2a6ff;
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
}
|
}
|
||||||
|
.answer-calc-string {
|
||||||
|
color: #aad94c;
|
||||||
|
}
|
||||||
|
.answer-calc-special {
|
||||||
|
color: #e6b673;
|
||||||
|
}
|
||||||
|
@ -5,7 +5,7 @@ use std::net::SocketAddr;
|
|||||||
|
|
||||||
use axum::{http::header, routing::get, Router};
|
use axum::{http::header, routing::get, Router};
|
||||||
|
|
||||||
pub const BIND_ADDRESS: &str = "[::]:3000";
|
pub const BIND_ADDRESS: &str = "[::]:28019";
|
||||||
|
|
||||||
pub async fn run() {
|
pub async fn run() {
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
|
Loading…
Reference in New Issue
Block a user