From fb112dca9c785a71eaf033732b87519a6575b3a8 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 25 Nov 2022 20:51:34 -0500 Subject: spine-search-cgi separate commits, remove sundry --- org/cgi_spine_search.org | 2243 - org/config_d_cfte.org | 31 - org/config_dub.org | 95 - org/config_git.org | 58 - org/config_make.org | 83 - org/config_nix.org | 361 - sundry/editor-syntax-etc/emacs/README | 4 - .../emacs/sisu-spine-mode-autoloads.el | 10 - sundry/editor-syntax-etc/emacs/sisu-spine-mode.el | 493 - sundry/editor-syntax-etc/vim/colors/def-sisu.vim | 223 - sundry/editor-syntax-etc/vim/colors/def.vim | 223 - .../vim/colors/frugal-cterm-sisu.vim | 66 - sundry/editor-syntax-etc/vim/colors/slate.vim | 75 - sundry/editor-syntax-etc/vim/filetype.vim | 8 - sundry/editor-syntax-etc/vim/ftplugin/sisu.vim | 224 - sundry/editor-syntax-etc/vim/templates/ssi.tpl | 30 - sundry/editor-syntax-etc/vim/templates/ssm.tpl | 30 - sundry/editor-syntax-etc/vim/templates/sst.tpl | 30 - sundry/editor-syntax-etc/vim/vim-sisu.yaml | 7 - sundry/misc/editor-syntax-etc/README | 90 - sundry/misc/editor-syntax-etc/emacs/README | 4 - .../emacs/sisu-spine-mode-autoloads.el | 10 - .../editor-syntax-etc/emacs/sisu-spine-mode.el | 493 - sundry/misc/editor-syntax-etc/gedit/sisu.lang | 128 - sundry/misc/editor-syntax-etc/kate/sisu.xml | 178 - sundry/misc/editor-syntax-etc/nano/nanorc | 221 - .../misc/editor-syntax-etc/nedit/sisu_nedit.pats | 79 - sundry/misc/editor-syntax-etc/vim/colors/8.vim | 65 - .../misc/editor-syntax-etc/vim/colors/def-ruby.vim | 223 - .../misc/editor-syntax-etc/vim/colors/def-sisu.vim | 223 - sundry/misc/editor-syntax-etc/vim/colors/def.vim | 223 - .../editor-syntax-etc/vim/colors/def256-ruby.vim | 195 - .../editor-syntax-etc/vim/colors/def256-sisu.vim | 195 - .../misc/editor-syntax-etc/vim/colors/def256.vim | 195 - .../vim/colors/frugal-cterm-ruby.vim | 66 - .../vim/colors/frugal-cterm-sisu.vim | 66 - .../editor-syntax-etc/vim/colors/frugal-cterm.vim | 69 - .../misc/editor-syntax-etc/vim/colors/frugal.vim | 66 - sundry/misc/editor-syntax-etc/vim/colors/slate.vim | 75 - .../vim/colors/sparse-cterm-ruby.vim | 66 - .../vim/colors/sparse-cterm-sisu.vim | 66 - sundry/misc/editor-syntax-etc/vim/filetype.vim | 8 - .../misc/editor-syntax-etc/vim/ftplugin/sisu.vim | 224 - .../misc/editor-syntax-etc/vim/ftplugin/sisurb.vim | 7 - .../misc/editor-syntax-etc/vim/rc/vimrc_statusline | 110 - sundry/misc/editor-syntax-etc/vim/syntax/sisu.vim | 277 - .../misc/editor-syntax-etc/vim/templates/ssi.tpl | 30 - .../misc/editor-syntax-etc/vim/templates/ssm.tpl | 30 - .../misc/editor-syntax-etc/vim/templates/sst.tpl | 30 - sundry/misc/editor-syntax-etc/vim/vim-sisu.yaml | 7 - sundry/misc/ext_lib/src/arsd/README | 2 - sundry/misc/ext_lib/src/arsd/cgi.d | 10315 - sundry/misc/util/d/cgi/search/README | 11 - sundry/misc/util/d/cgi/search/dub.sdl | 16 - sundry/misc/util/d/tools/markup_conversion/README | 1 - .../endnotes_inline_from_binary.d | 123 - .../d/tools/markup_conversion/markup_changes.d | 136 - .../markup_changes_header_and_content.d | 244 - ...arkup_conversion_from_sisu_ruby_to_sisu_spine.d | 367 - sundry/misc/util/d/tools/spine_scaffold.d | 134 - sundry/misc/util/rb/cgi/spine.search.cgi | 952 - sundry/misc/util/rb/tex/dr_tex.rb | 122 - sundry/spine_search_cgi/.envrc | 8 - sundry/spine_search_cgi/.envrc-local_ | 21 - sundry/spine_search_cgi/.gitignore | 51 - sundry/spine_search_cgi/default.nix | 3 - sundry/spine_search_cgi/derivation.nix | 120 - sundry/spine_search_cgi/dub.json | 87 - sundry/spine_search_cgi/dub_describe.json | 435 - sundry/spine_search_cgi/flake.lock | 42 - sundry/spine_search_cgi/flake.nix | 22 - sundry/spine_search_cgi/makefile | 52 - sundry/spine_search_cgi/shell.nix | 40 - .../src/ext_depends_cgi/arsd/cgi.d | 11181 - .../src/ext_depends_cgi/d2sqlite3.meta | 3 - .../d2sqlite3/.github/workflows/documentation.yaml | 58 - .../d2sqlite3/.github/workflows/main.yaml | 72 - .../src/ext_depends_cgi/d2sqlite3/.gitignore | 10 - .../src/ext_depends_cgi/d2sqlite3/LICENSE | 23 - .../src/ext_depends_cgi/d2sqlite3/README.md | 46 - .../src/ext_depends_cgi/d2sqlite3/c/sqlite3.c | 219200 ------------------ .../src/ext_depends_cgi/d2sqlite3/c/sqlite3.h | 11573 - .../src/ext_depends_cgi/d2sqlite3/dub.sdl | 35 - .../src/ext_depends_cgi/d2sqlite3/lib/Makefile | 16 - .../d2sqlite3/lib/win32/sqlite3.def | 261 - .../d2sqlite3/lib/win32/sqlite3.dll | Bin 910716 -> 0 bytes .../d2sqlite3/lib/win64/sqlite3.def | 265 - .../d2sqlite3/lib/win64/sqlite3.dll | Bin 1869312 -> 0 bytes .../src/ext_depends_cgi/d2sqlite3/run-dstep.sh | 4 - .../d2sqlite3/source/d2sqlite3/database.d | 1353 - .../d2sqlite3/source/d2sqlite3/internal/memory.d | 82 - .../d2sqlite3/source/d2sqlite3/internal/util.d | 211 - .../d2sqlite3/source/d2sqlite3/library.d | 107 - .../d2sqlite3/source/d2sqlite3/package.d | 111 - .../d2sqlite3/source/d2sqlite3/results.d | 874 - .../d2sqlite3/source/d2sqlite3/sqlite3.d | 11437 - .../d2sqlite3/source/d2sqlite3/statement.d | 439 - .../src/ext_depends_cgi/d2sqlite3/source/tests.d | 931 - .../src/ext_depends_cgi/d2sqlite3/sqlite3.mak | 8 - sundry/spine_search_cgi/src/spine_search.d | 1916 - sundry/spine_search_cgi/src/spine_search.d_ | 1918 - sundry/spine_search_cgi/views/configuration.txt | 10 - .../views/configuration_example.txt | 11 - sundry/util/d/tools/markup_conversion/README | 1 - .../endnotes_inline_from_binary.d | 123 - .../markup_changes_header_and_content.d | 244 - ...arkup_conversion_from_sisu_ruby_to_sisu_spine.d | 367 - sundry/util/rb/cgi/spine.search.cgi | 952 - 108 files changed, 285159 deletions(-) delete mode 100644 org/cgi_spine_search.org delete mode 100644 sundry/editor-syntax-etc/emacs/README delete mode 100644 sundry/editor-syntax-etc/emacs/sisu-spine-mode-autoloads.el delete mode 100644 sundry/editor-syntax-etc/emacs/sisu-spine-mode.el delete mode 100644 sundry/editor-syntax-etc/vim/colors/def-sisu.vim delete mode 100644 sundry/editor-syntax-etc/vim/colors/def.vim delete mode 100644 sundry/editor-syntax-etc/vim/colors/frugal-cterm-sisu.vim delete mode 100644 sundry/editor-syntax-etc/vim/colors/slate.vim delete mode 100644 sundry/editor-syntax-etc/vim/filetype.vim delete mode 100644 sundry/editor-syntax-etc/vim/ftplugin/sisu.vim delete mode 100644 sundry/editor-syntax-etc/vim/templates/ssi.tpl delete mode 100644 sundry/editor-syntax-etc/vim/templates/ssm.tpl delete mode 100644 sundry/editor-syntax-etc/vim/templates/sst.tpl delete mode 100644 sundry/editor-syntax-etc/vim/vim-sisu.yaml delete mode 100644 sundry/misc/editor-syntax-etc/README delete mode 100644 sundry/misc/editor-syntax-etc/emacs/README delete mode 100644 sundry/misc/editor-syntax-etc/emacs/sisu-spine-mode-autoloads.el delete mode 100644 sundry/misc/editor-syntax-etc/emacs/sisu-spine-mode.el delete mode 100644 sundry/misc/editor-syntax-etc/gedit/sisu.lang delete mode 100644 sundry/misc/editor-syntax-etc/kate/sisu.xml delete mode 100644 sundry/misc/editor-syntax-etc/nano/nanorc delete mode 100644 sundry/misc/editor-syntax-etc/nedit/sisu_nedit.pats delete mode 100644 sundry/misc/editor-syntax-etc/vim/colors/8.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/colors/def-ruby.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/colors/def-sisu.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/colors/def.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/colors/def256-ruby.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/colors/def256-sisu.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/colors/def256.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/colors/frugal-cterm-ruby.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/colors/frugal-cterm-sisu.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/colors/frugal-cterm.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/colors/frugal.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/colors/slate.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/colors/sparse-cterm-ruby.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/colors/sparse-cterm-sisu.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/filetype.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/ftplugin/sisu.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/ftplugin/sisurb.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/rc/vimrc_statusline delete mode 100644 sundry/misc/editor-syntax-etc/vim/syntax/sisu.vim delete mode 100644 sundry/misc/editor-syntax-etc/vim/templates/ssi.tpl delete mode 100644 sundry/misc/editor-syntax-etc/vim/templates/ssm.tpl delete mode 100644 sundry/misc/editor-syntax-etc/vim/templates/sst.tpl delete mode 100644 sundry/misc/editor-syntax-etc/vim/vim-sisu.yaml delete mode 100644 sundry/misc/ext_lib/src/arsd/README delete mode 100644 sundry/misc/ext_lib/src/arsd/cgi.d delete mode 100644 sundry/misc/util/d/cgi/search/README delete mode 100644 sundry/misc/util/d/cgi/search/dub.sdl delete mode 100644 sundry/misc/util/d/tools/markup_conversion/README delete mode 100755 sundry/misc/util/d/tools/markup_conversion/endnotes_inline_from_binary.d delete mode 100644 sundry/misc/util/d/tools/markup_conversion/markup_changes.d delete mode 100755 sundry/misc/util/d/tools/markup_conversion/markup_changes_header_and_content.d delete mode 100755 sundry/misc/util/d/tools/markup_conversion/markup_conversion_from_sisu_ruby_to_sisu_spine.d delete mode 100755 sundry/misc/util/d/tools/spine_scaffold.d delete mode 100755 sundry/misc/util/rb/cgi/spine.search.cgi delete mode 100755 sundry/misc/util/rb/tex/dr_tex.rb delete mode 100644 sundry/spine_search_cgi/.envrc delete mode 100644 sundry/spine_search_cgi/.envrc-local_ delete mode 100644 sundry/spine_search_cgi/.gitignore delete mode 100755 sundry/spine_search_cgi/default.nix delete mode 100644 sundry/spine_search_cgi/derivation.nix delete mode 100644 sundry/spine_search_cgi/dub.json delete mode 100644 sundry/spine_search_cgi/dub_describe.json delete mode 100644 sundry/spine_search_cgi/flake.lock delete mode 100644 sundry/spine_search_cgi/flake.nix delete mode 100644 sundry/spine_search_cgi/makefile delete mode 100755 sundry/spine_search_cgi/shell.nix delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/arsd/cgi.d delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3.meta delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/.github/workflows/documentation.yaml delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/.github/workflows/main.yaml delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/.gitignore delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/LICENSE delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/README.md delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/c/sqlite3.c delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/c/sqlite3.h delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/dub.sdl delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/lib/Makefile delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/lib/win32/sqlite3.def delete mode 100755 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/lib/win32/sqlite3.dll delete mode 100755 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/lib/win64/sqlite3.def delete mode 100755 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/lib/win64/sqlite3.dll delete mode 100755 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/run-dstep.sh delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/source/d2sqlite3/database.d delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/source/d2sqlite3/internal/memory.d delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/source/d2sqlite3/internal/util.d delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/source/d2sqlite3/library.d delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/source/d2sqlite3/package.d delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/source/d2sqlite3/results.d delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/source/d2sqlite3/sqlite3.d delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/source/d2sqlite3/statement.d delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/source/tests.d delete mode 100644 sundry/spine_search_cgi/src/ext_depends_cgi/d2sqlite3/sqlite3.mak delete mode 100644 sundry/spine_search_cgi/src/spine_search.d delete mode 100755 sundry/spine_search_cgi/src/spine_search.d_ delete mode 100644 sundry/spine_search_cgi/views/configuration.txt delete mode 100644 sundry/spine_search_cgi/views/configuration_example.txt delete mode 100644 sundry/util/d/tools/markup_conversion/README delete mode 100755 sundry/util/d/tools/markup_conversion/endnotes_inline_from_binary.d delete mode 100755 sundry/util/d/tools/markup_conversion/markup_changes_header_and_content.d delete mode 100755 sundry/util/d/tools/markup_conversion/markup_conversion_from_sisu_ruby_to_sisu_spine.d delete mode 100755 sundry/util/rb/cgi/spine.search.cgi diff --git a/org/cgi_spine_search.org b/org/cgi_spine_search.org deleted file mode 100644 index d71445c..0000000 --- a/org/cgi_spine_search.org +++ /dev/null @@ -1,2243 +0,0 @@ --*- mode: org -*- -#+TITLE: spine search cgi (doc_reform) hub -#+DESCRIPTION: documents - structuring, various output representations & search -#+FILETAGS: :spine:hub: -#+AUTHOR: Ralph Amissah -#+EMAIL: [[mailto:ralph.amissah@gmail.com][ralph.amissah@gmail.com]] -#+COPYRIGHT: Copyright (C) 2015 - 2022 Ralph Amissah -#+LANGUAGE: en -#+STARTUP: content hideblocks hidestars noindent entitiespretty -#+PROPERTY: header-args :exports code -#+PROPERTY: header-args+ :noweb yes -#+PROPERTY: header-args+ :results no -#+PROPERTY: header-args+ :cache no -#+PROPERTY: header-args+ :padline no -#+PROPERTY: header-args+ :mkdirp yes -#+OPTIONS: H:3 num:nil toc:t \n:t ::t |:t ^:nil -:t f:t *:t - -- [[./doc-reform.org][doc-reform.org]] [[./][org/]] -- [[./spine_build_scaffold.org][make/build]] VERSION - -#+NAME: year -#+BEGIN_SRC text -2022 -#+END_SRC - -* 0. version.txt configuration.txt (set version & configuration) - -** program version struct - -#+NAME: spine_version_struct -#+BEGIN_SRC d -/+ obt - org-mode generated file +/ -struct Version { - int major; - int minor; - int patch; -} -#+END_SRC - -** set program version VERSION :version:set:project: - -#+NAME: spine_version_set -#+BEGIN_SRC d -enum _ver = Version(0, 12, 0); -#+END_SRC - -** compilation restrictions (supported compilers) -- set compilation restrictions - -https://dlang.org/spec/version.html#predefined-versions - -#+NAME: spine_compiler_restrictions -#+BEGIN_SRC d -version (Posix) { - version (DigitalMars) { - } else version (LDC) { - } else version (GNU) { - } else { - static assert (0, "Unsupported D compiler"); - } -} else { - static assert (0, "Unsupported D compiler"); -} -#+END_SRC - -* 1. spine search cgi :spine_search: -** notes -- provide - -** spine_search src/spine_search.d :template: - -#+HEADER: :tangle "../sundry/spine_search_cgi/src/spine_search.d_" -#+HEADER: :shebang "#!/usr/bin/env rdmd" -#+HEADER: :noweb yes -#+BEGIN_SRC d -<> -/+ dub.sdl - name "spine search" - description "spine cgi search" - /+ obt - org-mode generated file +/ -+/ -<> -void cgi_function_intro(Cgi cgi) { - mixin(import("configuration.txt")); - <> - <> - <> - <> - cv.db_selected = _cfg.db_sqlite_filename; - auto text_fields() { - string canned_query_str = environment.get("QUERY_STRING", ""); - if ("query_string" in cgi.post) { - canned_query_str = environment.get("QUERY_STRING", ""); - } - string[string] canned_query; - if (conf.request_method == "POST") { - } else if (conf.request_method == "GET") { - foreach (pair_str; canned_query_str.split("&")) { - // cgi.write(pair_str ~ "
"); - string[] pair = pair_str.split("="); - canned_query[pair[0]] = pair[1]; - } - // foreach (field, content; canned_query) { - // cgi.write(field ~ ": " ~ content ~ "
"); - // } - } - <> - <> - <> - return got; - } - auto tf = text_fields; // - struct SQL_select { - string the_body = ""; - string the_range = ""; - } - auto sql_select = SQL_select(); - string canned_url () { - string _url = ""; - if (environment.get("REQUEST_METHOD", "POST") == "POST") { - _url = conf.query_base_url ~ tf.canned_query; - } else if (environment.get("REQUEST_METHOD", "POST") == "GET") { - _url = conf.query_base_url ~ environment.get("QUERY_STRING", ""); - } - return _url; - } - auto regex_canned_search () { - static struct RgxCS { - static track_offset = ctRegex!(`(?P[&]smo=)(?P[0-9]+)`); - static results_type = ctRegex!(`[&]rt=(?Pidx|txt)`); - static results_type_index = ctRegex!(`[&]rt=idx`); - static results_type_text = ctRegex!(`[&]rt=txt`); - static fn = ctRegex!(`[&]fn=(?P[^&]+)`); - } - return RgxCS(); - } - string show_matched_objects (string fn) { - <> - } - <> - string previous_next () { - <> - } - { -<> - } - { - <> - } - { - string post_value(string field_name, string type="box", string set="on") { - <> - } - string the_can(string fv) { - <> - } - string provide_tip() { - <> - } -<> - { - string set_value(string field_name, string default_val) { - <> - } - bool set_bool(string field_name) { - <> - } - <> - } - } - { - cgi.write(header); - cgi.write(table); - cgi.write(form); - // cgi.write(previous_next); - { // debug environment - // foreach (k, d; environment.toAA) { - // cgi.write(k ~ ": " ~ d ~ "
"); - // } - } - { // debug cgi info: - // <> - } - } - auto db = Database(conf.db_path ~ "/" ~ cv.db_selected); - { - uint sql_match_offset_counter(T)(T cv) { - sql_match_offset_count += cv.sql_match_limit.to!uint; - return sql_match_offset_count; - } - void sql_search_query() { - string highlight_text_matched(string _txt, string search_field) { - <> - } - string select_field_like(string db_field, string search_field) { - <> - } - <> -<> - <> -<> - } - sql_search_query; - } - { - db.close; - } - { - string tail = format(q"┃ - -┃"); - cgi.write(tail); - } -} -mixin GenericMain!cgi_function_intro; -#+END_SRC - -** settings spine_search.d -*** spine search parts -**** imports - -#+NAME: spine_search_imports -#+BEGIN_SRC d -import std.format; -import std.range; -import std.regex; -import arsd.cgi; -import d2sqlite3; -import std.process : environment; -#+END_SRC - -**** inits - -#+NAME: spine_search_init_1 -#+BEGIN_SRC d -string header; -string table; -string form; -#+END_SRC - -#+NAME: spine_search_init_2 -#+BEGIN_SRC d -string base; // = ""; -string tip; // = ""; -string search_note; // = ""; -uint sql_match_offset_count = 0; -#+END_SRC - -**** config struct - -see: cfte_configuation.org - -***** init config struct - -#+NAME: spine_search_config_struct_init -#+BEGIN_SRC d -struct Config { - string http_request_type; - string http_host; - // string server_name; - string doc_collection_subroot; - string cgi_script_name; - string cgi_search_form_title; - string cgi_search_form_html_title; - string data_path_html; - string http_url; - string query_base_url; - string query_string; - string request_method; - string db_path; -} -#+END_SRC - -***** SET config struct - -#+NAME: spine_search_config_struct_set -#+BEGIN_SRC d -auto conf = Config(); -conf.http_request_type = environment.get("REQUEST_SCHEME", _cfg.http_request_type); -conf.http_host = environment.get("SERVER_NAME", _cfg.http_host); -// conf.http_host = environment.get("HTTP_HOST", _cfg.http_host); -conf.doc_collection_subroot = _cfg.www_url_doc_subroot; -conf.cgi_script_name = environment.get("SCRIPT_NAME", _cfg.cgi_filename); -conf.cgi_search_form_title = _cfg.cgi_search_form_title; // ≅ SiSU spine search form -conf.cgi_search_form_html_title = "" - ~ _cfg.cgi_search_form_title - ~ ""; -conf.query_base_url = conf.http_request_type ~ "://" ~ conf.http_host ~ conf.cgi_script_name ~ "?"; -conf.query_string = environment.get("QUERY_STRING", ""); -conf.http_url = environment.get("HTTP_REFERER", conf.query_base_url ~ conf.query_string); -conf.request_method = environment.get("REQUEST_METHOD", "POST"); -conf.db_path = _cfg.db_sqlite_path; -#+END_SRC - -**** cgi val - -#+NAME: spine_search_cgi_val -#+BEGIN_SRC d -struct CGI_val { - string db_selected = ""; - string sql_match_limit = ""; // radio: ( 1000 | 2500 ) - string sql_match_offset = ""; - string search_text = ""; - string results_type = ""; // index - bool checked_echo = false; - bool checked_stats = false; - bool checked_url = false; - bool checked_searched = false; - bool checked_tip = false; - bool checked_sql = false; -} -auto cv = CGI_val(); -#+END_SRC - -**** rgx - -#+NAME: spine_search_rgx -#+BEGIN_SRC d -static struct Rgx { - // static canned_query = ctRegex!(`\A(?P.+)\Z`, "m"); - static search_text_area = ctRegex!(`\A(?P.+)\Z`, "m"); - // static fulltext = ctRegex!(`\A(?P.+)\Z`, "m"); - static line = ctRegex!(`^(?P.+?)(?: ~|$)`, "m"); - static text = ctRegex!(`(?:^|\s~\s*)text:\s+(?P.+?)(?: ~|$)`, "m"); - static author = ctRegex!(`(?:^|\s~\s*)author:\s+(?P.+)$`, "m"); - static title = ctRegex!(`(?:^|\s~\s*)title:\s+(?P.+)$`, "m"); - static uid = ctRegex!(`(?:^|\s~\s*)uid:\s+(?P.+)$`, "m"); - static fn = ctRegex!(`(?:^|\s~\s*)fn:\s+(?P.+)$`, "m"); - static keywords = ctRegex!(`(?:^|\s~\s*)keywords:\s+(?P.+)$`, "m"); - static topic_register = ctRegex!(`(?:^|\s~\s*)topic_register:\s+(?P.+)$`, "m"); - static subject = ctRegex!(`(?:^|\s~\s*)subject:\s+(?P.+)$`, "m"); - static description = ctRegex!(`(?:^|\s~\s*)description:\s+(?P.+)$`, "m"); - static publisher = ctRegex!(`(?:^|\s~\s*)publisher:\s+(?P.+)$`, "m"); - static editor = ctRegex!(`(?:^|\s~\s*)editor:\s+(?P.+)$`, "m"); - static contributor = ctRegex!(`(?:^|\s~\s*)contributor:\s+(?P.+)$`, "m"); - static date = ctRegex!(`(?:^|\s~\s*)date:\s+(?P.+)$`, "m"); - static results_type = ctRegex!(`(?:^|\s~\s*)type:\s+(?P.+)$`, "m"); - static format = ctRegex!(`(?:^|\s~\s*)format:\s+(?P.+)$`, "m"); - static source = ctRegex!(`(?:^|\s~\s*)source:\s+(?P.+)$`, "m"); - static language = ctRegex!(`(?:^|\s~\s*)language:\s+(?P.+)$`, "m"); - static relation = ctRegex!(`(?:^|\s~\s*)relation:\s+(?P.+)$`, "m"); - static coverage = ctRegex!(`(?:^|\s~\s*)coverage:\s+(?P.+)$`, "m"); - static rights = ctRegex!(`(?:^|\s~\s*)rights:\s+(?P.+)$`, "m"); - static comment = ctRegex!(`(?:^|\s~\s*)comment:\s+(?P.+)$`, "m"); - // static abstract_ = ctRegex!(`(?:^|\s~\s*)abstract:\s+(?P.+)$`, "m"); - static src_filename_base = ctRegex!(`^src_filename_base:\s+(?P.+)$`, "m"); -} -auto rgx = Rgx(); -#+END_SRC - -**** search fields - -#+NAME: spine_search_searchfields -#+BEGIN_SRC d -struct searchFields { - string canned_query = ""; // GET canned_query == cq - string search_text_area = ""; // POST search_text_area == tsa - string text = ""; // text == txt - string author = ""; // author == au - string title = ""; // title == ti - string uid = ""; // uid == uid - string fn = ""; // fn == fn - string keywords = ""; // keywords == kw - string topic_register = ""; // topic_register == tr - string subject = ""; // subject == su - string description = ""; // description == de - string publisher = ""; // publisher == pb - string editor = ""; // editor == ed - string contributor = ""; // contributor == ct - string date = ""; // date == dt - string format = ""; // format == fmt - string source = ""; // source == src sfn - string language = ""; // language == lng - string relation = ""; // relation == rl - string coverage = ""; // coverage == cv - string rights = ""; // rights == rgt - string comment = ""; // comment == cmt - // string abstract = ""; - string src_filename_base = ""; // src_filename_base == bfn - string results_type = ""; // results_type == rt radio - string sql_match_limit = ""; // sql_match_limit == sml radio - string sql_match_offset = ""; // sql_match_offset == smo - string stats = ""; // stats == sts checked - string echo = ""; // echo == ec checked - string url = ""; // url == url checked - string searched = ""; // searched == se checked - string sql = ""; // sql == sql checked -} -auto got = searchFields(); -#+END_SRC - -**** post - -#+NAME: spine_search_post -#+BEGIN_SRC d -if (environment.get("REQUEST_METHOD", "POST") == "POST") { - if ("sf" in cgi.post) { - got.search_text_area = cgi.post["sf"]; - if (auto m = got.search_text_area.matchFirst(rgx.text)) { - got.text = m["matched"]; - got.canned_query ~= "sf=" ~ m["matched"]; - } else if (auto m = got.search_text_area.matchFirst(rgx.line)) { - if ( - !(m["matched"].matchFirst(rgx.author)) - && !(m["matched"].matchFirst(rgx.title)) - ) { - got.text = m["matched"]; - got.canned_query ~= "sf=" ~ m["matched"]; - } - } - if (auto m = got.search_text_area.matchFirst(rgx.author)) { - got.author = m["matched"]; - got.canned_query ~= "&au=" ~ m["matched"]; - } - if (auto m = got.search_text_area.matchFirst(rgx.title)) { - got.title = m["matched"]; - got.canned_query ~= "&ti=" ~ m["matched"]; - } - if (auto m = got.search_text_area.matchFirst(rgx.uid)) { - got.uid = m["matched"]; - got.canned_query ~= "&uid=" ~ m["matched"]; - } - if (auto m = got.search_text_area.matchFirst(rgx.fn)) { - got.fn = m["matched"]; - got.canned_query ~= "&fn=" ~ m["matched"]; - } else if ("fn" in cgi.post) { - got.search_text_area ~= "\nfn: " ~ cgi.post["fn"] ~ "\n"; - } - if (auto m = got.search_text_area.matchFirst(rgx.keywords)) { - got.keywords = m["matched"]; - got.canned_query ~= "&kw=" ~ m["matched"]; - } - if (auto m = got.search_text_area.matchFirst(rgx.topic_register)) { - got.topic_register = m["matched"]; - got.canned_query ~= "&tr=" ~ m["matched"]; - } - if (auto m = got.search_text_area.matchFirst(rgx.subject)) { - got.subject = m["matched"]; - got.canned_query ~= "&su=" ~ m["matched"]; - } - if (auto m = got.search_text_area.matchFirst(rgx.description)) { - got.description = m["matched"]; - got.canned_query ~= "&de=" ~ m["matched"]; - } - if (auto m = got.search_text_area.matchFirst(rgx.publisher)) { - got.publisher = m["matched"]; - got.canned_query ~= "&pb=" ~ m["matched"]; - } - if (auto m = got.search_text_area.matchFirst(rgx.editor)) { - got.editor = m["matched"]; - got.canned_query ~= "&ed=" ~ m["matched"]; - } - if (auto m = got.search_text_area.matchFirst(rgx.contributor)) { - got.contributor = m["matched"]; - got.canned_query ~= "&ct=" ~ m["matched"]; - } - if (auto m = got.search_text_area.matchFirst(rgx.date)) { - got.date = m["matched"]; - got.canned_query ~= "&dt=" ~ m["matched"]; - } - // if (auto m = got.search_text_area.matchFirst(rgx.results_type)) { - // got.results_type = m["matched"]; - // got.canned_query ~= "&rt=" ~ m["matched"]; - // } - if (auto m = got.search_text_area.matchFirst(rgx.format)) { - got.format = m["matched"]; - got.canned_query ~= "&fmt=" ~ m["matched"]; - } - if (auto m = got.search_text_area.matchFirst(rgx.source)) { - got.source = m["matched"]; - got.canned_query ~= "&src=" ~ m["matched"]; - } - if (auto m = got.search_text_area.matchFirst(rgx.language)) { - got.language = m["matched"]; - got.canned_query ~= "&lng=" ~ m["matched"]; - } - if (auto m = got.search_text_area.matchFirst(rgx.relation)) { - got.relation = m["matched"]; - got.canned_query ~= "&rl=" ~ m["matched"]; - } - if (auto m = got.search_text_area.matchFirst(rgx.coverage)) { - got.coverage = m["matched"]; - got.canned_query ~= "&cv=" ~ m["matched"]; - } - if (auto m = got.search_text_area.matchFirst(rgx.rights)) { - got.rights = m["matched"]; - got.canned_query ~= "&rgt=" ~ m["matched"]; - } - if (auto m = got.search_text_area.matchFirst(rgx.comment)) { - got.comment = m["matched"]; - got.canned_query ~= "&cmt=" ~ m["matched"]; - } - // if (auto m = search_text_area.matchFirst(rgx.abstract)) { - // got.abstract = m["matched"]; - // } - if (auto m = got.search_text_area.matchFirst(rgx.src_filename_base)) { - got.src_filename_base = m["matched"]; - got.canned_query ~= "&bfn=" ~ m["matched"]; - } - } - if ("fn" in cgi.post) { - got.fn = cgi.post["fn"]; - got.canned_query ~= "&fn=" ~ cgi.post["fn"]; - } - if ("rt" in cgi.post) { - got.results_type = cgi.post["rt"]; - got.canned_query ~= "&rt=" ~ cgi.post["rt"]; - } - if ("sts" in cgi.post) { - got.stats = cgi.post["sts"]; - got.canned_query ~= "&sts=" ~ cgi.post["sts"]; - } - if ("ec" in cgi.post) { - got.echo = cgi.post["ec"]; - got.canned_query ~= "&ec=" ~ cgi.post["ec"]; - } - if ("url" in cgi.post) { - got.url = cgi.post["url"]; - got.canned_query ~= "&url=" ~ cgi.post["url"]; - } - if ("se" in cgi.post) { - got.searched = cgi.post["se"]; - got.canned_query ~= "&se=" ~ cgi.post["se"]; - } - if ("sql" in cgi.post) { - got.sql = cgi.post["sql"]; - got.canned_query ~= "&sql=" ~ cgi.post["sql"]; - } - if ("sml" in cgi.post) { - got.sql_match_limit = cgi.post["sml"]; - got.canned_query ~= "&sml=" ~ cgi.post["sml"]; - } - if ("smo" in cgi.post) { - got.sql_match_offset = "0"; // cgi.post["smo"]; - got.canned_query ~= "&smo=0"; // ~ cgi.post["smo"]; - } - got.canned_query = got.canned_query.strip.split(" ").join("%20"); - conf.query_string = got.canned_query; - // cgi.write("f.canned_query: " ~ got.canned_query ~ "
"); -} else if (environment.get("REQUEST_METHOD", "POST") == "GET") { - got.canned_query = environment.get("QUERY_STRING", ""); - // cgi.write("f.canned_query: " ~ got.canned_query ~ "
"); - got.search_text_area = ""; - if ("sf" in canned_query && !(canned_query["sf"]).empty) { - got.text = canned_query["sf"].split("%20").join(" "); - got.search_text_area ~= "text: " ~ got.text ~ "\n"; - } - if ("au" in canned_query && !(canned_query["au"]).empty) { - got.author = canned_query["au"].split("%20").join(" "); - got.search_text_area ~= "author: " ~ got.author ~ "\n"; - } - if ("ti" in canned_query && !(canned_query["ti"]).empty) { - got.title = canned_query["ti"].split("%20").join(" "); - got.search_text_area ~= "title: " ~ got.title ~ "\n"; - } - if ("uid" in canned_query && !(canned_query["uid"]).empty) { - got.uid = canned_query["uid"].split("%20").join(" "); - got.search_text_area ~= "uid: " ~ got.uid ~ "\n"; - } - if ("fn" in canned_query && !(canned_query["fn"]).empty) { - got.fn = canned_query["fn"].split("%20").join(" "); - got.search_text_area ~= "fn: " ~ got.fn ~ "\n"; - } - if ("kw" in canned_query && !(canned_query["kw"]).empty) { - got.keywords = canned_query["kw"].split("%20").join(" "); - got.search_text_area ~= "keywords: " ~ got.keywords ~ "\n"; - } - if ("tr" in canned_query && !(canned_query["tr"]).empty) { - got.topic_register = canned_query["tr"].split("%20").join(" "); - got.search_text_area ~= "topic_register: " ~ got.topic_register ~ "\n"; - } - if ("su" in canned_query && !(canned_query["su"]).empty) { - got.subject = canned_query["su"].split("%20").join(" "); - got.search_text_area ~= "subject: " ~ got.subject ~ "\n"; - } - if ("de" in canned_query && !(canned_query["de"]).empty) { - got.description = canned_query["de"].split("%20").join(" "); - got.search_text_area ~= "description: " ~ got.description ~ "\n"; - } - if ("pb" in canned_query && !(canned_query["pb"]).empty) { - got.publisher = canned_query["pb"].split("%20").join(" "); - got.search_text_area ~= "publisher: " ~ got.publisher ~ "\n"; - } - if ("ed" in canned_query && !(canned_query["ed"]).empty) { - got.editor = canned_query["ed"].split("%20").join(" "); - got.search_text_area ~= "editor: " ~ got.editor ~ "\n"; - } - if ("ct" in canned_query && !(canned_query["ct"]).empty) { - got.contributor = canned_query["ct"].split("%20").join(" "); - got.search_text_area ~= "contributor: " ~ got.contributor ~ "\n"; - } - if ("dt" in canned_query && !(canned_query["dt"]).empty) { - got.date = canned_query["dt"].split("%20").join(" "); - got.search_text_area ~= "date: " ~ got.date ~ "\n"; - } - if ("rt" in canned_query && !(canned_query["rt"]).empty) { - got.results_type = canned_query["rt"].split("%20").join(" "); - // got.search_text_area ~= "results_type: " ~ got.results_type ~ "\n"; - } - if ("fmt" in canned_query && !(canned_query["fmt"]).empty) { - got.format = canned_query["fmt"].split("%20").join(" "); - got.search_text_area ~= "format: " ~ got.format ~ "\n"; - } - if ("src" in canned_query && !(canned_query["src"]).empty) { - got.source = canned_query["src"].split("%20").join(" "); - got.search_text_area ~= "source: " ~ got.source ~ "\n"; - } - if ("lng" in canned_query && !(canned_query["lng"]).empty) { - got.language = canned_query["lng"].split("%20").join(" "); - got.search_text_area ~= "language: " ~ got.language ~ "\n"; - } - if ("rl" in canned_query && !(canned_query["rl"]).empty) { - got.relation = canned_query["rl"].split("%20").join(" "); - got.search_text_area ~= "relation: " ~ got.relation ~ "\n"; - } - if ("cv" in canned_query && !(canned_query["cv"]).empty) { - got.coverage = canned_query["cv"].split("%20").join(" "); - got.search_text_area ~= "coverage: " ~ got.coverage ~ "\n"; - } - if ("rgt" in canned_query && !(canned_query["rgt"]).empty) { - got.rights = canned_query["rgt"].split("%20").join(" "); - got.search_text_area ~= "rights: " ~ got.rights ~ "\n"; - } - if ("cmt" in canned_query && !(canned_query["cmt"]).empty) { - got.comment = canned_query["cmt"].split("%20").join(" "); - got.search_text_area ~= "comment: " ~ got.comment ~ "\n"; - } - // if ("abstract" in canned_query && !(canned_query["abstract"]).empty) { - // got.abstract = canned_query["abstract"]; - // } - if ("bfn" in canned_query && !(canned_query["bfn"]).empty) { // search_field - got.src_filename_base = canned_query["bfn"].split("%20").join(" "); - got.search_text_area ~= "src_filename_base: " ~ got.src_filename_base ~ "\n"; - } - if ("sml" in canned_query && !(canned_query["sml"]).empty) { - got.sql_match_limit = canned_query["sml"].split("%20").join(" "); - // got.search_text_area ~= "sql_match_limit: " ~ got.sql_match_limit ~ "\n"; - } - // cgi.write("f.search_text_area: " ~ got.search_text_area ~ "
"); -} -#+END_SRC - -**** show_matched_objects (string fn) {} - -#+NAME: spine_search_show_matched_objects -#+BEGIN_SRC d -auto rgx = regex_canned_search; -string _matched_objects_text = ""; -string _url = canned_url; -string _url_new = ""; -string _matches_show_text = "&rt=txt"; -string _matches_show_index = "&rt=idx"; -string _fn = "&fn=" ~ fn; -_url_new = _url; -if (_url_new.match(rgx.results_type_index)) { - _url_new = _url_new.replace(rgx.results_type_index, _matches_show_text); -} else if (_url.match(rgx.results_type_text)) { - _url_new = _url_new.replace(rgx.results_type_text, _matches_show_index); -} else { - if (!(_url.match(rgx.results_type))) { - _url_new = _url ~ _matches_show_text; - } -} -if (!(_url_new.match(rgx.fn))) { - _url_new = _url_new ~ _fn; -} -_matched_objects_text = - "" - ~ "" - ~ "※" - ~ ""; -return _matched_objects_text; -#+END_SRC - -**** previous_next () {} - -#+NAME: spine_search_previous_next -#+BEGIN_SRC d -auto rgx = regex_canned_search; -string _previous_next = ""; -int _current_offset_value = 0; -string _set_offset_next = ""; -string _set_offset_previous = ""; -string _url = canned_url; -string _url_previous = ""; -string _url_next = ""; -string arrow_previous = ""; -string arrow_next = ""; -if (auto m = _url.matchFirst(rgx.track_offset)) { - _current_offset_value = m.captures["offset_val"].to!int; - _set_offset_next = m.captures["offset_key"] ~ ((m.captures["offset_val"]).to!int + cv.sql_match_limit.to!int).to!string; - _url_next = _url.replace(rgx.track_offset, _set_offset_next); - if (_current_offset_value < cv.sql_match_limit.to!int) { - _url_previous = ""; - } else { - _url_previous = ""; - _set_offset_previous = m.captures["offset_key"] ~ ((m.captures["offset_val"]).to!int - cv.sql_match_limit.to!int).to!string; - _url_previous = _url.replace(rgx.track_offset, _set_offset_previous); - } -} else { // _current_offset_value = 0; - _url_next = _url ~= "&smo=" ~ cv.sql_match_limit.to!string; -} -if (_url_previous.empty) { - arrow_previous = ""; -} else { - arrow_previous = - "" - ~ "" - ~ "<< prev" - ~ " || "; -} -arrow_next = - "" - ~ "" - ~ "next >>" - ~ ""; -_previous_next = "
" ~ arrow_previous ~ arrow_next; -return _previous_next; -#+END_SRC - -**** format html header - -#+NAME: spine_search_format_html_header -#+HEADER: :noweb yes -#+BEGIN_SRC d - header = format(q"┃ - - - - - - %s - - - - - - - -┃", - conf.cgi_search_form_title, - conf.http_request_type, - conf.http_host, - ); -#+END_SRC - -**** format html table - -#+NAME: spine_search_format_html_table -#+BEGIN_SRC d - table = format(q"┃ - - - -
- - -
- %s -
-
-
- ┃", - conf.cgi_search_form_html_title, - ); -#+END_SRC - -**** post_value(string field_name, string type="box", string set="on") {} - -#+NAME: spine_search_post_value -#+BEGIN_SRC d -string val = ""; -switch (type) { -case "field": - val = ((field_name in cgi.post && !(cgi.post[field_name]).empty) - ? cgi.post[field_name] - : (field_name in cgi.get) - ? cgi.get[field_name] - : ""); - val = tf.search_text_area; - break; -case "box": // generic for checkbox or radio; checkbox set == "on" radio set == "name set" - val = ((field_name in cgi.post && !(cgi.post[field_name]).empty) - ? (cgi.post[field_name] == set ? "checked" : "off") - : (field_name in cgi.get) - ? (cgi.get[field_name] == set ? "checked" : "off") - : "off"); - break; -case "radio": // used generic bo - val = ((field_name in cgi.post && !(cgi.post[field_name]).empty) - ? (cgi.post[field_name] == set ? "checked" : "off") - : (field_name in cgi.get) - ? (cgi.get[field_name] == set ? "checked" : "off") - : "checked"); - break; -case "checkbox": // used generic bo - val = ((field_name in cgi.post && !(cgi.post[field_name]).empty) - ? (cgi.post[field_name] == set ? "checked" : "off") - : (field_name in cgi.get) - ? (cgi.get[field_name] == set ? "checked" : "off") - : "checked"); - break; -default: -} -return val; -#+END_SRC - -**** string the_can(string fv) {} - -#+NAME: spine_search_the_can -#+BEGIN_SRC d -string show_the_can = post_value("url"); -string _the_can = ""; -if (show_the_can == "checked") { - tf = text_fields; - string method_get_url = conf.query_base_url ~ environment.get("QUERY_STRING", ""); - string method_post_url_construct = conf.query_base_url ~ tf.canned_query; - // assert(method_get_url == environment.get("HTTP_REFERER", conf.query_base_url ~ conf.query_string)); - if (conf.request_method == "POST") { - _the_can = - "" - ~ "POST: " - ~ "" - ~ method_post_url_construct - ~ "" - ~ "
"; - } else if (conf.request_method == "GET") { - _the_can = - "" - ~ "GET:  " - ~ "" - ~ method_get_url - ~ ""; - } - conf.http_url = conf.http_request_type ~ "://" ~ conf.http_host ~ conf.cgi_script_name ~ tf.canned_query; -} -return _the_can; -#+END_SRC - -**** string provide_tip() {} - -#+NAME: spine_search_provide_tip -#+BEGIN_SRC d -string searched_tip = post_value("se"); -string tip = ""; -if (searched_tip == "checked") { - string search_field = post_value("sf", "field"); - tf = text_fields; - tip = format(q"┃ - -database: %s; selected view: index -search string: %s %s %s %s %s %s
-%s %s %s %s %s %s - -┃", - cv.db_selected, - (tf.text.empty ? "" : "\"text: " ~ tf.text ~ "; "), - (tf.title.empty ? "" : "\"title: " ~ tf.title ~ "; "), - (tf.author.empty ? "" : "\"author: " ~ tf.author ~ "; "), - (tf.date.empty ? "" : "\"date " ~ tf.date ~ "; "), - (tf.uid.empty ? "" : "\"uid: " ~ tf.uid ~ "; "), - (tf.fn.empty ? "" : "\"fn: " ~ tf.fn ~ "; "), - (tf.text.empty ? "" : "text: " ~ tf.text ~ "
"), - (tf.title.empty ? "" : "title: " ~ tf.title ~ "
"), - (tf.author.empty ? "" : "author: " ~ tf.author ~ "
"), - (tf.date.empty ? "" : "date: " ~ tf.date ~ "
"), - (tf.uid.empty ? "" : "\"uid: " ~ tf.uid ~ "; "), - (tf.fn.empty ? "" : "\"fn: " ~ tf.fn ~ "; "), - ); -} -return tip; -#+END_SRC - -**** form - -#+NAME: spine_search_form -#+HEADER: :noweb yes -#+BEGIN_SRC d - form = format(q"┃ -<> -┃", - _cfg.cgi_filename, - (post_value("ec") == "checked") ? post_value("sf", "field") : "", - provide_tip, - search_note, - the_can(post_value("sf", "field")), - cv.db_selected, - post_value("rt", "box", "idx"), - post_value("rt", "box", "txt"), - post_value("sml", "box", "1000"), - post_value("sml", "box", "2500"), - post_value("ec"), - post_value("url"), - post_value("se"), - post_value("sql"), - ); -#+END_SRC - -#+NAME: spine_search_form_html -#+BEGIN_SRC html -
- - -
- - - %s - %s - %s -
- - - - - index - text / grep; - match limit: - 1,000 - 2,500 -
- echo query - search url - searched - sql statement - -
- - - - -#+END_SRC - -**** set_value(string field_name, string default_val) {} - -#+NAME: spine_search_set_value -#+BEGIN_SRC d -string val; -if (field_name in cgi.post) { - val = cgi.post[field_name]; -} else if (field_name in cgi.get) { - val = cgi.get[field_name]; -} else { val = default_val; } -return val; -#+END_SRC - -**** set_bool(string field_name) {} - -#+NAME: spine_search_set_bool -#+BEGIN_SRC d -bool val; -if (field_name in cgi.post -&& cgi.post[field_name] == "on") { - val = true; -} else if (field_name in cgi.get -&& cgi.get[field_name] == "on") { - val = true; -} else { val = false; } -return val; -#+END_SRC - -**** set selections - -#+NAME: spine_search_set_selections -#+BEGIN_SRC d -cv.db_selected = set_value("selected_db", _cfg.db_sqlite_filename); // selected_db_name == db (spine.search.db or whatever) -cv.sql_match_limit = set_value("sml", "1000"); -cv.sql_match_offset = set_value("smo", "0"); -cv.search_text = set_value("sf", ""); -cv.results_type = set_value("rt", "idx"); -cv.checked_echo = set_bool("ec"); -cv.checked_stats = set_bool("sts"); -cv.checked_url = set_bool("url"); -cv.checked_searched = set_bool("se"); -cv.checked_tip = set_bool("tip"); -cv.checked_sql = set_bool("sql"); -tf = text_fields; -#+END_SRC - -**** string highlight_text_matched(string _txt, string search_field) {} - -#+NAME: spine_search_query_highlight_text_matched -#+BEGIN_SRC d -string _mark_open = "┤"; -string _mark_close = "├"; -string _span_match = ""; -string _span_close = ""; -string _sf_str = search_field.strip.split("%20").join(" ").strip; -string[] _sf_arr = _sf_str.split(regex(r"\s+AND\s+|\s+OR\s+")); -auto rgx_url = regex(r"]+?>"); -foreach (_sf; _sf_arr) { - auto rgx_matched_text = regex(_sf, "i"); - auto rgx_marked_pair = regex(r"┤(?P" ~ _sf ~ ")├", "i"); - if (auto m = _txt.matchFirst(rgx_url)) { - _txt = replaceAll!(m => - _mark_open - ~ m.captures[0] - ~ _mark_close - )(_txt, rgx_matched_text); - _txt = replaceAll!(m => - replaceAll!(u => - u["keep"] - )(m.hit, rgx_marked_pair) - )(_txt, rgx_url); - _txt = replaceAll!(m => - _span_match - ~ m["keep"] - ~ _span_close - )(_txt, rgx_marked_pair); - } else { - _txt = replaceAll!(m => - _span_match - ~ m.captures[0] - ~ _span_close - )(_txt, rgx_matched_text); - } -} -return _txt; -#+END_SRC - -**** string select_field_like(string db_field, string search_field) {} - -#+NAME: spine_search_query_select_field_like -#+BEGIN_SRC d -string where_ = ""; -if (!(search_field.empty)) { - string _sf = search_field.strip.split("%20").join(" "); - if (_sf.match(r" OR ")) { - _sf = _sf.split(" OR ").join("%' OR " ~ db_field ~ " LIKE '%"); - } - if (_sf.match(r" AND ")) { - _sf = _sf.split(" AND ").join("%' AND " ~ db_field ~ " LIKE '%"); - } - _sf = "( " ~ db_field ~ " LIKE\n '%" ~ _sf ~ "%' )"; - where_ ~= format(q"┃ - %s -┃", - _sf - ); -} -return where_; -#+END_SRC - -**** query fields - -#+NAME: spine_search_query_fields -#+BEGIN_SRC d -string[] _fields; -_fields ~= select_field_like("doc_objects.clean", tf.text); -_fields ~= select_field_like("metadata_and_text.title", tf.title); -_fields ~= select_field_like("metadata_and_text.creator_author", tf.author); -_fields ~= select_field_like("metadata_and_text.uid", tf.uid); -_fields ~= select_field_like("metadata_and_text.src_filename_base", tf.fn); -_fields ~= select_field_like("metadata_and_text.src_filename_base", tf.src_filename_base); -_fields ~= select_field_like("metadata_and_text.language_document_char", tf.language); -_fields ~= select_field_like("metadata_and_text.date_published", tf.date); -_fields ~= select_field_like("metadata_and_text.classify_keywords", tf.keywords); -_fields ~= select_field_like("metadata_and_text.classify_topic_register", tf.topic_register); -string[] fields; -foreach (f; _fields) { - if (!(f.empty)) { fields ~= f; } -} -string fields_str = ""; -fields_str ~= fields.join(" AND "); -#+END_SRC - -**** the body format sql select - -#+NAME: spine_search_query_format_sql_select_the_body -#+BEGIN_SRC d - sql_select.the_body ~= format(q"┃ -SELECT - metadata_and_text.uid, - metadata_and_text.title, - metadata_and_text.creator_author_last_first, - metadata_and_text.creator_author, - metadata_and_text.src_filename_base, - metadata_and_text.language_document_char, - metadata_and_text.date_published, - metadata_and_text.classify_keywords, - metadata_and_text.classify_topic_register, - doc_objects.body, - doc_objects.seg_name, - doc_objects.ocn, - doc_objects.lev, - doc_objects.is_a, - metadata_and_text.uid -FROM - doc_objects, - metadata_and_text -WHERE ( - %s - ) -AND - doc_objects.uid_metadata_and_text = metadata_and_text.uid -ORDER BY - metadata_and_text.creator_author_last_first, - metadata_and_text.date_published DESC, - metadata_and_text.title, - metadata_and_text.language_document_char, - metadata_and_text.src_filename_base, - doc_objects.ocn -LIMIT %s OFFSET %s -;┃", - fields_str, - cv.sql_match_limit, - cv.sql_match_offset, - ); -#+END_SRC - -**** cgi writes - -#+NAME: spine_search_cgi_writes -#+BEGIN_SRC d -(cv.checked_sql) -? cgi.write(previous_next - ~ "
" - ~ sql_select.the_body.strip.split("\n ").join(" ").split("\n").join("
") - ~ "\n" - ) -: ""; -cgi.write(previous_next); -auto select_query_results = db.execute(sql_select.the_body).cached; -string _old_uid = ""; -if (!select_query_results.empty) { - string _date_published = "0000"; - string _close_para = ""; - string _matched_ocn_open = ""; - foreach (idx, row; select_query_results) { - if (row["uid"].as!string != _old_uid) { - _close_para = (idx == 1) ? "" : "

"; - _matched_ocn_open = (idx == 1) ? "" : "

"; - _old_uid = row["uid"].as!string; - _date_published = (row["date_published"].as!string.match(regex(r"^([0-9]{4})"))) - ? row["date_published"].as!string : "0000"; // used in regex that breaks if no match - auto m = _date_published.match(regex(r"^([0-9]{4})")); - string _date = (m.hit == "0000") ? "(year?) " : "(" ~ m.hit ~ ") "; - cgi.write( - _close_para - ~ "


" - ~ "

\"" - ~ row["title"].as!string ~ "\"" - ~ " " - ~ _date - ~ "[" ~ row["language_document_char"].as!string ~ "] " - ~ row["creator_author_last_first"].as!string - ~ " " - ~ show_matched_objects(row["src_filename_base"].as!string) - ~ "

" - ~ "
" - ); - } - if (cv.results_type == "txt") { - string _sfn, _id; - if ((row["lev"].as!int < 4) - || (row["ocn"].as!string == "0")) { - if (row["is_a"].as!string == "bookindex") { - _sfn = "bookindex"; - _id = "idx"; - } else if (row["is_a"].as!string == "blurb") { - _sfn = "blurb"; - _id = "bm"; - } else { - _sfn = "toc"; - _id = row["ocn"].as!string; - } - cgi.write( - "
" - ~ "
" - ~ "

" - ~ _id - ~ ":

" - ~ "
" - ~ "
" - ~ highlight_text_matched(row["body"].as!string, tf.text) - ~ "
" - ~ "
" - ); - } else { - if (row["is_a"].as!string == "bibliography") { - _id = row["ocn"].as!string ~ "b"; - _sfn = "bibliography"; - } else if (row["is_a"].as!string == "glossary") { - _id = row["ocn"].as!string ~ "g"; - _sfn = "glossary"; - } else { - _id = row["ocn"].as!string; - _sfn = row["seg_name"].as!string; - } - cgi.write( - "
" - ~ "
" - ~ "

" - ~ _id - ~ ":

" - ~ "
" - ~ "
" - ~ highlight_text_matched(row["body"].as!string, tf.text) - ~ "
" - ~ "
" - ); - } - } else { - string _sfn, _id; - if ((row["lev"].as!int < 4) - || (row["ocn"].as!string == "0")) { - if (row["is_a"].as!string == "bookindex") { - _sfn = "bookindex"; - _id = "i"; - } else if (row["is_a"].as!string == "blurb") { - _sfn = "blurb"; - _id = "bm"; - } else { - _sfn = "toc"; - _id = row["ocn"].as!string; - } - cgi.write( - _matched_ocn_open - ~ "" - ~ _id - ~ ", " - ); - } else { - if (row["is_a"].as!string == "bibliography") { - _id = row["ocn"].as!string ~ "b"; - _sfn = "bibliography"; - } else if (row["is_a"].as!string == "glossary") { - _id = row["ocn"].as!string ~ "g"; - _sfn = "glossary"; - } else { - _id = row["ocn"].as!string; - _sfn = row["seg_name"].as!string; - } - cgi.write( - _matched_ocn_open - ~ "" - ~ _id - ~ ", " - ); - } - _matched_ocn_open = ""; - } - } - cgi.write( previous_next); -} else { // offset_not_beyond_limit = false; - cgi.write("select_query_results empty

\n"); -} -#+END_SRC - -**** cgi write tail - -#+NAME: spine_search_cgi_write_tail -#+BEGIN_SRC d - cgi.write("

- - -
git -

-"); -#+END_SRC - -**** debug info - -#+NAME: spine_search_debug_info -#+BEGIN_SRC d -cgi.write("db with path: " ~ conf.db_path ~ "/" ~ cv.db_selected ~ "
\n"); -cgi.write("http url: " ~ conf.http_url ~ "
\n"); -cgi.write("query base url: " ~ conf.query_base_url ~ "
\n"); -cgi.write("db_selected: " ~ cv.db_selected ~ "
\n"); -cgi.write("search_text: " ~ cv.search_text ~ "
\n"); -cgi.write("sql_match_limit: " ~ cv.sql_match_limit ~ ";\n"); -cgi.write("sql_match_offset: " ~ cv.sql_match_offset ~ ";\n"); -cgi.write("results_type: " ~ cv.results_type ~ "
\n"); -cgi.write("cv.checked_echo: " ~ (cv.checked_echo ? "checked" : "off") ~ "; \n"); -cgi.write("cv.checked_stats: " ~ (cv.checked_stats ? "checked" : "off") ~ "; \n"); -cgi.write("cv.checked_url: " ~ (cv.checked_url ? "checked" : "off") ~ "; \n"); -cgi.write("cv.checked_searched: " ~ (cv.checked_searched ? "checked" : "off") ~ ";
\n"); -cgi.write("cv.checked_tip: " ~ (cv.checked_tip ? "checked" : "off") ~ "; \n"); -cgi.write("cv.checked_sql: " ~ (cv.checked_sql ? "checked" : "off") ~ "
\n"); -#+END_SRC - -**** css - -- if base size is 16px, 62.5% is 10px - 1rem == 10px - 1.6rem == 16px - -#+NAME: spine_search_css -#+BEGIN_SRC css -html { - font-size : 62.5%%; -} -,*{ - padding : 0px; - margin : 2px; -} -body { - height : 100vh; - font-size : 1.6rem; - color : #000000; - background : #FFFFFF; - background-color : #FFFFFF; -} -a:link { - color : #003399; - text-decoration : none; -} -a:visited { - color : #003399; - text-decoration : none; -} -a:hover { - color : #000000; - background-color : #F9F9AA; -} -a.matched_ocn:link { - color : #003399; - text-decoration : none; -} -a.matched_ocn:visited { - color : #003399; - text-decoration : none; -} -a.matched_ocn:hover { - color : #000000; - background-color : #F9F9AA; - font-size : 1.6rem; -} -a.lnkocn:link { - color : #777777; - text-decoration : none; -} -a.lnkocn:visited { - color : #32CD32; - text-decoration : none; -} -a.lnkocn:hover { - color : #777777; - font-size : 1.6rem; -} -a:hover img { - background-color : #FFFFFF; -} -a:active { - color : #003399; - text-decoration : underline; -} -.flex-container { - display : flex; -} -div.publication { - margin-top : 2px; - margin-bottom : 4px; - margin-left : 0%%; - margin-right : 0%%; -} -div.textview_ocn { - margin-left : 0%%; - margin-right : 1%%; -} -div.textview_found { - margin-left : 1%%; - margin-right : 1%%; -} -textarea { - color : #000000; - background-color : #FFFFFF; -} -span.match { - color : #000000; - background-color : #FFFF48; -} -input, select, textarea { - font-size : 2rem; -} -input[type="text"] { - font-size : 2rem; - line-height : 150%%; -} -button[type="submit"] { - font-size : 2rem; - line-height : 150%%; -} -p.norm { } -p.center { text-align : center; } -p.i1 { padding-left : 1em; } -p.i2 { padding-left : 2em; } -p.i3 { padding-left : 3em; } -p.i4 { padding-left : 4em; } -p.i5 { padding-left : 5em; } -p.i6 { padding-left : 6em; } -p.i7 { padding-left : 7em; } -p.i8 { padding-left : 8em; } -p.i9 { padding-left : 9em; } -/* hanging indent */ -p[indent="h0i0"] { - padding-left : 0em; - text-indent : 0em; -} -p.publication { - font-size : 1.6rem; - margin-left : 0em; - margin-top : 0px; - margin-bottom : 0px; - margin-right : 6px; - text-align : left; -} -p.ocn_is { - font-size : 1.6rem; - display : inline-block; -} -p.matched_ocn { - font-size : 1.5rem; - margin-left : 2em; - margin-top : 0px; - margin-bottom : 0px; - margin-right : 6px; - text-align : left; -} -p[indent="h0i1"] { - padding-left : 1em; - text-indent : -1em; -} -p[indent="h0i2"] { - padding-left : 2em; - text-indent : -2em; -} -p[indent="h0i3"] { - padding-left : 3em; - text-indent : -3em; -} -p[indent="h0i4"] { - padding-left : 4em; - text-indent : -4em; -} -p[indent="h0i5"] { - padding-left : 5em; - text-indent : -5em; -} -p[indent="h0i6"] { - padding-left : 6em; - text-indent : -6em; -} -p[indent="h0i7"] { - padding-left : 7em; - text-indent : -7em; -} -p[indent="h0i8"] { - padding-left : 8em; - text-indent : -8em; -} -p[indent="h0i9"] { - padding-left : 9em; - text-indent : -9em; -} -p[indent="h1i0"] { - padding-left : 0em; - text-indent : 1em; -} -p[indent="h1i1"] { - padding-left : 1em; - text-indent : 0em; -} -p[indent="h1i2"] { - padding-left : 2em; - text-indent : -1em; -} -p[indent="h1i3"] { - padding-left : 3em; - text-indent : -2em; -} -p[indent="h1i4"] { - padding-left : 4em; - text-indent : -3em; -} -p[indent="h1i5"] { - padding-left : 5em; - text-indent : -4em; -} -p[indent="h1i6"] { - padding-left : 6em; - text-indent : -5em; -} -p[indent="h1i7"] { - padding-left : 7em; - text-indent : -6em; -} -p[indent="h1i8"] { - padding-left : 8em; - text-indent : -7em; -} -p[indent="h1i9"] { - padding-left : 9em; - text-indent : -8em; -} -p[indent="h2i0"] { - padding-left : 0em; - text-indent : 2em; -} -p[indent="h2i1"] { - padding-left : 1em; - text-indent : 1em; -} -p[indent="h2i2"] { - padding-left : 2em; - text-indent : 0em; -} -p[indent="h2i3"] { - padding-left : 3em; - text-indent : -1em; -} -p[indent="h2i4"] { - padding-left : 4em; - text-indent : -2em; -} -p[indent="h2i5"] { - padding-left : 5em; - text-indent : -3em; -} -p[indent="h2i6"] { - padding-left : 6em; - text-indent : -4em; -} -p[indent="h2i7"] { - padding-left : 7em; - text-indent : -5em; -} -p[indent="h2i8"] { - padding-left : 8em; - text-indent : -6em; -} -p[indent="h2i9"] { - padding-left : 9em; - text-indent : -7em; -} -p[indent="h3i0"] { - padding-left : 0em; - text-indent : 3em; -} -p[indent="h3i1"] { - padding-left : 1em; - text-indent : 2em; -} -p[indent="h3i2"] { - padding-left : 2em; - text-indent : 1em; -} -p[indent="h3i3"] { - padding-left : 3em; - text-indent : 0em; -} -p[indent="h3i4"] { - padding-left : 4em; - text-indent : -1em; -} -p[indent="h3i5"] { - padding-left : 5em; - text-indent : -2em; -} -p[indent="h3i6"] { - padding-left : 6em; - text-indent : -3em; -} -p[indent="h3i7"] { - padding-left : 7em; - text-indent : -4em; -} -p[indent="h3i8"] { - padding-left : 8em; - text-indent : -5em; -} -p[indent="h3i9"] { - padding-left : 9em; - text-indent : -6em; -} -p[indent="h4i0"] { - padding-left : 0em; - text-indent : 4em; -} -p[indent="h4i1"] { - padding-left : 1em; - text-indent : 3em; -} -p[indent="h4i2"] { - padding-left : 2em; - text-indent : 2em; -} -p[indent="h4i3"] { - padding-left : 3em; - text-indent : 1em; -} -p[indent="h4i4"] { - padding-left : 4em; - text-indent : 0em; -} -p[indent="h4i5"] { - padding-left : 5em; - text-indent : -1em; -} -p[indent="h4i6"] { - padding-left : 6em; - text-indent : -2em; -} -p[indent="h4i7"] { - padding-left : 7em; - text-indent : -3em; -} -p[indent="h4i8"] { - padding-left : 8em; - text-indent : -4em; -} -p[indent="h4i9"] { - padding-left : 9em; - text-indent : -5em; -} -p[indent="h5i0"] { - padding-left : 0em; - text-indent : 5em; -} -p[indent="h5i1"] { - padding-left : 1em; - text-indent : 4em; -} -p[indent="h5i2"] { - padding-left : 2em; - text-indent : 3em; -} -p[indent="h5i3"] { - padding-left : 3em; - text-indent : 2em; -} -p[indent="h5i4"] { - padding-left : 4em; - text-indent : 1em; -} -p[indent="h5i5"] { - padding-left : 5em; - text-indent : 0em; -} -p[indent="h5i6"] { - padding-left : 6em; - text-indent : -1em; -} -p[indent="h5i7"] { - padding-left : 7em; - text-indent : -2em; -} -p[indent="h5i8"] { - padding-left : 8em; - text-indent : -3em; -} -p[indent="h5i9"] { - padding-left : 9em; - text-indent : -4em; -} -p[indent="h6i0"] { - padding-left : 0em; - text-indent : 6em; -} -p[indent="h6i1"] { - padding-left : 1em; - text-indent : 5em; -} -p[indent="h6i2"] { - padding-left : 2em; - text-indent : 4em; -} -p[indent="h6i3"] { - padding-left : 3em; - text-indent : 3em; -} -p[indent="h6i4"] { - padding-left : 4em; - text-indent : 2em; -} -p[indent="h6i5"] { - padding-left : 5em; - text-indent : 1em; -} -p[indent="h6i6"] { - padding-left : 6em; - text-indent : 0em; -} -p[indent="h6i7"] { - padding-left : 7em; - text-indent : -1em; -} -p[indent="h6i8"] { - padding-left : 8em; - text-indent : -2em; -} -p[indent="h6i9"] { - padding-left : 9em; - text-indent : -3em; -} -p[indent="h7i0"] { - padding-left : 0em; - text-indent : 7em; -} -p[indent="h7i1"] { - padding-left : 1em; - text-indent : 6em; -} -p[indent="h7i2"] { - padding-left : 2em; - text-indent : 5em; -} -p[indent="h7i3"] { - padding-left : 3em; - text-indent : 4em; -} -p[indent="h7i4"] { - padding-left : 4em; - text-indent : 3em; -} -p[indent="h7i5"] { - padding-left : 5em; - text-indent : 2em; -} -p[indent="h7i6"] { - padding-left : 6em; - text-indent : 1em; -} -p[indent="h7i7"] { - padding-left : 7em; - text-indent : 0em; -} -p[indent="h7i8"] { - padding-left : 8em; - text-indent : -1em; -} -p[indent="h7i9"] { - padding-left : 9em; - text-indent : -2em; -} -p[indent="h8i0"] { - padding-left : 0em; - text-indent : 8em; -} -p[indent="h8i1"] { - padding-left : 1em; - text-indent : 7em; -} -p[indent="h8i2"] { - padding-left : 2em; - text-indent : 6em; -} -p[indent="h8i3"] { - padding-left : 3em; - text-indent : 5em; -} -p[indent="h8i4"] { - padding-left : 4em; - text-indent : 4em; -} -p[indent="h8i5"] { - padding-left : 5em; - text-indent : 3em; -} -p[indent="h8i6"] { - padding-left : 6em; - text-indent : 2em; -} -p[indent="h8i7"] { - padding-left : 7em; - text-indent : 1em; -} -p[indent="h8i8"] { - padding-left : 8em; - text-indent : 0em; -} -p[indent="h8i9"] { - padding-left : 9em; - text-indent : -1em; -} -p[indent="h9i0"] { - padding-left : 0em; - text-indent : 9em; -} -p[indent="h9i1"] { - padding-left : 1em; - text-indent : 8em; -} -p[indent="h9i2"] { - padding-left : 2em; - text-indent : 7em; -} -p[indent="h9i3"] { - padding-left : 3em; - text-indent : 6em; -} -p[indent="h9i4"] { - padding-left : 4em; - text-indent : 5em; -} -p[indent="h9i5"] { - padding-left : 5em; - text-indent : 4em; -} -p[indent="h9i6"] { - padding-left : 6em; - text-indent : 3em; -} -p[indent="h9i7"] { - padding-left : 7em; - text-indent : 2em; -} -p[indent="h9i8"] { - padding-left : 8em; - text-indent : 1em; -} -p[indent="h9i9"] { - padding-left : 9em; - text-indent : 0em; -} -p.spaced { white-space : pre; } -p.block { - white-space : pre; -} -p.group { } -p.alt { } -p.verse { - white-space : pre; - margin-bottom : 6px; -} -p.caption { - text-align : left; - font-size : 80%%; - display : inline; -} -p.endnote { - font-size : 1.5rem; - line-height : 120%%; - text-align : left; - margin-right : 15mm; - padding-left : 1em; - text-indent : -1em; -} -p.center { - text-align : center; -} -p.bold { - font-weight : bold; -} -p.bold_left { - font-weight : bold; - text-align : left; -} -p.centerbold { - text-align : center; - font-weight : bold; -} -p.em { - font-weight : bold; - font-style : normal; - background : #FFF3B6; -} -p.small { - font-size : 1.4rem; - margin-top : 0px; - margin-bottom : 0px; - margin-right : 6px; - text-align : left; -} -.tiny, .tiny_left, .tiny_right, .tiny_center { - font-size : 1.3rem; - margin-top : 0px; - margin-bottom : 0px; - color : #EEEEEE; - margin-right : 6px; - text-align : left; -} -p.tiny { } -p.tiny_left { - margin-left : 0px; - margin-right : 0px; - text-align : left; -} -p.tiny_right { - margin-right : 1em; - text-align : right; -} -p.tiny_center { - margin-left : 0px; - margin-right : 0px; - text-align : center; -} -p.book_index_lev1 { - line-height : 100%%; - margin-top : 4px; - margin-bottom : 1px; -} -p.book_index_lev2 { - line-height : 100%%; - text-align : left; - margin-left : 3em; - margin-top : 1px; - margin-bottom : 3px; -} -tt { - font-family : inconsolata, "liberation mono", "bitstream vera mono", "dejavu mono", monaco, consolas, "andale mono", "courier new", "courier 10 pitch", courier, monospace; - background-color : #555555; - color : #DDDDDD; -} -pre { - width : auto; - display : block; - clear : both; - color : #555555; -} -pre.codeline { - display : table; - clear : both; - table-layout : fixed; - margin-left : 5%%; - margin-right : 5%%; - width : 90%%; - white-space : pre-wrap; - border-style : none; - border-radius : 5px 5px 5px 5px; - box-shadow : 0 2px 5px #AAAAAA inset; - margin-bottom : 1em; - padding : 0.5em 1em; - page-break-inside : avoid; - word-wrap : break-word; - font-family : inconsolata, "liberation mono", "bitstream vera mono", "dejavu mono", monaco, consolas, "andale mono", "courier new", "courier 10 pitch", courier, monospace; - white-space : pre; - white-space : pre-wrap; - white-space : -moz-pre-wrap; - white-space : -o-pre-wrap; - background-color : #555555; - color : #DDDDDD; - font-size : 1.8rem; - line-height : 120%%; -} -pre.codeline::before { - counter-reset : linenum; -} -pre.codeline span.tr { - display : table-row; - counter-increment : linenum; -} -pre.codeline span.th { - display : table-cell; - user-select : none; - -moz-user-select : none; - -webkit-user-select : none; - padding : 0.5em 0.5em; -} -pre.codeline span.th::before { - content : counter(linenum) "."; - color : #999999; - text-align : right; - display : block; -} -pre.codeline span.th { - width : 4em; -} -pre.codeline code { - display : table-cell; -} -p.code { - border-style : none; -} -note { white-space : pre; } -em { - font-weight : bold; - font-style : italic; -} -p.left,th.left,td.left { - text-align : left; -} -p.small_left,th.small_left,td.small_left { - text-align : left; - font-size : 1.4rem; -} -p.right,th.right,td.right { - text-align : right; -} -ul, li { - list-style-type : none; - list-style : none; - padding-left : 20px; - font-weight : normal; - line-height : 150%%; - text-align : left; - text-indent : 0mm; - margin-left : 1em; - margin-right : 2em; - margin-top : 3px; - margin-bottom : 3px; -} -li { - background : (../image_sys/bullet_09.png) no-repeat 0px 6px; -} -ul { } -h0, h1, h2, h3, h4, h5, h6, h7 { - font-weight : bold; - line-height : 120%%; - text-align : left; - margin-top : 20px; - margin-bottom : 10px; -} -h4.norm, h5.norm, h6.norm, h7.norm { - margin-top : 10px; - margin-bottom : 0px; -} -h0 { font-size : 2rem; } -h1 { font-size : 1.9rem; } -h2 { font-size : 1.8rem; } -h3 { font-size : 1.7rem; } -h4 { font-size : 1.6rem; } -h5 { font-size : 1.6rem; } -h6 { font-size : 1.6rem; } -h7 { font-size : 1.6rem; } -h0, h1, h2, h3, h4, h5, h6, h7 { - text-shadow : .2em .2em .3em #999999; -} -h1.i { margin-left : 2em; } -h2.i { margin-left : 3em; } -h3.i { margin-left : 4em; } -h4.i { margin-left : 5em; } -h5.i { margin-left : 6em; } -h6.i { margin-left : 7em; } -h7.i { margin-left : 8em; } -h8.i { margin-left : 9em; } -h9.i { margin-left : 10em; } -.toc { - font-weight : normal; - margin-top : 6px; - margin-bottom : 6px; -} -h0.toc { - margin-left : 1em; - font-size : 2rem; - line-height : 150%%; -} -h1.toc { - margin-left : 1em; - font-size : 1.9rem; - line-height : 150%%; -} -h2.toc { - margin-left : 2em; - font-size : 1.8rem; - line-height : 140%%; -} -h3.toc { - margin-left : 3em; - font-size : 1.7rem; - line-height : 120%%; -} -h4.toc { - margin-left : 4em; - font-size : 1.6rem; - line-height : 120%%; -} -h5.toc { - margin-left : 5em; - font-size : 1.5rem; - line-height : 110%%; -} -h6.toc { - margin-left : 6em; - font-size : 1.4rem; - line-height : 110%%; -} -h7.toc { - margin-left : 7em; - font-size : 1.3rem; - line-height : 100%%; -} -.subtoc { - margin-right : 34%%; - font-weight : normal; -} -h5.subtoc { - margin-left : 2em; - font-size : 1.5rem; - margin-top : 2px; - margin-bottom : 2px; -} -h6.subtoc { - margin-left : 3em; - font-size : 1.4rem; - margin-top : 0px; - margin-bottom : 0px; -} -h7.subtoc { - margin-left : 4em; - font-size : 1.3rem; - margin-top : 0px; - margin-bottom : 0px; -} -hr { - display : block; - height : 1px; - width : 100%%; - border : 0; - border-top : 1px solid #AAAAAA; - border-color : #AAAAAA - background-color : #AAAAAA - margin-left : 0%%; - margin-right : 0em; - margin-top : 0.5em; - margin-bottom : 0.5em; - padding : 0; -} -#+END_SRC - -*** settings for spine search SET - -#+NAME: url_doc_root -#+BEGIN_SRC text -/srv/www -#+END_SRC - -#+NAME: doc_root_path -#+BEGIN_SRC text -_cfg.doc_root_www -#+END_SRC -#+BEGIN_SRC text -/var/www/html -#+END_SRC - -#+NAME: doc_subroot_path -#+BEGIN_SRC text -/spine -#+END_SRC - -#+NAME: db_root_path -#+BEGIN_SRC text -_cfg.doc_root_db -#+END_SRC -#+BEGIN_SRC text -/var/www/sqlite/ -#+END_SRC - -*** spine_search configuration.txt - -see configuration_cfte.org - -*** document header including copyright & license - -#+NAME: doc_header_including_copyright_and_license -#+BEGIN_SRC txt -/+ -- Name: Spine, Doc Reform - - Description: documents, structuring, processing, publishing, search - - static content generator - - - Author: Ralph Amissah - [ralph.amissah@gmail.com] - - - Copyright: (C) 2015 - 2022 Ralph Amissah, All Rights - Reserved. - - - License: AGPL 3 or later: - - Spine (SiSU), a framework for document structuring, publishing and - search - - Copyright (C) Ralph Amissah - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU AFERO General Public License as published by the - Free Software Foundation, either version 3 of the License, or (at your - option) any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along with - this program. If not, see [https://www.gnu.org/licenses/]. - - If you have Internet connection, the latest version of the AGPL should be - available at these locations: - [https://www.fsf.org/licensing/licenses/agpl.html] - [https://www.gnu.org/licenses/agpl.html] - - - Spine (by Doc Reform, related to SiSU) uses standard: - - docReform markup syntax - - standard SiSU markup syntax with modified headers and minor modifications - - docReform object numbering - - standard SiSU object citation numbering & system - - - Homepages: - [https://www.doc_reform.org] - [https://www.sisudoc.org] - - - Git - [https://git.sisudoc.org/projects/?p=software/spine.git;a=summary] - -+/ -#+END_SRC diff --git a/org/config_d_cfte.org b/org/config_d_cfte.org index bb8695c..f48c333 100644 --- a/org/config_d_cfte.org +++ b/org/config_d_cfte.org @@ -166,37 +166,6 @@ struct Cfg { enum _cfg = Cfg(); #+END_SRC -*** spine_search: configuration.txt SET - -#+HEADER: :tangle "../sundry/spine_search_cgi/views/configuration_example.txt" -#+HEADER: :noweb yes -#+BEGIN_SRC d -/+ obt - org-mode generated file +/ -struct Cfg { - string http_request_type = "<>"; - string http_host = "<>"; - string www_url_doc_subroot = "<>"; - string cgi_filename = "<>"; - string cgi_search_form_title = "<>"; - string db_sqlite_path = "<>"; - string db_sqlite_filename = "<>"; -} -enum _cfg = Cfg(); -#+END_SRC - -#+BEGIN_SRC d -struct Cfg { - string http_request_type = "https"; - string http_host = "sisudoc.org"; - string www_url_doc_subroot = "/spine"; - string cgi_filename = "spine_search"; - string cgi_search_form_title = "≅ SiSU Spine search"; - string db_sqlite_path = "/var/www/sqlite"; - string db_sqlite_filename = "spine.search.db"; -} -enum _cfg = Cfg(); -#+END_SRC - *** shared settings SET defaults #+NAME: http_request_type diff --git a/org/config_dub.org b/org/config_dub.org index 839adf9..0384378 100644 --- a/org/config_dub.org +++ b/org/config_dub.org @@ -535,101 +535,6 @@ configuration "build" { } #+END_SRC -** spine search cgi (in ./sundry) -*** dub.json - -#+HEADER: :tangle "../sundry/spine_search_cgi/dub.json" -#+HEADER: :noweb yes -#+BEGIN_SRC json -{ - "authors": [ - "Ralph Amissah" - ], - "copyright": "Copyright © 2015 - 2022 Ralph Amissah", - "name": "spine_search", - "version": "<>", - "description": "cgi search for spine, a sisu like document parser", - "homepage": "https://sisudoc.org", - "license": "AGPL-3.0+", - "targetPath": "./cgi-bin", - "sourcePaths": [ "./src" ], - "stringImportPaths": [ "./views" ], - "buildRequirements": [ "allowWarnings" ], - "targetType": "executable", - "platforms": [ "posix" ], - "buildTypes": { - "dmd": { - "dflags": [ "-J=views", "-I=src" ], - "buildOptions": [ "verbose", "inline" ], - "buildRequirements": [ "allowWarnings" ] - }, - "ldc": { - "dflags": [ "-O2", "-J=views", "-I=src" ], - "buildOptions": [ "verbose", "optimize", "inline" ], - "buildRequirements": [ "allowWarnings" ] - } - }, - "dependencies": { - "spine_search:arsd.cgi": "*", - "spine_search:d2sqlite3": "*" - }, - "subPackages": [ - { - "name": "arsd.cgi", - "description": "cgi", - "homepage": "https://code.dlang.org/packages/arsd-official", - "authors": [ "Adam Ruppee" ], - "copyright": "Copyright 2011-18 Adam Ruppee", - "license": "BSL-1.0", - "sourcePaths": [ "./src/ext_depends_cgi/arsd" ], - "importPaths": [ "./src/ext_depends_cgi/arsd" ], - "configurations": [ - { - "name": "cgi", - "cgi": "with-lib", - "targetType": "library", - "systemDependencies": "Arsd version >= 0.8.7" - } - ] - }, - { - "name": "d2sqlite3", - "description": "A thin wrapper around SQLite 3", - "homepage": "https://github.com/dlang-community/d2sqlite3", - "authors": [ "Nicolas Sicard", "Other contributors: see Github repo" ], - "copyright": "Copyright 2011-18 Nicolas Sicard", - "license": "BSL-1.0", - "sourcePaths": [ "./src/ext_depends_cgi/d2sqlite3/source" ], - "importPaths": [ "./src/ext_depends_cgi/d2sqlite3/source" ], - "configurations": [ - { - "name": "d2sqlite3", - "d2sqlite3": "with-lib", - "targetType": "library", - "systemDependencies": "SQLite version >= 3.8.7", - "libs": [ "sqlite3" ], - "excludedSourceFiles": [ "source/tests.d" ] - } - ] - } - ], - "configurations": [ - { - "name": "default", - "targetName": "spine_search" - }, - { - "name": "ldc", - "targetName": "spine-search-ldc.cgi" - }, - { - "name": "dmd", - "targetName": "spine-search-dmd.cgi" - } - ] -} -#+END_SRC - ** dub :dub: https://github.com/dlang/dub/ diff --git a/org/config_git.org b/org/config_git.org index 18146d3..3a1083b 100644 --- a/org/config_git.org +++ b/org/config_git.org @@ -107,61 +107,3 @@ tmp/** #*.\#* #.reggae/** #+END_SRC - -* spine search -** .gitignore :gitignore: - -#+HEADER: :tangle "../sundry/spine_search_cgi/.gitignore" -#+BEGIN_SRC sh -# git ls-files --others --exclude-from=.git/info/exclude -# git clean -ix -,* -!.gitignore -!README.md -!README -!COPYRIGHT -!CHANGELOG -!makefile -!version.txt -!*.json -!*.sdl -!meson.build -!tangle -!*.org -!*.d -!*.rb -!*.txt -!conf.sdl -!*.nix -!nix -!nix/** -!flake.lock -!.envrc -!src -!src/** -!*.sst -!*.ssm -!**/*.sst -!**/*.ssm -!config_local_site -!views -.dub/** -,**/.dub/** -,**/cgi-bin/** -tmp/** -,*_.org -,*_.d -,*_.txt -,*_ -,*.swp -,*~ -,*~ -\#* -,*.\#* -!.envrc-local_ -!src/spine_search.d_ -#!*/ -#\#* -#*.\#* -#.reggae/** -#+END_SRC diff --git a/org/config_make.org b/org/config_make.org index 8214e4e..cfbd01a 100644 --- a/org/config_make.org +++ b/org/config_make.org @@ -1755,89 +1755,6 @@ if [ -e .env/echo-nixNote ]; then fi #+END_SRC -* dr spine_search -** spine_search makefile :makefile -*** tangle - -#+HEADER: :tangle ../sundry/spine_search_cgi/makefile -#+HEADER: :noweb yes -#+BEGIN_SRC makefile -<> -<> -#+END_SRC - -*** make - -#+NAME: make_cgi_search_makefile -#+BEGIN_SRC makefile -SpineBIN := "${SpineBIN}" # 'result/bin' -SpineOUT := "${SpineOUT}" # '/srv/www/spine' -SpinePOD := "${SpinePOD}" # '~/grotto/repo/git.repo/projects/project-spine/doc-reform-markup/spine-markup-samples/markup/pod' -SpineSearchAction := 'https://sisudoc.org/spine_search' -SpineCGIform := 'spine_search' -SpineSQLdb := 'spine.search.db' - -# nix build -build: - nix-build - -# cp cgi search form -cp-cgi: - sudo cp -vi /var/www/cgi/cgi-bin/spine_search /var/www/cgi/cgi-bin/spine_search_old && \ - sudo cp -vi result/share/cgi-bin/spine_search /var/www/cgi/cgi-bin/spine_search - -#+END_SRC - -*** get project dependencies - -#+NAME: make_get_project_cgi_search_dependencies_github -#+BEGIN_SRC makefile -get_depends: - hwd=$$(echo `pwd`) && \ - gwd="$${hwd}/src/ext_depends_cgi" && \ - dirs=$$(echo `ls -gx $${gwd}`) && \ - license_bsl="Boost Software License 1.0 (BSL-1.0)" && \ - echo $${hwd} && \ - echo $${gwd} && \ - echo $${deps} && \ - dub upgrade; \ - cd $${gwd} && \ - for dir in $${deps}; do \ - if [ -d $${dir} ]; then \ - echo $${dir} && \ - if [[ "arsd" == $${dir} ]]; then \ - echo $${dir} && \ - rm -rf $${dir} && \ - mkdir $${dir} && \ - aria2c -o "$${dir}/cgi.d" "https://raw.githubusercontent.com/adamdruppe/arsd/master/cgi.d" && \ - cd $${gwd}; \ - elif [[ "d2sqlite3" == $${dir} ]]; then \ - echo $${dir} && \ - rm -rf $${dir} && \ - git clone --depth=1 https://github.com/dlang-community/$${dir} && \ - cd $${dir} && \ - echo "$${dir} `git rev-parse HEAD | cut -c 1-8`" > ../$${dir}.meta && \ - echo "https://github.com/dlang-community/$${dir}" >> ../$${dir}.meta && \ - echo "$${license_bsl}" >> ../$${dir}.meta && \ - cd $${gwd} && \ - rm -rf $${dir}/.git; \ - fi; \ - fi; \ - done; \ - cd $${hwd} - -set_depends: get_depends - dub describe | sed 's~$(shell echo `pwd | sed 's_/_\\/_g'`)~.~g' > dub_describe.json - -#+END_SRC - -** .env/local - -#+HEADER: :NO-tangle ../sundry/spine_search_cgi/.env/local -#+BEGIN_SRC nix -export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos -#+END_SRC - * www dr spine latex - /srv/www/spine/latex diff --git a/org/config_nix.org b/org/config_nix.org index 8286b05..7bd1645 100644 --- a/org/config_nix.org +++ b/org/config_nix.org @@ -1245,367 +1245,6 @@ jq git #+END_SRC -** spine search cgi (in ./sundry) -*** envrc :envrc: -**** .envrc - -#+HEADER: :tangle "../sundry/spine_search_cgi/.envrc" -#+BEGIN_SRC sh -NIX_ENFORCE_PURITY=0 -if ! has nix_direnv_version || ! nix_direnv_version 1.4.0; then -# https://github.com/nix-community/nix-direnv - source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/1.4.0/direnvrc" "sha256-4XfVDjv75eHMWN4G725VW7BoOV4Vl3vAabK4YXIfPyE=" -fi -if [ -f .envrc-local ]; then - source_env_if_exists .envrc-local || source .envrc-local -fi -#+END_SRC - -**** .envrc-local - -#+HEADER: :tangle "../sundry/spine_search_cgi/.envrc-local_" -#+HEADER: :noweb yes -#+BEGIN_SRC nix -export NIX_PATH=<> -#export NIX_PATH=nixpkgs=<> -# reload when these files change -# watch_file flake.nix -# watch_file flake.lock -## load the flake devShell -# eval "$(nix print-dev-env)" -# echo $NIX_BUILD_TOP -export SpineVER=$(git describe --long --tags | sed 's/^[ a-z_-]\+\([0-9.]\+\)/\1/;s/\([^-]*-g\)/r\1/;s/-/./g') -export SpinePROJ=<> -export SpineSRC=<> -export SpineBIN=<> -export SpineDOC=<> -export SpinePOD=$SpineDOC/markup/pod -#export SpineOUTversioned=<> -export SpineOUT=<> -export SpineDBpath=<> -export SpineCgiBIN=<> -if [ -e .env/echo-nixNote ]; then # source an additional user-specific .envrc in ./.envrc-local - source .env/echo-nixNote -fi -#+END_SRC - -**** .envrc-local - -#+HEADER: :tangle "../sundry/spine_search_cgi/.env/echo-nixNote" -#+BEGIN_SRC sh -echo '-*- mode: org -*- - -,* nixpkgs path? - - # eval "$(nix print-dev-env)" -' > nixNote_.org - -echo " == `nix-instantiate --find-file nixpkgs`" >> nixNote_.org - -echo ' -,* nix build and show derivation - -,#+BEGIN_SRC sh -nix-shell --pure - -nix-build -nix build -f default.nix --print-build-logs -nix shell -f default.nix --print-build-logs -nix develop --build -f derivation.nix -I .envrc --print-build-logs -nix-instantiate | nix-build -nix build `nix-instantiate` - -nix develop - -nix-instantiate | nix show-derivation | jq -nix-instantiate | nix show-derivation --recursive | jq - -nix search --json 2>/dev/null |jq -,#+END_SRC - -,* version and build info - -,#+BEGIN_SRC sh' >> nixNote_.org - -echo 'spine version (git) == $SpineVER' >> nixNote_.org -echo "spine version (git) == $SpineVER" >> nixNote_.org -echo 'nix-instantiate == `nix-instantiate`' >> nixNote_.org -echo "nix-instantiate == `nix-instantiate`" >> nixNote_.org - -echo "#+END_SRC - -,* initialised shell variables - -,#+BEGIN_SRC sh -SpineSRC=$SpineSRC -SpineBIN=$SpineBIN -SpineDOC=$SpineDOC -SpinePOD=$SpinePOD -#SpineOUTversioned=$SpineOUTversioned -SpineOUT=$SpineOUT -SpineCgiBIN=$SpineCgiBIN -,#+END_SRC -" >> nixNote_.org - -echo '* cgi form spine_search nix build and copy to spine-search - -,#+BEGIN_SRC sh -nix-build && sudo cp -vi result/share/cgi-bin/spine_search $SpineCgiBIN/. -,#+END_SRC - -,* spine run instruction examples -,** cgi operations (output to $SpineOUT) -,*** configuration - -,#+BEGIN_SRC sh -$SpineBIN/spine -v --show-config --config=$SpinePOD/.dr -,#+END_SRC - -,*** generate html (linked to search form & curate) - -,#+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-curate --sqlite-db-filename="<>" --cgi-sqlite-search-filename="<>"--output=$SpineOUT $SpinePOD/* -,#+END_SRC - -,*** generate sql output - -,#+BEGIN_SRC sh -SpineBIN/spine -v --sqlite-update --sqlite-db-filename="<>" --sqlite-db-path="$SpineDBpath" -,#+END_SRC - -,*** generate curate - -,#+BEGIN_SRC sh -$SpineBIN/spine -v --curate --output=$SpineOUT $SpinePOD/* -$SpineBIN/spine -v --html --html-link-curate --curate --output=$SpineOUT $SpinePOD/* -,#+END_SRC - -,*** create or re-create sql db (--sqlite-db-create or --sqlite-db-recreate) - -,#+BEGIN_SRC sh -$SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="<>" --sqlite-db-path="$SpineDBpath" -,#+END_SRC - -,*** generate html (linked to search form), sql output, curate - -,#+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-db-filename="<>" --cgi-sqlite-search-filename="<>" --sqlite-update --sqlite-db-path="$SpineDBpath" --output="$SpineOUT" $SpinePOD/* -#if names and paths are configured in resource configuration file, e.g. $SpinePOD/.rc/config_local_site -$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update $SpinePOD/* -,#+END_SRC - -,*** make search form - -,#+BEGIN_SRC sh -$SpineBIN/spine -v --cgi-search-form-codegen --config=$SpinePOD/.dr/config_local_site -#$SpineBIN/spine -v --cgi-search-form-codegen --output=$SpineOUT $SpinePOD/* -,#+END_SRC -' >> nixNote_.org - -#cat nixNote_.org - -#echo "emacs nixNote_.org" -#echo "cat nixNote_.org" -#+END_SRC - -*** flake :flake: - -- flake.nix - -nix develop - -nix flake update - -#+HEADER: :tangle "../sundry/spine_search_cgi/flake.nix" -#+HEADER: :noweb yes -#+BEGIN_SRC nix -{ - description = "a sisu like document parser search form"; - inputs = { - flake-utils.url = "github:numtide/flake-utils"; - nixpkgs.url = "<>"; - }; - outputs = { self, nixpkgs, flake-utils }: - let - pkgs = nixpkgs.legacyPackages.x86_64-linux; - in { - packages.x86_64-linux.spine = pkgs.stdenv.mkDerivation { - name = "spine_search"; - inherit self; - src = self; - shell = ./shell.nix; - installPhase = '' - install -m755 -D spine_search $out/share/cgi-bin/spine_search - ''; - }; - defaultPackage.x86_64-linux = self.packages.x86_64-linux.spine; - }; -} -#+END_SRC - -*** shell.nix :shell: - -#+HEADER: :tangle "../sundry/spine_search_cgi/shell.nix" -#+HEADER: :tangle-mode (identity #o755) -#+HEADER: :shebang "#!/usr/bin/env -S nix-shell --pure" -#+HEADER: :noweb yes -#+BEGIN_SRC nix -{ pkgs ? import {} }: -with pkgs; -mkShell { - buildInputs = [ - <> - <> - <> - <> - <> - ]; - shellHook = '' - if [[ -f ".envrc" ]]; then - source .envrc - fi - ''; -} -#+END_SRC - -*** default.nix :default: - -#+HEADER: :tangle "../sundry/spine_search_cgi/default.nix" -#+HEADER: :tangle-mode (identity #o755) -#+HEADER: :shebang "#!/usr/bin/env -S nix-build" -#+BEGIN_SRC nix -{ pkgs ? import {} }: -pkgs.callPackage ./derivation.nix {} -#+END_SRC - -*** derivation.nix :derivation: - -#+HEADER: :tangle "../sundry/spine_search_cgi/derivation.nix" -#+HEADER: :tangle-mode (identity #o644) -#+HEADER: :noweb yes -#+BEGIN_SRC nix -{ pkgs ? import {}, - stdenv ? pkgs.stdenv, - lib ? pkgs.lib, - ldc ? null, - dcompiler ? pkgs.ldc, - dub ? pkgs.dub -}: -assert dcompiler != null; -with ( - assert dcompiler != null; - with lib; - let - # Filter function to remove the .dub package folder from src - filterDub = name: type: let baseName = baseNameOf (toString name); in ! ( - type == "directory" && baseName == ".dub" - ); - targetOf = package: "${package.targetPath or "."}/${package.targetName or package.name}"; - # Remove reference to build tools and library sources - disallowedReferences = deps: [ dcompiler dub ]; - removeExpr = refs: ''remove-references-to ${lib.concatMapStrings (ref: " -t ${ref}") refs}''; - in { - mkDubDerivation = lib.makeOverridable ({ - src, - nativeBuildInputs ? [], - dubJSON ? src + "/dub.json", - passthru ? {}, - package ? lib.importJSON dubJSON, - ... - } @ attrs: stdenv.mkDerivation (attrs // { - pname = package.name; - nativeBuildInputs = [ dcompiler dub pkgs.removeReferencesTo ] ++ nativeBuildInputs; - disallowedReferences = disallowedReferences deps; - passthru = passthru // { - inherit dub dcompiler pkgs; - }; - src = lib.cleanSourceWith { - filter = filterDub; - src = lib.cleanSource src; - }; - preFixup = '' - find $out/share/cgi-bin -type f -exec ${removeExpr (disallowedReferences deps)} '{}' + || true - ''; - buildPhase = '' - runHook preBuild - export HOME=$PWD - for dc_ in dmd ldmd2 gdmd; do - echo "- check for D compiler $dc_" - dc=$(type -P $dc_ || echo "") - if [ ! "$dc" == "" ]; then - break - fi - done - if [ "$dc" == "" ]; then - exit "Error: could not find D compiler" - fi - echo "$dc_ used as D compiler to build $pname" - dub build --compiler=$dc --build=release --combined --skip-registry=all - runHook postBuild - ''; - checkPhase = '' - runHook preCheck - export HOME=$PWD - dub test --combined --skip-registry=all - runHook postCheck - ''; - installPhase = '' - runHook preInstall - mkdir -p $out/share/cgi-bin - cp -r "${targetOf package}" $out/share/cgi-bin - install -m755 -D $out/share/cgi-bin/spine_search spine_search - runHook postInstall - ''; - postInstall = '' - echo "HERE ${targetOf package} $out/share/cgi-bin" - echo `ls -la $out/share/cgi-bin/spine_search` - ''; - meta = lib.optionalAttrs (package ? description) { - description = package.description; - } // attrs.meta or {}; - } // lib.optionalAttrs (!(attrs ? version)) { - name = package.name; # use name from dub.json, unless pname and version are specified - })); - } -); -mkDubDerivation rec { - name = "spine-search-${version}"; - version = "<>"; - src = ./.; - buildInputs = [ - pkgs.sqlite ( - with pkgs; [ - nixVersions.unstable #nixFlakes - ## package manager - dub - ## compiler - ldc - rund - ## linker - #lld - #mold - ## builder - #ninja - sqlite - ] - ) - ]; - meta = with pkgs.lib; { - pname = "spine-search"; - version = "<>"; - homepage = "https://sisudoc.org"; - description = "cgi sqlite search form for document object search"; - longDescription = '' - A sisu like parser and document generator - ... - ''; - license = licenses.agpl3Plus; - platforms = platforms.linux; - maintainers = [ "RalphAmissah" ]; - }; -} -#+END_SRC - ** variables *** spine version SET VERSION :version:set:project: diff --git a/sundry/editor-syntax-etc/emacs/README b/sundry/editor-syntax-etc/emacs/README deleted file mode 100644 index 6dabf72..0000000 --- a/sundry/editor-syntax-etc/emacs/README +++ /dev/null @@ -1,4 +0,0 @@ -; put this into your .emacs file, then use the mode file: - -(load-file "~/emacs/el/sisu-spine-mode.el") -(add-to-list 'auto-mode-alist '("\\.sst$" . sisu-spine-mode)) diff --git a/sundry/editor-syntax-etc/emacs/sisu-spine-mode-autoloads.el b/sundry/editor-syntax-etc/emacs/sisu-spine-mode-autoloads.el deleted file mode 100644 index 4cc6332..0000000 --- a/sundry/editor-syntax-etc/emacs/sisu-spine-mode-autoloads.el +++ /dev/null @@ -1,10 +0,0 @@ -(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) -(autoload 'sisu-spine-mode "sisu-spine-mode" "\ -Major mode for editing SiSU (spine) markup files. -SiSU (https://www.sisudoc.org/) document structuring, publishing -and search. - -\(fn)" t nil) -(add-to-list 'auto-mode-alist '("\\.sst\\'" . sisu-spine-mode)) -(add-to-list 'auto-mode-alist '("\\.ssm\\'" . sisu-spine-mode)) -(add-to-list 'auto-mode-alist '("\\.ssi\\'" . sisu-spine-mode)) diff --git a/sundry/editor-syntax-etc/emacs/sisu-spine-mode.el b/sundry/editor-syntax-etc/emacs/sisu-spine-mode.el deleted file mode 100644 index 773fa5c..0000000 --- a/sundry/editor-syntax-etc/emacs/sisu-spine-mode.el +++ /dev/null @@ -1,493 +0,0 @@ -;;; sisu-spine-mode.el --- Major mode for SiSU (spine parser) markup text - -;; Copyright (C) 2011, 2021 Free Software Foundation, Inc. - -;; Author: Ralph Amissah & Ambrose Kofi Laing -;; Maintainer: Ralph Amissah -;; Keywords: text, syntax, processes, tools -;; Version: 8.0.0 -;; URL: https://www.sisudoc.org/ -;; originally looked at (based on) doc-mode, with kind permission of the author -;; Author: SUN, Tong , (c)2001-6, all right reserved -;; Version: $Date: 2006/01/19 03:13:41 $ $Revision: 1.14 $ -;; Home URL: https://xpt.sourceforge.net/ -;; with contributions from Kevin Ryde and Stefan Monnier - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;; Viva Software Libre! -;; Support the free software movement! -;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;; Commentary: - -;; SiSU (https://www.sisudoc.org/) is a document structuring and -;; publishing framework. This package provides an Emacs major mode -;; for SiSU markup, as used by the spine parser (in D) which has a different -;; header (based on yaml) from the original sisu parser (in Ruby) which has -;; bespoke headers. - -;; When this package is installed, files ending in ".sst" are automatically -;; associated with sisu-spine-mode. If a file doesn't have a -;; .sst extension, add a first line: -;; # -*- sisuSpine -*- - -;; The documentation for the "Structure Of The Hierarchy Text" can be -;; found in the sisustring for the sisu-spine-mode function. - -;;; Code: - -;; Variables: - -(defgroup sisu-faces nil - "AsciiSisu highlighting" - :group 'sisus) - -;; == Colors -; color n is more prominent than color n+1 - -(defface sisu-title-1-face - `((((class color) - (background dark)) - (:foreground "brown3" :bold t :height 1.2 :inherit variable-pitch)) - (((class color) - (background light)) - (:foreground "brown3" :bold t :height 1.2 :inherit variable-pitch)) - (t (:weight bold :inherit variable-pitch))) - "Face for AsciiSisu titles at level 1." - :group 'sisu-faces) - -(defface sisu-title-2-face - `((((class color) - (background dark)) - (:foreground "yellow4" :bold t :height 1.1 :inherit variable-pitch)) - (((class color) - (background light)) - (:foreground "yellow4" :bold t :height 1.1 :inherit variable-pitch)) - (t (:weight bold :inherit variable-pitch))) - "Face for AsciiSisu titles at level 2." - :group 'sisu-faces) - -(defface sisu-title-3-face - `((((class color) - (background dark)) - (:foreground "sienna3" :bold t)) - (((class color) - (background light)) - (:foreground "sienna3" :bold t)) - (t (:weight bold))) - "Face for AsciiSisu titles at level 3." - :group 'sisu-faces) - -(defface sisu-title-4-face - `((((class color) - (background dark)) - (:foreground "burlywood3")) - (((class color) - (background light)) - (:foreground "burlywood3")) - (t ())) - "Face for AsciiSisu titles at level 4." - :group 'sisu-faces) - -(defface info-node - '((((class color) (background light)) (:foreground "brown" :bold t :italic t)) - (((class color) (background dark)) (:foreground "white" :bold t :italic t)) - (t (:bold t :italic t))) - "Face for Info node names." - :group 'sisu-faces) - -(defvar sisu-title-1 'sisu-title-1-face) -(defvar sisu-title-2 'sisu-title-2-face) -(defvar sisu-title-3 'sisu-title-3-face) -(defvar sisu-title-4 'sisu-title-4-face) - -(defvar sisu-general-font-lock-red1 font-lock-warning-face) -(defvar sisu-general-font-lock-red2 font-lock-comment-face) -(defvar sisu-general-font-lock-red3 font-lock-string-face) - -(defvar sisu-general-font-lock-green1 font-lock-type-face) -(defvar sisu-general-font-lock-green2 font-lock-constant-face) - -(defvar sisu-general-font-lock-blue1 font-lock-keyword-face) -(defvar sisu-general-font-lock-blue2 font-lock-function-name-face) -(defvar sisu-general-font-lock-blue3 font-lock-builtin-face) - -(defvar sisu-general-font-lock-yellow1 font-lock-variable-name-face) -(defvar sisu-general-font-lock-yellow2 font-lock-comment-face) - -;; == sisu-spine-mode settings - -(defvar sisu-spine-mode-hook nil - "Normal hook run when entering Sisu Text mode.") - -(defvar sisu-spine-mode-abbrev-table nil - "Abbrev table in use in Sisu-spine-mode buffers.") -(define-abbrev-table 'sisu-spine-mode-abbrev-table ()) - -(defconst sisu-font-lock-keywords - (eval-when-compile - (list - ;;grouped text --------- - ;(cons "^```[ ]code\\(.\\|\n\\)+?\n```\n" 'sisu-general-font-lock-red2) - (cons "^```[ ]+code.*?$\\|^```$" 'sisu-general-font-lock-red2) - (cons "^```[ ]+table.*?$\\|^```$" 'sisu-general-font-lock-red2) - (cons "^```[ ]+group$\\|^```$" 'sisu-general-font-lock-red2) - (cons "^```[ ]+block$\\|^```$" 'sisu-general-font-lock-red2) - (cons "^```[ ]+poem$\\|^```$" 'sisu-general-font-lock-red2) - (cons "^```[ ]+alt$\\|^```$" 'sisu-general-font-lock-red2) - ;;grouped text --------- - (cons "^group{\\|^}group" 'sisu-general-font-lock-red2) - (cons "^block{\\|^}block" 'sisu-general-font-lock-red2) - (cons "^code{\\|^}code" 'sisu-general-font-lock-red2) - (cons "^poem{\\|^}poem" 'sisu-general-font-lock-red2) - (cons "^alt{\\|^}alt" 'sisu-general-font-lock-red2) - (cons "^table{.+\\|^}table" 'sisu-general-font-lock-red2) - (cons "^{table[^}]+}" 'sisu-general-font-lock-red2) - - (list - (concat - "^\`\\{3\\}[ ]+code.*?$" - "\\(.\\|\n\\)+?" - "\`\\{3\\}$" - ) - '(1 sisu-general-font-lock-red2 t) - '(2 nil t) - '(3 sisu-general-font-lock-red2 t) - ) - (list - (concat - "^\`\\{3\\}[ ]+table.*?$" - "\\(.\\|\n\\)+?" - "\`\\{3\\}$" - ) - '(1 sisu-general-font-lock-red2 t) - '(2 nil t) - '(3 sisu-general-font-lock-red2 t) - ) - (list - (concat - "^\`\\{3\\}[ ]+\\(group\\|block\\|alt\\|poem\\)$" - "\\(.\\|\n\\)+?" - "^\`\\{3\\}$" - ) - '(1 sisu-general-font-lock-red2 t) - '(2 nil t) - '(3 sisu-general-font-lock-red2 t) - ) - - ;; footnote/endnote ---- - ;(cons "\~{.+?}\~" 'sisu-general-font-lock-green1) - (cons "\~{\\*\\*\\|\~{\\*\\|\~{\\|}\~" 'sisu-general-font-lock-red2) - (cons "\~\\[\\+\\|\~\\[\\*\\|\~\\[\\|\\]\~" 'sisu-general-font-lock-red2) - (cons "\~\\^ \\|^\\^\~ " 'sisu-general-font-lock-red2) - (list - (concat - "\\(\*\~\\)" - "\\([^ \r\t\n]+\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-blue2 t) - ) - - ;; emphasis (can be program configured to be bold italics or underscore) - (list - (concat - "\\([*]{\\)" - "\\([^}]+\\)" - "\\(}[*]\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; bold ---------------- - (list - (concat - "\\([!]{\\)" - "\\([^}]+\\)" - "\\(}[!]\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - (cons "\\*[^ ]+\\*" 'sisu-general-font-lock-red1) - (cons "^!_ .+" 'sisu-general-font-lock-red1) - - ;; italics ------------- - (list - (concat - "\\([/]{\\)" - "\\([^}]+\\)" - "\\(}[/]\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-blue1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; underscore ---------- - (list - (concat - "\\([_]{\\)" - "\\([^}]+\\)" - "\\(\}[_]\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; monospace ----------- - (list - (concat - "\\([#]{\\)" - "\\([^}]+\\)" - "\\(}[#]\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; citation ------------ - (list - (concat - "\\([\"]{\\)" - "\\([^}]+\\)" - "\\(}[\"]\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; inserted text ------- - (list - (concat - "\\([\+]{\\)" - "\\([^}]+\\)" - "\\(}[\+]\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; strike through ------ - (list - (concat - "\\(\\-{\\)" - "\\([^}]+\\)" - "\\(}\\-\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; superscript --------- - (list - (concat - "\\(\\^{\\)" - "\\([^}]+\\)" - "\\(}\\^\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; subscript ----------- - (list - (concat - "\\([,]{\\)" - "\\([^}]+\\)" - "\\(}[,]\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; numbered list - (cons "^# \\|^_# " 'sisu-general-font-lock-red1) - - ;; bullet text - (cons "^_\\*[1-9] \\|^_\\* " 'sisu-general-font-lock-red1) - - ;; indented text - (cons "^_[1-9] " 'sisu-general-font-lock-red1) - (cons "^_[1-9]! " 'sisu-general-font-lock-red1) - - ;; hanging indented text [proposed enable when implemented] - (cons "^__[1-9] " 'sisu-general-font-lock-red1) - (cons "^_[0-9]_[0-9] " 'sisu-general-font-lock-red1) - (cons "^__[1-9]! " 'sisu-general-font-lock-red1) - (cons "^_[0-9]_[0-9]! " 'sisu-general-font-lock-red1) - - ;; url - (cons "\\(^\\|[ ]\\)https?:[/][/][^ \t\n\r<]+" 'sisu-general-font-lock-blue2) - - ;; Comment Lines - (cons "^% .*" 'sisu-general-font-lock-blue1) - - ;; page break - (cons "^\\(-\\\\\\\\-\\|=\\\\\\\\=\\|-\\.\\.-\\)" 'sisu-general-font-lock-red2) - - ;; line break - (cons " \\\\\\\\ " 'sisu-general-font-lock-red1) - - ;; line break (depreciated) - (cons "
" 'sisu-general-font-lock-red1) - - ;; Section titles - (list "^\\(\\([1-4]\\|:?[A-D]\\)\\~\\)\\(.*\\)" - '(1 sisu-title-1 t) - '(3 sisu-title-2 t) - ) - - ;; hyper-links - (list - (concat - "\\({~^\\|{\\)" - "\\([^}{]+\\)" - "\\(}https?:[/][/][^ \r\n\t<]+\\)" - ) - '(1 sisu-general-font-lock-blue2 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-blue2 t) - ) - - ;; book index - (list - (concat - "^\\(\={\\)" - "\\([^}{]+\\)" - "\\(}\\)$" - ) - '(1 sisu-general-font-lock-green1 t) - '(2 nil t) - '(3 sisu-general-font-lock-green1 t) - ) - - ;(cons "^\={.+}" 'sisu-general-font-lock-green1) - - ;; numbers - (cons "\\<[.0-9]+\\>" 'sisu-general-font-lock-green2) - - ;; bullets sisu_normal (nearly copied regexp) - (cons "^_\\([1-9*]\\|[1-9]\\*\\) " 'sisu-general-font-lock-blue2) - - ;; image links - (list - (concat - "\\({\\)" - "\\([^}{]+\\)" - "\\(}image\\)" - ) - '(1 sisu-general-font-lock-blue2 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-blue2 t) - ) - - ;; insert file links - (list - (concat - "\\(<< \\)" - "\\([^ \r\t\n]+\\.ss\\)" - "\\(i\\|t\\)" - ) - '(1 sisu-general-font-lock-blue2 t) - '(2 sisu-general-font-lock-blue2 t) - '(3 sisu-general-font-lock-blue2 t) - ) - - ;; raw keywords - (list - (concat - "^\\(\\(" - "creator\\|" - "title\\|" - "date\\|" - "rights\\|" - "publisher\\|" - "classify\\|" - "identifier\\|" - "original\\|" - "notes\\|" - "links\\|" - "make\\|" - "\\):\\)\\(.*\\)" - ) - '(1 sisu-title-2 keep) - '(3 sisu-title-3 keep) - ) - ) - ) - "Default expressions to highlight in AsciiSisu mode." -) - -;; outline mode evil "folding" if available -;; (define-key evil-normal-state-map ",0" 'show-all) -;; (define-key evil-normal-state-map ",-" 'hide-body) -;; (define-key evil-normal-state-map ",+" 'show-subtree) -;; (define-key evil-normal-state-map ",=" 'show-subtree) - -;; - -;; Sisu & Autoload: - -;;;###autoload -(define-derived-mode sisu-spine-mode text-mode "SiSU" - "Major mode for editing SiSU files. -SiSU document structuring, publishing in multiple formats and search. -URL `https://www.sisudoc.org/'" - (modify-syntax-entry ?\' ".") - ;;(flyspell-mode nil) - - (make-local-variable 'paragraph-start) - (setq paragraph-start (concat "$\\|>" page-delimiter)) - (make-local-variable 'paragraph-separate) - (setq paragraph-separate paragraph-start) - (make-local-variable 'paragraph-ignore-fill-prefix) - (setq paragraph-ignore-fill-prefix t) - - (set (make-local-variable 'outline-regexp) - "^\\(\\([1-4]\\|:?[A-D]\\)\\~\\|\\@[a-z]+:\\( \\|$\\)\\)") - - (make-local-variable 'require-final-newline) - (setq require-final-newline t) - - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults - '(sisu-font-lock-keywords - nil ; KEYWORDS-ONLY: no - nil ; CASE-FOLD: no - ((?_ . "w")) ; SYNTAX-ALIST - )) - ;; Enable outlining. - ;; TODO with outlining make sure linum (line numbering) is off, - ;; else performance penalty, sucks bigtime - (outline-minor-mode 1)) - -;;;###autoload (add-to-list 'auto-mode-alist '("\\.ss[imt]\\'" . sisu-spine-mode)) - -(provide 'sisu-spine-mode) - -;; - -;;; sisu-spine-mode.el ends here diff --git a/sundry/editor-syntax-etc/vim/colors/def-sisu.vim b/sundry/editor-syntax-etc/vim/colors/def-sisu.vim deleted file mode 100644 index ac3e0c3..0000000 --- a/sundry/editor-syntax-etc/vim/colors/def-sisu.vim +++ /dev/null @@ -1,223 +0,0 @@ -" Vim color file -" Name: def-sisu -" Maintainer: Ralph Amissah -" Last Change: 2013-02-14 -" URL: -" Note: primarily 16 color cterm improved by tweaking of .Xdefaults -" (with occasional other colors selected from 256 color palate) -" .Xdefaults tweaking to make identical to def (256) provided, -" along with an alternative possibility using colors beyond -" 256 color palate -:hi clear -if exists("syntax_on") - syntax reset -endif -:set t_Co=256 -:set background=dark -:let colors_name = "def-sisu" -" ------- -" terminal def -" ------- -:hi Normal ctermbg=0 ctermfg=7 -":hi Cursor ctermbg=5 ctermfg=0 -:hi lCursor cterm=reverse -:hi StatusLine cterm=bold,reverse -:hi StatusLineNC cterm=reverse -:hi Search cterm=none ctermbg=57 ctermfg=0 -:hi IncSearch cterm=none ctermbg=154 ctermfg=0 -:hi SpecialKey ctermfg=4 -:hi Visual cterm=reverse -:hi VisualNOS cterm=bold,underline -:hi MoreMsg ctermfg=2 -:hi ModeMsg cterm=bold -:hi Question ctermfg=2 -:hi Title cterm=bold ctermfg=3 -:hi NonText cterm=bold ctermfg=4 -:hi LineNr cterm=bold ctermbg=0 ctermfg=0* -:hi CursorLineNr cterm=bold ctermbg=166 ctermfg=0 -:hi Directory ctermfg=4 -:hi WildMenu ctermbg=3 ctermfg=0 -:hi VertSplit cterm=reverse -:hi Folded cterm=none ctermbg=0 ctermfg=8 -:hi FoldColumn ctermbg=7 ctermfg=4 -:hi DiffAdd cterm=none ctermbg=2 ctermfg=0 -:hi DiffChange cterm=none ctermbg=7 ctermfg=0 -:hi DiffDelete cterm=none ctermbg=7 ctermfg=0 -:hi DiffText cterm=none ctermbg=6 ctermfg=0 -:hi String cterm=none ctermfg=3 -:hi Comment cterm=none ctermbg=0 ctermfg=4 -:hi Constant ctermfg=1 -:hi Special ctermfg=6 -:hi Identifier ctermfg=6 -:hi Statement ctermfg=6 -:hi Operator ctermfg=1 -:hi PreProc ctermbg=7 ctermfg=1 -:hi Type ctermfg=2 -:hi Delimiter cterm=none ctermfg=1 -:hi Ignore cterm=bold ctermfg=7 -:hi Todo ctermbg=3 ctermfg=0 -:hi Underlined cterm=underline -:hi Include ctermfg=1 -:hi Define ctermfg=3 -:hi Function ctermfg=6 -:hi Structure ctermfg=2 -:hi MatchParen cterm=bold ctermbg=4 ctermfg=7 -:hi CursorLine cterm=bold -:hi CursorColumn ctermbg=17 -:hi ColorColumn ctermbg=17 -:hi SpellBad cterm=underline ctermbg=0 ctermfg=5 -:hi SpellCap cterm=underline ctermbg=0 ctermfg=5 -:hi SpellLocal cterm=underline ctermbg=0 ctermfg=5 -:hi SpellRare cterm=underline ctermbg=0 ctermfg=5 -:hi TrailingWhitespace ctermbg=1 -:hi ExtraWhitespace ctermbg=1 -:hi WarningMsg ctermfg=1 -:hi ErrorMsg cterm=bold ctermbg=1 ctermfg=7 -:hi Error cterm=bold ctermbg=1 ctermfg=7 -" ------- -" gui def -" ------- -:hi Normal guibg=#000000 guifg=#D3D3D3 -:hi Cursor guibg=#CC9966 guifg=#000000 -:hi lCursor gui=reverse -:hi StatusLine gui=bold,reverse -:hi StatusLineNC gui=reverse -:hi Search gui=none guibg=#5F00FF guifg=#000000 -:hi IncSearch gui=none guibg=#AFFF00 guifg=#000000 -:hi SpecialKey guifg=#5971AD -:hi Visual gui=reverse -:hi VisualNOS gui=bold,underline -:hi MoreMsg guifg=#4E9A06 -:hi ModeMsg gui=bold -:hi Question guifg=#4E9A06 -:hi Title gui=bold guifg=#C4A000 -:hi NonText gui=bold guifg=#5971AD -:hi LineNr gui=bold guibg=#000000 guifg=#808080 -:hi CursorLineNr gui=bold guibg=#D75F00 guifg=#000000 -:hi Directory guifg=#5971AD -:hi WildMenu guibg=#C4A000 guifg=#000000 -:hi VertSplit gui=reverse -:hi Folded gui=none guibg=#000000 guifg=#808080 -:hi FoldColumn guibg=#D3D3D3 guifg=#5971AD -:hi DiffAdd gui=none guibg=#4E9A06 guifg=#000000 -:hi DiffChange gui=none guibg=#D3D3D3 guifg=#000000 -:hi DiffDelete gui=none guibg=#D3D3D3 guifg=#000000 -:hi DiffText gui=none guibg=#06989A guifg=#000000 -:hi String gui=none guifg=#C4A000 -:hi Comment gui=none guibg=#000000 guifg=#5971AD -:hi Constant guifg=#CC0000 -:hi Special guifg=#06989A -:hi Identifier guifg=#06989A -:hi Statement guifg=#06989A -:hi Operator guifg=#CC0000 -:hi PreProc guibg=#D3D3D3 guifg=#CC0000 -:hi Type guifg=#4E9A06 -:hi Delimiter gui=none guifg=#CC0000 -:hi Ignore gui=bold guifg=#D3D3D3 -:hi Todo guibg=#C4A000 guifg=#000000 -:hi Underlined gui=underline -:hi Include guifg=#CC0000 -:hi Define guifg=#C4A000 -:hi Function guifg=#06989A -:hi Structure guifg=#4E9A06 -:hi MatchParen gui=bold guibg=#5971AD guifg=#D3D3D3 -:hi CursorLine gui=bold -:hi CursorColumn guibg=#00005F -:hi ColorColumn guibg=#00005F -:hi SpellBad gui=underline guibg=#000000 guifg=#75507B -:hi SpellCap gui=underline guibg=#000000 guifg=#75507B -:hi SpellLocal gui=underline guibg=#000000 guifg=#75507B -:hi SpellRare gui=underline guibg=#000000 guifg=#75507B -:hi TrailingWhitespace guibg=#080000 -:hi ExtraWhitespace guibg=#CC0000 -:hi WarningMsg guifg=#CC0000 -:hi ErrorMsg gui=bold guibg=#CC0000 guifg=#D3D3D3 -:hi Error gui=bold guibg=#CC0000 guifg=#D3D3D3 -" ------- -"256 color .Xdefaults vim: cterm giu -" -" -" ------- -" 256 color .Xdefaults vim: cterm giu def -" ------- -" 16 color standard altered 256 altered beyond 256 -" black/dark grey -" 0 [ 0:#000000] #000000 -" 8 [ 8:#808080] [59:#5F5F5F] #555555 -" red -" 1 [ 1:#800000] 160:#DF0000 #CC0000 -" 9 [ 9:#FF0000] #EF2929 -" green -" 2 [ 2:#008000] 112:#87DF00 #4E9A06 -" 10 [10:#00FF00] 154:#AFFF00 #8AE234 -" yellow/orange -" 3 [ 3:#808000] 178:#DFAF00 #C4A000 -" 11 [11:#FFFF00] 184:#DFDF00 #FC9E4F -" blue -" 4 [ 4:#000080] 24:#005F87 #5971AD -" 12 [12:#0000FF] 73:#5FAFAF #729FCF -" magenta -" 5 [ 5:#800080] 90:#870087 #75507B -" 13 [13:#FF00FF] 126:#AF0087 #AD7FA8 -" cyan -" 6 [ 6:#008080] 37:#00AFAF #06989A -" 14 [14:#00FFFF] 87:#5FFFFF #34E2E2 -" white -" 7 [ 7:#C0C0C0] #D3D3D3 -" 15 [15:#FFFFFF] #EEEEEE -" -------- -" .Xdefaults (rxvt urxvt setting beyond 256 colors, vim colorscheme "def" gui settings) -" (vim colorscheme "def" cterm matches "def" gui if .Xdefaults set thus) -" -------- -" ! black -" Rxvt.color0 : #000000 -" Rxvt.color8 : #555555 -" ! red -" Rxvt.color1 : #CC0000 -" Rxvt.color9 : #EF2929 -" ! green -" Rxvt.color2 : #4E9A06 -" Rxvt.color10 : #8AE234 -" ! yellow -" Rxvt.color3 : #C4A000 -" Rxvt.color11 : #FCE94F -" ! blue -" Rxvt.color4 : #5971AD -" Rxvt.color12 : #729FCF -" ! magenta -" Rxvt.color5 : #75507B -" Rxvt.color13 : #AD7FA8 -" ! cyan -" Rxvt.color6 : #06989A -" Rxvt.color14 : #34E2E2 -" ! white -" Rxvt.color7 : #D3D7CF -" Rxvt.color15 : #EEEEEE -" -------- -" .Xdefaults 256 (rxvt urxvt setting, vim colorscheme "def256" cterm & gui settings) -" (vim colorscheme "def" cterm matches "def256" if .Xdefaults set thus) -" -------- -" ! black -" Rxvt.color0 : #000000 -" Rxvt.color8 : #808080 -" ! red -" Rxvt.color1 : #DF0000 -" Rxvt.color9 : #FF0000 -" ! green -" Rxvt.color2 : #87DF00 -" Rxvt.color10 : #AFFF00 -" ! yellow -" Rxvt.color3 : #DFAF00 -" Rxvt.color11 : #FFFF00 -" ! blue -" Rxvt.color4 : #5F87DF -" Rxvt.color12 : #87DFFF -" ! magenta -" Rxvt.color5 : #8700DF -" Rxvt.color13 : #87DFFF -" ! cyan -" Rxvt.color6 : #00DFDF -" Rxvt.color14 : #5F5FDF -" ! white -" Rxvt.color7 : #C0C0C0 -" Rxvt.color15 : #FFFFFF diff --git a/sundry/editor-syntax-etc/vim/colors/def.vim b/sundry/editor-syntax-etc/vim/colors/def.vim deleted file mode 100644 index aca1975..0000000 --- a/sundry/editor-syntax-etc/vim/colors/def.vim +++ /dev/null @@ -1,223 +0,0 @@ -" Vim color file -" Name: def -" Maintainer: Ralph Amissah -" Last Change: 2013-02-14 -" URL: -" Note: primarily 16 color cterm improved by tweaking of .Xdefaults -" (with occasional other colors selected from 256 color palate) -" .Xdefaults tweaking to make identical to def (256) provided, -" along with an alternative possibility using colors beyond -" 256 color palate -:hi clear -if exists("syntax_on") - syntax reset -endif -:set t_Co=256 -:set background=dark -:let colors_name = "def" -" ------- -" terminal def -" ------- -:hi Normal ctermbg=0 ctermfg=7 -":hi Cursor ctermbg=5 ctermfg=0 -:hi lCursor cterm=reverse -:hi StatusLine cterm=bold,reverse -:hi StatusLineNC cterm=reverse -:hi Search cterm=none ctermbg=57 ctermfg=0 -:hi IncSearch cterm=none ctermbg=154 ctermfg=0 -:hi SpecialKey ctermfg=4 -:hi Visual cterm=reverse -:hi VisualNOS cterm=bold,underline -:hi MoreMsg ctermfg=2 -:hi ModeMsg cterm=bold -:hi Question ctermfg=2 -:hi Title cterm=bold ctermfg=3 -:hi NonText cterm=bold ctermfg=4 -:hi LineNr cterm=bold ctermbg=0 ctermfg=0* -:hi CursorLineNr cterm=bold ctermbg=166 ctermfg=0 -:hi Directory ctermfg=4 -:hi WildMenu ctermbg=3 ctermfg=0 -:hi VertSplit cterm=reverse -:hi Folded cterm=none ctermbg=0 ctermfg=8 -:hi FoldColumn ctermbg=7 ctermfg=4 -:hi DiffAdd cterm=none ctermbg=2 ctermfg=0 -:hi DiffChange cterm=none ctermbg=7 ctermfg=0 -:hi DiffDelete cterm=none ctermbg=7 ctermfg=0 -:hi DiffText cterm=none ctermbg=6 ctermfg=0 -:hi String cterm=none ctermfg=3 -:hi Comment cterm=none ctermbg=0 ctermfg=4 -:hi Constant ctermfg=1 -:hi Special ctermfg=6 -:hi Identifier ctermfg=6 -:hi Statement ctermfg=2 -:hi Operator ctermfg=2 -:hi PreProc ctermfg=1 -:hi Type cterm=bold ctermfg=3 -:hi Delimiter cterm=none ctermfg=2 -:hi Ignore cterm=bold ctermfg=7 -:hi Todo ctermbg=3 ctermfg=0 -:hi Underlined cterm=underline -:hi Include ctermfg=1 -:hi Define ctermfg=3 -:hi Function ctermfg=6 -:hi Structure ctermfg=2 -:hi MatchParen cterm=bold ctermbg=4 ctermfg=7 -:hi CursorLine cterm=bold -:hi CursorColumn ctermbg=17 -:hi ColorColumn ctermbg=17 -:hi SpellBad cterm=underline ctermbg=0 ctermfg=5 -:hi SpellCap cterm=underline ctermbg=0 ctermfg=5 -:hi SpellLocal cterm=underline ctermbg=0 ctermfg=5 -:hi SpellRare cterm=underline ctermbg=0 ctermfg=5 -:hi TrailingWhitespace ctermbg=1 -:hi ExtraWhitespace ctermbg=1 -:hi WarningMsg ctermfg=1 -:hi ErrorMsg cterm=bold ctermbg=1 ctermfg=7 -:hi Error cterm=bold ctermbg=1 ctermfg=7 -" ------- -" gui def -" ------- -:hi Normal guibg=#000000 guifg=#D3D3D3 -:hi Cursor guibg=#CC9966 guifg=#000000 -:hi lCursor gui=reverse -:hi StatusLine gui=bold,reverse -:hi StatusLineNC gui=reverse -:hi Search gui=none guibg=#5F00FF guifg=#000000 -:hi IncSearch gui=none guibg=#AFFF00 guifg=#000000 -:hi SpecialKey guifg=#5971AD -:hi Visual gui=reverse -:hi VisualNOS gui=bold,underline -:hi MoreMsg guifg=#4E9A06 -:hi ModeMsg gui=bold -:hi Question guifg=#4E9A06 -:hi Title gui=bold guifg=#C4A000 -:hi NonText gui=bold guifg=#5971AD -:hi LineNr gui=bold guibg=#000000 guifg=#808080 -:hi CursorLineNr gui=bold guibg=#D75F00 guifg=#000000 -:hi Directory guifg=#5971AD -:hi WildMenu guibg=#C4A000 guifg=#000000 -:hi VertSplit gui=reverse -:hi Folded gui=none guibg=#000000 guifg=#808080 -:hi FoldColumn guibg=#D3D3D3 guifg=#5971AD -:hi DiffAdd gui=none guibg=#4E9A06 guifg=#000000 -:hi DiffChange gui=none guibg=#D3D3D3 guifg=#000000 -:hi DiffDelete gui=none guibg=#D3D3D3 guifg=#000000 -:hi DiffText gui=none guibg=#06989A guifg=#000000 -:hi String gui=none guifg=#C4A000 -:hi Comment gui=none guibg=#000000 guifg=#5971AD -:hi Constant guifg=#CC0000 -:hi Special guifg=#06989A -:hi Identifier guifg=#06989A -:hi Statement guifg=#4E9A06 -:hi Operator guifg=#4E9A06 -:hi PreProc guifg=#CC0000 -:hi Type gui=bold guifg=#C4A000 -:hi Delimiter gui=none guifg=#4E9A06 -:hi Ignore gui=bold guifg=#D3D3D3 -:hi Todo guibg=#C4A000 guifg=#000000 -:hi Underlined gui=underline -:hi Include guifg=#CC0000 -:hi Define guifg=#C4A000 -:hi Function guifg=#06989A -:hi Structure guifg=#4E9A06 -:hi MatchParen gui=bold guibg=#5971AD guifg=#D3D3D3 -:hi CursorLine gui=bold -:hi CursorColumn guibg=#00005F -:hi ColorColumn guibg=#00005F -:hi SpellBad gui=underline guibg=#000000 guifg=#75507B -:hi SpellCap gui=underline guibg=#000000 guifg=#75507B -:hi SpellLocal gui=underline guibg=#000000 guifg=#75507B -:hi SpellRare gui=underline guibg=#000000 guifg=#75507B -:hi TrailingWhitespace guibg=#080000 -:hi ExtraWhitespace guibg=#CC0000 -:hi WarningMsg guifg=#CC0000 -:hi ErrorMsg gui=bold guibg=#CC0000 guifg=#D3D3D3 -:hi Error gui=bold guibg=#CC0000 guifg=#D3D3D3 -" ------- -"256 color .Xdefaults vim: cterm giu -" -" -" ------- -" 256 color .Xdefaults vim: cterm giu def -" ------- -" 16 color standard altered 256 altered beyond 256 -" black/dark grey -" 0 [ 0:#000000] #000000 -" 8 [ 8:#808080] [59:#5F5F5F] #555555 -" red -" 1 [ 1:#800000] 160:#DF0000 #CC0000 -" 9 [ 9:#FF0000] #EF2929 -" green -" 2 [ 2:#008000] 112:#87DF00 #4E9A06 -" 10 [10:#00FF00] 154:#AFFF00 #8AE234 -" yellow/orange -" 3 [ 3:#808000] 178:#DFAF00 #C4A000 -" 11 [11:#FFFF00] 184:#DFDF00 #FC9E4F -" blue -" 4 [ 4:#000080] 24:#005F87 #5971AD -" 12 [12:#0000FF] 73:#5FAFAF #729FCF -" magenta -" 5 [ 5:#800080] 90:#870087 #75507B -" 13 [13:#FF00FF] 126:#AF0087 #AD7FA8 -" cyan -" 6 [ 6:#008080] 37:#00AFAF #06989A -" 14 [14:#00FFFF] 87:#5FFFFF #34E2E2 -" white -" 7 [ 7:#C0C0C0] #D3D3D3 -" 15 [15:#FFFFFF] #EEEEEE -" -------- -" .Xdefaults (rxvt urxvt setting beyond 256 colors, vim colorscheme "def" gui settings) -" (vim colorscheme "def" cterm matches "def" gui if .Xdefaults set thus) -" -------- -" ! black -" Rxvt.color0 : #000000 -" Rxvt.color8 : #555555 -" ! red -" Rxvt.color1 : #CC0000 -" Rxvt.color9 : #EF2929 -" ! green -" Rxvt.color2 : #4E9A06 -" Rxvt.color10 : #8AE234 -" ! yellow -" Rxvt.color3 : #C4A000 -" Rxvt.color11 : #FCE94F -" ! blue -" Rxvt.color4 : #5971AD -" Rxvt.color12 : #729FCF -" ! magenta -" Rxvt.color5 : #75507B -" Rxvt.color13 : #AD7FA8 -" ! cyan -" Rxvt.color6 : #06989A -" Rxvt.color14 : #34E2E2 -" ! white -" Rxvt.color7 : #D3D7CF -" Rxvt.color15 : #EEEEEE -" -------- -" .Xdefaults 256 (rxvt urxvt setting, vim colorscheme "def256" cterm & gui settings) -" (vim colorscheme "def" cterm matches "def256" if .Xdefaults set thus) -" -------- -" ! black -" Rxvt.color0 : #000000 -" Rxvt.color8 : #808080 -" ! red -" Rxvt.color1 : #DF0000 -" Rxvt.color9 : #FF0000 -" ! green -" Rxvt.color2 : #87DF00 -" Rxvt.color10 : #AFFF00 -" ! yellow -" Rxvt.color3 : #DFAF00 -" Rxvt.color11 : #FFFF00 -" ! blue -" Rxvt.color4 : #5F87DF -" Rxvt.color12 : #87DFFF -" ! magenta -" Rxvt.color5 : #8700DF -" Rxvt.color13 : #87DFFF -" ! cyan -" Rxvt.color6 : #00DFDF -" Rxvt.color14 : #5F5FDF -" ! white -" Rxvt.color7 : #C0C0C0 -" Rxvt.color15 : #FFFFFF diff --git a/sundry/editor-syntax-etc/vim/colors/frugal-cterm-sisu.vim b/sundry/editor-syntax-etc/vim/colors/frugal-cterm-sisu.vim deleted file mode 100644 index aae822d..0000000 --- a/sundry/editor-syntax-etc/vim/colors/frugal-cterm-sisu.vim +++ /dev/null @@ -1,66 +0,0 @@ -" Vim color file -" Name: frugal-cterm-sisu -" Maintainer: Ralph Amissah -" Last Change: 2013-02-09 -" URL: -" Note: 8 color cterm, related colorschemes 8 & sparse -:set background=dark -:hi clear -if exists("syntax_on") - syntax reset -endif -:let colors_name = "frugal-cterm-sisu" -" 0 = black, 1 = red, 2 = green, 3 = yellow/orange, 4 = blue, 5 = magenta, 6 = cyan, 7 = white -:hi Normal ctermbg=0 ctermfg=7 -:hi Cursor cterm=reverse -:hi lCursor cterm=reverse -:hi StatusLine cterm=bold,reverse -:hi StatusLineNC cterm=reverse -:hi Search cterm=none ctermbg=2 ctermfg=0 -:hi IncSearch cterm=bold ctermbg=2 ctermfg=7 -:hi SpecialKey ctermfg=4 -:hi Visual cterm=reverse -:hi VisualNOS cterm=bold,underline -:hi MoreMsg ctermfg=2 -:hi ModeMsg cterm=bold -:hi Question ctermfg=2 -:hi Title cterm=bold ctermfg=3 -:hi NonText cterm=bold ctermfg=4 -:hi LineNr cterm=bold ctermbg=0 ctermfg=0* -:hi Directory ctermfg=4 -:hi WildMenu ctermbg=3 ctermfg=0 -:hi VertSplit cterm=reverse -:hi Folded cterm=none ctermbg=0 ctermfg=7 -:hi FoldColumn ctermbg=7 ctermfg=4 -:hi DiffChange cterm=none ctermbg=7 ctermfg=0 -:hi DiffText cterm=none ctermbg=6 ctermfg=0 -:hi DiffAdd cterm=none ctermbg=2 ctermfg=0 -:hi DiffDelete cterm=none ctermbg=7 ctermfg=0 -:hi String cterm=none ctermfg=3 -:hi Comment cterm=none ctermbg=0 ctermfg=7 -:hi Constant ctermfg=1 -:hi Special ctermfg=6 -:hi Identifier ctermfg=6 -:hi Statement ctermfg=6 -:hi Operator ctermfg=1 -:hi PreProc ctermbg=7 ctermfg=1 -:hi Type ctermfg=2 -:hi Delimiter cterm=none ctermfg=1 -:hi Ignore cterm=bold ctermfg=7 -:hi Todo ctermbg=3 ctermfg=0 -:hi Underlined cterm=underline -:hi Include ctermfg=1 -:hi Define ctermfg=3 -:hi Function ctermfg=6 -:hi Structure ctermfg=2 -:hi MatchParen cterm=bold ctermbg=4 ctermfg=7 -:hi CursorLine cterm=bold,underline -:hi CursorColumn cterm=bold -:hi ColorColumn ctermbg=8 -:hi SpellBad cterm=none ctermbg=7 ctermfg=0 -:hi SpellCap cterm=none ctermbg=7 ctermfg=0 -:hi SpellLocal cterm=none ctermbg=7 ctermfg=0 -:hi SpellRare cterm=none ctermbg=7 ctermfg=0 -:hi WarningMsg ctermfg=1 -:hi ErrorMsg cterm=bold ctermbg=1 ctermfg=7 -:hi Error cterm=bold ctermbg=1 ctermfg=7 diff --git a/sundry/editor-syntax-etc/vim/colors/slate.vim b/sundry/editor-syntax-etc/vim/colors/slate.vim deleted file mode 100644 index 4d741e8..0000000 --- a/sundry/editor-syntax-etc/vim/colors/slate.vim +++ /dev/null @@ -1,75 +0,0 @@ -"%% SiSU Vim color file -" Name: Slate -" Maintainer: Ralph Amissah -" Last Change: 2013-02-09 -" URL: -" Notes: cterm now uses frugal-sisu 8 colors for term -" (for gui originally looked at desert Hans Fugal -" (April/May 2003)) -:set background=dark -:hi clear -if exists("syntax_on") - syntax reset -endif -:let colors_name = "slate" -" 0 = black, 1 = red, 2 = green, 3 = yellow/orange, 4 = blue, 5 = magenta, 6 = cyan, 7 = white -:hi Normal ctermbg=0 ctermfg=7 guibg=grey15 guifg=white -:hi Cursor term=reverse cterm=reverse guibg=khaki guifg=slategrey -:hi lCursor term=reverse cterm=reverse -:hi StatusLine term=reverse cterm=bold,reverse gui=none guibg=#c2bfa5 guifg=black -:hi StatusLineNC term=reverse cterm=reverse gui=none guibg=#c2bfa5 guifg=grey40 -:hi Search term=reverse cterm=none ctermbg=2 ctermfg=0 guibg=peru guifg=wheat -:hi IncSearch term=reverse cterm=bold ctermbg=2 ctermfg=7 guibg=black guifg=green -:hi SpecialKey term=bold ctermfg=4 guifg=yellowgreen -:hi Visual term=reverse cterm=reverse gui=none guibg=olivedrab guifg=khaki -:hi VisualNOS term=bold,underline cterm=bold,underline -:hi MoreMsg term=bold ctermfg=2 guifg=SeaGreen -:hi ModeMsg term=bold cterm=bold guifg=goldenrod -:hi Question term=standout ctermfg=2 guifg=springgreen -:hi Title term=bold cterm=bold ctermfg=3 gui=bold guifg=gold -:hi NonText term=bold cterm=bold ctermfg=4 guibg=grey15 guifg=RoyalBlue -:hi LineNr term=underline cterm=bold ctermbg=0 ctermfg=0* guifg=grey50 -:hi Directory term=bold ctermfg=4 -:hi WildMenu term=standout ctermbg=3 ctermfg=0 guibg=darkyellow guifg=black -:hi VertSplit term=reverse cterm=reverse gui=none guibg=#c2bfa5 guifg=grey40 -:hi Folded term=standout cterm=none ctermbg=0 ctermfg=7 guibg=black guifg=grey40 -:hi FoldColumn term=standout ctermbg=7 ctermfg=4 guibg=black guifg=grey20 -:hi DiffChange cterm=none ctermbg=7 ctermfg=0 guibg=darkgrey guifg=white -:hi DiffText cterm=none ctermbg=6 ctermfg=0 guibg=darkcyan guifg=white -:hi DiffAdd cterm=none ctermbg=2 ctermfg=0 guibg=darkgreen guifg=white -:hi DiffDelete cterm=none ctermbg=7 ctermfg=0 guibg=darkgrey guifg=black -:hi String cterm=none ctermfg=3 guifg=SkyBlue -:hi Comment term=bold cterm=none ctermbg=0 ctermfg=7 guifg=grey40 -:hi Constant term=underline ctermfg=1 guifg=#ffa0a0 -:hi Special term=bold ctermfg=6 guifg=darkkhaki -:hi Identifier term=underline ctermfg=6 guifg=salmon -:hi Statement term=bold ctermfg=6 guifg=CornflowerBlue -:hi Operator term=bold ctermfg=1 guifg=red -:hi PreProc term=underline ctermbg=7 ctermfg=1 guibg=white guifg=red -:hi Type term=underline ctermfg=2 guifg=CornflowerBlue -:hi Delimiter term=none cterm=none ctermfg=1 -:hi Ignore cterm=bold ctermfg=7 guifg=grey40 -:hi Todo term=standout ctermbg=3 ctermfg=0 guibg=yellow2 guifg=orangered -:hi Underlined term=underline cterm=underline -:hi Include ctermfg=1 guifg=red -:hi Define ctermfg=3 gui=bold guifg=gold -:hi Function ctermfg=6 guifg=navajowhite -:hi Structure ctermfg=2 guifg=green -:hi MatchParen cterm=bold ctermbg=4 ctermfg=7 -:hi CursorLine cterm=bold,underline guibg=black -:hi CursorColumn cterm=bold guibg=black -:hi SpellBad term=underline,standout cterm=none ctermbg=7 ctermfg=0 guibg=darkmagenta guifg=white -:hi SpellCap term=underline,standout cterm=none ctermbg=7 ctermfg=0 -:hi SpellLocal term=underline,standout cterm=none ctermbg=7 ctermfg=0 guibg=darkmagenta guifg=white -:hi SpellRare term=underline,standout cterm=none ctermbg=7 ctermfg=0 -:hi WarningMsg term=standout ctermfg=1 guibg=darkmagenta guifg=salmon -:hi ErrorMsg term=standout cterm=bold ctermbg=1 ctermfg=7 guibg=darkmagenta guifg=white -:hi Error term=reverse cterm=bold ctermbg=1 ctermfg=7 guibg=darkmagenta guifg=white -:hi Black ctermbg=grey ctermfg=black guibg=grey guifg=black -:hi Red ctermbg=black ctermfg=red guibg=black guifg=red -:hi Magenta ctermbg=black ctermfg=magenta guibg=black guifg=magenta -:hi Blue ctermbg=black ctermfg=blue guibg=black guifg=blue -:hi Cyan ctermbg=black ctermfg=cyan guibg=black guifg=cyan -:hi Green ctermbg=black ctermfg=green guibg=black guifg=green -:hi Yellow ctermbg=black ctermfg=yellow guibg=black guifg=yellow -:hi White ctermbg=black ctermfg=white guibg=black guifg=white diff --git a/sundry/editor-syntax-etc/vim/filetype.vim b/sundry/editor-syntax-etc/vim/filetype.vim deleted file mode 100644 index 917c3e0..0000000 --- a/sundry/editor-syntax-etc/vim/filetype.vim +++ /dev/null @@ -1,8 +0,0 @@ -" SiSU filetype file -if exists("did_load_filetypes") - finish -endif -augroup filetypedetect - au! BufNewFile,BufRead *.sst,*.ssm,*.ssi,*.-sst setf sisu - au! BufNewFile,BufRead *._sst,*.sst.meta,*.-sst.meta,*._sst.meta setf sisu -augroup END diff --git a/sundry/editor-syntax-etc/vim/ftplugin/sisu.vim b/sundry/editor-syntax-etc/vim/ftplugin/sisu.vim deleted file mode 100644 index 43c7e53..0000000 --- a/sundry/editor-syntax-etc/vim/ftplugin/sisu.vim +++ /dev/null @@ -1,224 +0,0 @@ -"%% SiSU Vim ftplugin -" SiSU Maintainer: Ralph Amissah -" SiSU Markup: SiSU (sisu-3.3) 2012-08-18 -" an ftplugin setting defaults for editing sisu markup files -:syntax on -:filetype off -":filetype on -:filetype indent on -:autocmd FileType sisu :set nonumber -:set encoding=utf-8 fileencodings= -:set ff=unix -:set autowrite " Automatically save before commands like :next and :make -:set nocompatible -:set tabstop=2 -:set expandtab -:set shiftwidth=2 -:set autoindent -:set showcmd " Show (partial) command in status line. -:set showmatch " Show matching brackets. -:set ignorecase " Do case insensitive matching -:set smartcase -:set incsearch -:set hlsearch -:set gdefault -:set guioptions=agr " add 'm' for menu -:map :if &guioptions =~# 'm' - \set guioptions-=m - \set guioptions-=T - \else - \set guioptions+=m - \set guioptions-=T - \endif -:set paste -""% statusline -"set statusline= " -"set fillchars=stl:―,stlnc:—,vert:│,fold:۰,diff:· -"" [ buffer number ] -"set statusline +=%#Normal#[ " -"set statusline +=%#Identifier#%n " buffer number -"set statusline +=%#PreProc#%M " modified flag -"set statusline +=%#Normal#] " -"" [ file name (& modified?) ] -"set statusline +=%#Normal#\ [ " -"set statusline +=%#Statement#%<%F%* " full path -""set statusline +=%#Statement#%<%t " full path -"set statusline +=%#PreProc#%M " modified flag -"set statusline +=%#Normal#] " -"" [ column : line number / number of lines in file, percentage of file ] [%v:%l/%L\ %p%%] -"set statusline +=%#Normal#\ [ " -"set statusline +=%#Identifier#%v " column & line -"set statusline +=%#Normal#: " -"set statusline +=%#Identifier#%l " column & line -"set statusline +=%#SpecialKey#/%L\ " total lines -"set statusline +=%#Identifier#%p " percentage of file -"set statusline +=%#SpecialKey#%% " -"set statusline +=%#Normal#] " " -"" [ file format : file type ] -"set statusline +=%#Normal#\ [ " -"set statusline +=%#SpecialKey#%{&fenc} " file format -"set statusline +=%#Normal#: " -"set statusline +=%#SpecialKey#%{&ff} " file format -"set statusline +=%#Normal#: " -"set statusline +=%#SpecialKey#%y " file type -"set statusline +=%#Normal#] " -"" [ character under cursor ] -"set statusline +=%#Normal#\ [ " -"set statusline +=%#String#0x%04B " character under cursor -"set statusline +=%#Normal#]\ " -"" [ syntastic ] -"set statusline +=%#warningmsg# -"set statusline +=%{SyntasticStatuslineFlag()}\ " -""set statusline+=%* -"" Status line background -"set statusline +=%#Folded#\ " -"" misc -"set laststatus=2 " status line always on -"% textwrap -:set whichwrap=<,>,h,l,[,] -:set nolinebreak " only affects display not buffer -:set wrap -:set wrapmargin=0 -"% map -":let mapleader = "," " consider -:map paste :set invpaste -"% wrap/formatting paragraph according to the current 'textwidth' with ^\ (control-\): -:imap gqap -:nmap gqap -:vmap gq -"% save file, go to next file in buffer -:map nf :w :n -"% vimdiff q exits -:if &diff -: cmap q qa -:endif -"% directory files, placed in vertical split window -:map ls :vs :Explore -:map dir :vs :Explore -"% remapping lines make cursor jump a line at a time within wrapped text -:nnoremap j gj -:nnoremap k gk -:vnoremap j gj -:vnoremap k gk -:nnoremap gj -:nnoremap gk -:vnoremap gj -:vnoremap gk -:inoremap gj -:inoremap gk -"% search and replace -:map rd :.,$s///c "search and replace down -:map rg :%s///c "search and replace whole file -:map rr :rubyd gsub!(//,"") -"% pwd t64 working directory set to that of the file you're editing -"changes pwd to directory of file in current buffer -:function! CHANGE_CURR_DIR() -: let _dir = expand("%:p:h") -: exec "cd " . _dir -: unlet _dir -:endfunction -"% Change to the directory the file in your current buffer is in -:if has("autocmd") - autocmd BufEnter * :lcd %:p:h -:endif -"% autocompletefilenames To search for files in the current directory -:set path=,, -"auto-completion for file to edit in current dir, used in normal mode -:map e :e =expand("%:p:h") . "/" -:map pwd :exe 'cd ' . expand ("%:p:h") -"% searchhighlight t93: Toggle search highlight -:function! ToggleHLSearched() -: if &hls -: set nohls -: else -: set hls -: endif -:endfun -:nmap :silent call ToggleHLSearched() -"%% SiSU vim folds -"% foldsearchx FoldSearch (opens result of search all else closed) t77 -:map fs :set foldmethod=expr foldcolumn=2 foldlevel=0 -:map ff :F -:map fe :F zE -"% foldtoggle Fold Toggle mapped to -:fun! ToggleFold() -: if foldlevel('.') == 0 -: normal! l -: else -: if foldclosed('.') < 0 -: foldclose -: else -: foldopen -: endif -: endif -" Clear status line -: echo -:endfun -" Map this function to Space key. -:noremap :call ToggleFold() -"% foldtype Fold? set foldtext -:set foldtext=v:folddashes.substitute(getline(v:foldstart),'\\=','','g',) -:set foldexpr=getline(v:lnum-1)!~@/&&getline(v:lnum)!~@/&&getline(v:lnum+1)!~@/ -"% foldsearch t77: Fold on search result -:function! FoldMake(search) -: set fdm=manual -: normal zE -: normal G$ -: let folded = 0 "flag to set when a fold is found -: let flags = "w" "allow wrapping in the search -: let line1 = 0 "set marker for beginning of fold -: while search(a:search, flags) > 0 -: let line2 = line(".") -: if (line2 -1 > line1) -: "echo line1 . ":" . (line2-1) -: "echo "a fold goes here." -: execute ":" . line1 . "," . (line2-1) . "fold" -: let folded = 1 "at least one fold has been found -: endif -: let line1 = line2 "update marker -: let flags = "W" "turn off wrapping -: endwhile -" create the last fold which goes to the end of the file. -: normal $G -: let line2 = line(".") -: if (line2 > line1 && folded == 1) -: execute ":". line1 . "," . line2 . "fold" -: endif -: normal 1G -:endfunction -"% folds Fold Patterns -:command! -nargs=+ -complete=command FMake call FoldMake() -: if ( &filetype == "ruby" ) -: command! F FMake ^# ==\?\|^\s*\(\(def\|class\|module\)\s\|\(public\|protected\|private\|__END__\)\s*$\)\|\(^\s*\|\s\+\)#%\s -: command! Fa FMake \(^# ==\?\|^\s*\(\(\(def\|class\|module\)\s\)\|\(\(public\|protected\|private\|__END__\)\(\s*$\)\)\)\)\|^[0-9]\~\|\([#%]\|^["]\)\{1,4\}\s*%\|{\({\|!!\) -: command! FD FMake \(^# ==\?\|^\s*\(\(def\|class\|module\)\s\)\)\|^\s*\([#%"0-9]\{0,4\}\~\(%\+\s\|!!\)\|#\s\+=\+\s\+\) -: else -"% folds :F Fold Patterns SiSU Markup :F -: command! F FMake ^\([1-8]\|:\?[A-C]\)\~\|\(^%\|\(^\|\s\+\)[#"]\)%\{1,2\}\(\s\|$\)\|^<<\s*| -: command! Fa FMake ^\([1-8]\|:\?[A-C]\)\~\|\(^%\|\(^\|\s\+\)[#"]\)%\{1,2\}\(\s\|$\)\|^<<\s*|\|^\(Book\|Part\|Chapter\|Section\|Article\|BOOK\|PART\|CHAPTER\|SECTION\|ARTICLE\)\s -: command! F0 FMake ^\(\s*0\~\|@\S\+:[+-]\?\s\+\) -: command! FA FMake ^:\?A\~ -: command! FB FMake ^:\?[AB]\~ -: command! FC FMake ^:\?[A-C]\~ -: command! F1 FMake ^\(:\?[A-C]\|1\)\~ -: command! F2 FMake ^\(:\?[A-C]\|[12]\)\~ -: command! F3 FMake ^\(:\?[A-C]\|[1-3]\)\~ -: command! F4 FMake ^[1-4]\~ -: command! F5 FMake ^[4-5]\~ -: command! F6 FMake ^[4-6]\~ -: command! Fc FMake ^[%]\+\s\+ -: endif -"% folds Fold Patterns misc -":command! Fp FMake ^\s*[A-Za-z0-9#] -:command! Fp FMake ^\s*\S -:command! Fo FMake ^[%\"]\s*[{>] -"% linenumbering, on, relative, off -:map nn :set ={'00':'','01':'r','10':'nor'}[&rnu.&nu]nu -"% cursorline -:map cu :if &cursorcolumn - \set nocursorline nocursorcolumn - \else - \set cursorline cursorcolumn - \endif -:map cu- :set nocursorline nocursorcolumn -:map cu+ :set cursorline cursorcolumn diff --git a/sundry/editor-syntax-etc/vim/templates/ssi.tpl b/sundry/editor-syntax-etc/vim/templates/ssi.tpl deleted file mode 100644 index 28e8101..0000000 --- a/sundry/editor-syntax-etc/vim/templates/ssi.tpl +++ /dev/null @@ -1,30 +0,0 @@ -# SiSU 8.0 insert - -title: - main: "#___#" - sub: "#___#" - language: "#___#" - -creator: - author: "#___#" - -date: - :published: "YYYY-MM-DD" - -rights: - copyright: "#___#" - license: "#___#" - -classify: - topic_register: "#___#" - -make: - breaks: "new=:B; break=1" -# home_button_text: "#___#" -# footer: "#___#" - -#% -- body --- - -:A~ @title @author - -1~ #___# diff --git a/sundry/editor-syntax-etc/vim/templates/ssm.tpl b/sundry/editor-syntax-etc/vim/templates/ssm.tpl deleted file mode 100644 index 579375f..0000000 --- a/sundry/editor-syntax-etc/vim/templates/ssm.tpl +++ /dev/null @@ -1,30 +0,0 @@ -# SiSU 8.0 master - -title: - main: "#___#" - sub: "#___#" - language: "#___#" - -creator: - author: "#___#" - -date: - :published: "YYYY-MM-DD" - -rights: - copyright: "#___#" - license: "#___#" - -classify: - topic_register: "#___#" - -make: - breaks: "new=:B; break=1" -# home_button_text: "#___#" -# footer: "#___#" - -#% -- body --- - -:A~ @title @author - -1~ #___# diff --git a/sundry/editor-syntax-etc/vim/templates/sst.tpl b/sundry/editor-syntax-etc/vim/templates/sst.tpl deleted file mode 100644 index 069d498..0000000 --- a/sundry/editor-syntax-etc/vim/templates/sst.tpl +++ /dev/null @@ -1,30 +0,0 @@ -# SiSU 8.0 - -title: - main: "#___#" - sub: "#___#" - language: "#___#" - -creator: - author: "#___#" - -date: - :published: "YYYY-MM-DD" - -rights: - copyright: "#___#" - license: "#___#" - -classify: - topic_register: "#___#" - -make: - breaks: "new=:B; break=1" -# home_button_text: "#___#" -# footer: "#___#" - -#% -- body --- - -:A~ @title @author - -1~ #___# diff --git a/sundry/editor-syntax-etc/vim/vim-sisu.yaml b/sundry/editor-syntax-etc/vim/vim-sisu.yaml deleted file mode 100644 index ca665bc..0000000 --- a/sundry/editor-syntax-etc/vim/vim-sisu.yaml +++ /dev/null @@ -1,7 +0,0 @@ -#vim-addons: debian vim-addon-manager -addon: sisu -description: SiSU documents - structuring, publishing in multiple formats and search -basedir: /usr/share/vim-scripts/ -files: - - ftplugin/sisu.vim - - syntax/sisu.vim diff --git a/sundry/misc/editor-syntax-etc/README b/sundry/misc/editor-syntax-etc/README deleted file mode 100644 index c03f356..0000000 --- a/sundry/misc/editor-syntax-etc/README +++ /dev/null @@ -1,90 +0,0 @@ -This directory - ./data/sisu/conf/editor-syntax-etc/ - /usr/share/sisu/conf/editor-syntax-etc/ -contains rudimentary sisu syntax highlighting files for: - -* (g)vim - * package: sisu-vim - * status: largely done - there is a vim syntax highlighting and folds component - -* gedit -* gobby - file: sisu.lang - place in: - /usr/share/gtksourceview-1.0/language-specs - or - ~/.gnome2/gtksourceview-1.0/language-specs - * status: very basic syntax highlighting - * comments: this editor features display line wrap and is used by Goby! - -* nano - file: nanorc - save as: - ~/.nanorc - includes: - * status: basic syntax highlighting - * comments: assumes dark background - no display line-wrap - does line breaks - -* diakonos (an editor written in ruby) - file: diakonos.conf - save as: - ~/.diakonos/diakonos.conf - includes: - * status: basic syntax highlighting - * comments: assumes dark background - no display line-wrap - -* kate & kwrite http://kate.kde.org - file: sisu.xml - place in: - /usr/share/apps/katepart/syntax - or - ~/.kde/share/apps/katepart/syntax - [settings::configure kate::{highlighting,filetypes}] - [tools::highlighting::{markup,scripts}::SiSU] - -* nedit - file: sisu_nedit.pats - nedit -import sisu_nedit.pats - * status: a very clumsy first attempt - [not really done] - * comments: this editor features display line wrap - -* emacs - files: sisu-mode.el - to file ~/.emacs add the following 2 lines: - (add-to-list 'load-path "/usr/share/sisu-examples/config/syntax_hi") - (require 'sisu-mode.el) - [not done / not yet included] - -* vim & gvim - files: sisu-vim - package is the most comprehensive sisu syntax highlighting and editor - environment provided to date (is for vim/ gvim, and is separate from the - contents of this directory) - on debian: - aptitude install sisu-vim - * status: this includes: - syntax highlighting - vim folds - some error checking - * comments: this editor features display line wrap - -NOTE: - -[SiSU parses files with long lines or line breaks, -but, display linewrap (without line-breaks) is a -convenient editor feature to have for sisu markup] - -kde-config --prefix -KDEDIR/share/apps/katepart/syntax/ -KDEHOME/share/apps/katepart/syntax -[In the configure dialog in kate, go to the "Editor->highlighting" page and ->select a highlight to change the mimetype/pattern associations for it.] -/etc/mime.types -/usr/share/mime/text -# -# * aeditor (an editor written in ruby) diff --git a/sundry/misc/editor-syntax-etc/emacs/README b/sundry/misc/editor-syntax-etc/emacs/README deleted file mode 100644 index 6dabf72..0000000 --- a/sundry/misc/editor-syntax-etc/emacs/README +++ /dev/null @@ -1,4 +0,0 @@ -; put this into your .emacs file, then use the mode file: - -(load-file "~/emacs/el/sisu-spine-mode.el") -(add-to-list 'auto-mode-alist '("\\.sst$" . sisu-spine-mode)) diff --git a/sundry/misc/editor-syntax-etc/emacs/sisu-spine-mode-autoloads.el b/sundry/misc/editor-syntax-etc/emacs/sisu-spine-mode-autoloads.el deleted file mode 100644 index 4cc6332..0000000 --- a/sundry/misc/editor-syntax-etc/emacs/sisu-spine-mode-autoloads.el +++ /dev/null @@ -1,10 +0,0 @@ -(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) -(autoload 'sisu-spine-mode "sisu-spine-mode" "\ -Major mode for editing SiSU (spine) markup files. -SiSU (https://www.sisudoc.org/) document structuring, publishing -and search. - -\(fn)" t nil) -(add-to-list 'auto-mode-alist '("\\.sst\\'" . sisu-spine-mode)) -(add-to-list 'auto-mode-alist '("\\.ssm\\'" . sisu-spine-mode)) -(add-to-list 'auto-mode-alist '("\\.ssi\\'" . sisu-spine-mode)) diff --git a/sundry/misc/editor-syntax-etc/emacs/sisu-spine-mode.el b/sundry/misc/editor-syntax-etc/emacs/sisu-spine-mode.el deleted file mode 100644 index 52d7a16..0000000 --- a/sundry/misc/editor-syntax-etc/emacs/sisu-spine-mode.el +++ /dev/null @@ -1,493 +0,0 @@ -;;; sisu-spine-mode.el --- Major mode for SiSU (spine parser) markup text - -;; Copyright (C) 2011, 2022 Free Software Foundation, Inc. - -;; Author: Ralph Amissah & Ambrose Kofi Laing -;; Maintainer: Ralph Amissah -;; Keywords: text, syntax, processes, tools -;; Version: 8.0.0 -;; URL: https://www.sisudoc.org/ -;; originally looked at (based on) doc-mode, with kind permission of the author -;; Author: SUN, Tong , (c)2001-6, all right reserved -;; Version: $Date: 2006/01/19 03:13:41 $ $Revision: 1.14 $ -;; Home URL: https://xpt.sourceforge.net/ -;; with contributions from Kevin Ryde and Stefan Monnier - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;; Viva Software Libre! -;; Support the free software movement! -;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;; Commentary: - -;; SiSU (https://www.sisudoc.org/) is a document structuring and -;; publishing framework. This package provides an Emacs major mode -;; for SiSU markup, as used by the spine parser (in D) which has a different -;; header (based on yaml) from the original sisu parser (in Ruby) which has -;; bespoke headers. - -;; When this package is installed, files ending in ".sst" are automatically -;; associated with sisu-spine-mode. If a file doesn't have a -;; .sst extension, add a first line: -;; # -*- sisuSpine -*- - -;; The documentation for the "Structure Of The Hierarchy Text" can be -;; found in the sisustring for the sisu-spine-mode function. - -;;; Code: - -;; Variables: - -(defgroup sisu-faces nil - "AsciiSisu highlighting" - :group 'sisus) - -;; == Colors -; color n is more prominent than color n+1 - -(defface sisu-title-1-face - `((((class color) - (background dark)) - (:foreground "brown3" :bold t :height 1.2 :inherit variable-pitch)) - (((class color) - (background light)) - (:foreground "brown3" :bold t :height 1.2 :inherit variable-pitch)) - (t (:weight bold :inherit variable-pitch))) - "Face for AsciiSisu titles at level 1." - :group 'sisu-faces) - -(defface sisu-title-2-face - `((((class color) - (background dark)) - (:foreground "yellow4" :bold t :height 1.1 :inherit variable-pitch)) - (((class color) - (background light)) - (:foreground "yellow4" :bold t :height 1.1 :inherit variable-pitch)) - (t (:weight bold :inherit variable-pitch))) - "Face for AsciiSisu titles at level 2." - :group 'sisu-faces) - -(defface sisu-title-3-face - `((((class color) - (background dark)) - (:foreground "sienna3" :bold t)) - (((class color) - (background light)) - (:foreground "sienna3" :bold t)) - (t (:weight bold))) - "Face for AsciiSisu titles at level 3." - :group 'sisu-faces) - -(defface sisu-title-4-face - `((((class color) - (background dark)) - (:foreground "burlywood3")) - (((class color) - (background light)) - (:foreground "burlywood3")) - (t ())) - "Face for AsciiSisu titles at level 4." - :group 'sisu-faces) - -(defface info-node - '((((class color) (background light)) (:foreground "brown" :bold t :italic t)) - (((class color) (background dark)) (:foreground "white" :bold t :italic t)) - (t (:bold t :italic t))) - "Face for Info node names." - :group 'sisu-faces) - -(defvar sisu-title-1 'sisu-title-1-face) -(defvar sisu-title-2 'sisu-title-2-face) -(defvar sisu-title-3 'sisu-title-3-face) -(defvar sisu-title-4 'sisu-title-4-face) - -(defvar sisu-general-font-lock-red1 font-lock-warning-face) -(defvar sisu-general-font-lock-red2 font-lock-comment-face) -(defvar sisu-general-font-lock-red3 font-lock-string-face) - -(defvar sisu-general-font-lock-green1 font-lock-type-face) -(defvar sisu-general-font-lock-green2 font-lock-constant-face) - -(defvar sisu-general-font-lock-blue1 font-lock-keyword-face) -(defvar sisu-general-font-lock-blue2 font-lock-function-name-face) -(defvar sisu-general-font-lock-blue3 font-lock-builtin-face) - -(defvar sisu-general-font-lock-yellow1 font-lock-variable-name-face) -(defvar sisu-general-font-lock-yellow2 font-lock-comment-face) - -;; == sisu-spine-mode settings - -(defvar sisu-spine-mode-hook nil - "Normal hook run when entering Sisu Text mode.") - -(defvar sisu-spine-mode-abbrev-table nil - "Abbrev table in use in Sisu-spine-mode buffers.") -(define-abbrev-table 'sisu-spine-mode-abbrev-table ()) - -(defconst sisu-font-lock-keywords - (eval-when-compile - (list - ;;grouped text --------- - ;(cons "^```[ ]code\\(.\\|\n\\)+?\n```\n" 'sisu-general-font-lock-red2) - (cons "^```[ ]+code.*?$\\|^```$" 'sisu-general-font-lock-red2) - (cons "^```[ ]+table.*?$\\|^```$" 'sisu-general-font-lock-red2) - (cons "^```[ ]+group$\\|^```$" 'sisu-general-font-lock-red2) - (cons "^```[ ]+block$\\|^```$" 'sisu-general-font-lock-red2) - (cons "^```[ ]+poem$\\|^```$" 'sisu-general-font-lock-red2) - (cons "^```[ ]+alt$\\|^```$" 'sisu-general-font-lock-red2) - ;;grouped text --------- - (cons "^group{\\|^}group" 'sisu-general-font-lock-red2) - (cons "^block{\\|^}block" 'sisu-general-font-lock-red2) - (cons "^code{\\|^}code" 'sisu-general-font-lock-red2) - (cons "^poem{\\|^}poem" 'sisu-general-font-lock-red2) - (cons "^alt{\\|^}alt" 'sisu-general-font-lock-red2) - (cons "^table{.+\\|^}table" 'sisu-general-font-lock-red2) - (cons "^{table[^}]+}" 'sisu-general-font-lock-red2) - - (list - (concat - "^\`\\{3\\}[ ]+code.*?$" - "\\(.\\|\n\\)+?" - "\`\\{3\\}$" - ) - '(1 sisu-general-font-lock-red2 t) - '(2 nil t) - '(3 sisu-general-font-lock-red2 t) - ) - (list - (concat - "^\`\\{3\\}[ ]+table.*?$" - "\\(.\\|\n\\)+?" - "\`\\{3\\}$" - ) - '(1 sisu-general-font-lock-red2 t) - '(2 nil t) - '(3 sisu-general-font-lock-red2 t) - ) - (list - (concat - "^\`\\{3\\}[ ]+\\(group\\|block\\|alt\\|poem\\)$" - "\\(.\\|\n\\)+?" - "^\`\\{3\\}$" - ) - '(1 sisu-general-font-lock-red2 t) - '(2 nil t) - '(3 sisu-general-font-lock-red2 t) - ) - - ;; footnote/endnote ---- - ;(cons "\~{.+?}\~" 'sisu-general-font-lock-green1) - (cons "\~{\\*\\*\\|\~{\\*\\|\~{\\|}\~" 'sisu-general-font-lock-red2) - (cons "\~\\[\\+\\|\~\\[\\*\\|\~\\[\\|\\]\~" 'sisu-general-font-lock-red2) - (cons "\~\\^ \\|^\\^\~ " 'sisu-general-font-lock-red2) - (list - (concat - "\\(\*\~\\)" - "\\([^ \r\t\n]+\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-blue2 t) - ) - - ;; emphasis (can be program configured to be bold italics or underscore) - (list - (concat - "\\([*]{\\)" - "\\([^}]+\\)" - "\\(}[*]\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; bold ---------------- - (list - (concat - "\\([!]{\\)" - "\\([^}]+\\)" - "\\(}[!]\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - (cons "\\*[^ ]+\\*" 'sisu-general-font-lock-red1) - (cons "^!_ .+" 'sisu-general-font-lock-red1) - - ;; italics ------------- - (list - (concat - "\\([/]{\\)" - "\\([^}]+\\)" - "\\(}[/]\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-blue1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; underscore ---------- - (list - (concat - "\\([_]{\\)" - "\\([^}]+\\)" - "\\(\}[_]\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; monospace ----------- - (list - (concat - "\\([#]{\\)" - "\\([^}]+\\)" - "\\(}[#]\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; citation ------------ - (list - (concat - "\\([\"]{\\)" - "\\([^}]+\\)" - "\\(}[\"]\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; inserted text ------- - (list - (concat - "\\([\+]{\\)" - "\\([^}]+\\)" - "\\(}[\+]\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; strike through ------ - (list - (concat - "\\(\\-{\\)" - "\\([^}]+\\)" - "\\(}\\-\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; superscript --------- - (list - (concat - "\\(\\^{\\)" - "\\([^}]+\\)" - "\\(}\\^\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; subscript ----------- - (list - (concat - "\\([,]{\\)" - "\\([^}]+\\)" - "\\(}[,]\\)" - ) - '(1 sisu-general-font-lock-red1 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-red1 t) - ) - - ;; numbered list - (cons "^# \\|^_# " 'sisu-general-font-lock-red1) - - ;; bullet text - (cons "^_\\*[1-9] \\|^_\\* " 'sisu-general-font-lock-red1) - - ;; indented text - (cons "^_[1-9] " 'sisu-general-font-lock-red1) - (cons "^_[1-9]! " 'sisu-general-font-lock-red1) - - ;; hanging indented text [proposed enable when implemented] - (cons "^__[1-9] " 'sisu-general-font-lock-red1) - (cons "^_[0-9]_[0-9] " 'sisu-general-font-lock-red1) - (cons "^__[1-9]! " 'sisu-general-font-lock-red1) - (cons "^_[0-9]_[0-9]! " 'sisu-general-font-lock-red1) - - ;; url - (cons "\\(^\\|[ ]\\)https?:[/][/][^ \t\n\r<]+" 'sisu-general-font-lock-blue2) - - ;; Comment Lines - (cons "^% .*" 'sisu-general-font-lock-blue1) - - ;; page break - (cons "^\\(-\\\\\\\\-\\|=\\\\\\\\=\\|-\\.\\.-\\)" 'sisu-general-font-lock-red2) - - ;; line break - (cons " \\\\\\\\ " 'sisu-general-font-lock-red1) - - ;; line break (depreciated) - (cons "
" 'sisu-general-font-lock-red1) - - ;; Section titles - (list "^\\(\\([1-4]\\|:?[A-D]\\)\\~\\)\\(.*\\)" - '(1 sisu-title-1 t) - '(3 sisu-title-2 t) - ) - - ;; hyper-links - (list - (concat - "\\({~^\\|{\\)" - "\\([^}{]+\\)" - "\\(}https?:[/][/][^ \r\n\t<]+\\)" - ) - '(1 sisu-general-font-lock-blue2 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-blue2 t) - ) - - ;; book index - (list - (concat - "^\\(\={\\)" - "\\([^}{]+\\)" - "\\(}\\)$" - ) - '(1 sisu-general-font-lock-green1 t) - '(2 nil t) - '(3 sisu-general-font-lock-green1 t) - ) - - ;(cons "^\={.+}" 'sisu-general-font-lock-green1) - - ;; numbers - (cons "\\<[.0-9]+\\>" 'sisu-general-font-lock-green2) - - ;; bullets sisu_normal (nearly copied regexp) - (cons "^_\\([1-9*]\\|[1-9]\\*\\) " 'sisu-general-font-lock-blue2) - - ;; image links - (list - (concat - "\\({\\)" - "\\([^}{]+\\)" - "\\(}image\\)" - ) - '(1 sisu-general-font-lock-blue2 t) - '(2 sisu-general-font-lock-red1 t) - '(3 sisu-general-font-lock-blue2 t) - ) - - ;; insert file links - (list - (concat - "\\(<< \\)" - "\\([^ \r\t\n]+\\.ss\\)" - "\\(i\\|t\\)" - ) - '(1 sisu-general-font-lock-blue2 t) - '(2 sisu-general-font-lock-blue2 t) - '(3 sisu-general-font-lock-blue2 t) - ) - - ;; raw keywords - (list - (concat - "^\\(\\(" - "creator\\|" - "title\\|" - "date\\|" - "rights\\|" - "publisher\\|" - "classify\\|" - "identifier\\|" - "original\\|" - "notes\\|" - "links\\|" - "make\\|" - "\\):\\)\\(.*\\)" - ) - '(1 sisu-title-2 keep) - '(3 sisu-title-3 keep) - ) - ) - ) - "Default expressions to highlight in AsciiSisu mode." -) - -;; outline mode evil "folding" if available -;; (define-key evil-normal-state-map ",0" 'show-all) -;; (define-key evil-normal-state-map ",-" 'hide-body) -;; (define-key evil-normal-state-map ",+" 'show-subtree) -;; (define-key evil-normal-state-map ",=" 'show-subtree) - -;; - -;; Sisu & Autoload: - -;;;###autoload -(define-derived-mode sisu-spine-mode text-mode "SiSU" - "Major mode for editing SiSU files. -SiSU document structuring, publishing in multiple formats and search. -URL `https://www.sisudoc.org/'" - (modify-syntax-entry ?\' ".") - ;;(flyspell-mode nil) - - (make-local-variable 'paragraph-start) - (setq paragraph-start (concat "$\\|>" page-delimiter)) - (make-local-variable 'paragraph-separate) - (setq paragraph-separate paragraph-start) - (make-local-variable 'paragraph-ignore-fill-prefix) - (setq paragraph-ignore-fill-prefix t) - - (set (make-local-variable 'outline-regexp) - "^\\(\\([1-4]\\|:?[A-D]\\)\\~\\|\\@[a-z]+:\\( \\|$\\)\\)") - - (make-local-variable 'require-final-newline) - (setq require-final-newline t) - - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults - '(sisu-font-lock-keywords - nil ; KEYWORDS-ONLY: no - nil ; CASE-FOLD: no - ((?_ . "w")) ; SYNTAX-ALIST - )) - ;; Enable outlining. - ;; TODO with outlining make sure linum (line numbering) is off, - ;; else performance penalty, sucks bigtime - (outline-minor-mode 1)) - -;;;###autoload (add-to-list 'auto-mode-alist '("\\.ss[imt]\\'" . sisu-spine-mode)) - -(provide 'sisu-spine-mode) - -;; - -;;; sisu-spine-mode.el ends here diff --git a/sundry/misc/editor-syntax-etc/gedit/sisu.lang b/sundry/misc/editor-syntax-etc/gedit/sisu.lang deleted file mode 100644 index b82d5f8..0000000 --- a/sundry/misc/editor-syntax-etc/gedit/sisu.lang +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - ^0~\S|^\@\S+:\s - \n\n - - - - ^(:[A-C]|[1-6])~[a-zA-Z0-9.?_-]*\s+.+ - - - - ^(!_|_[1-9]|_[1-9]?\*)\s - - - - ~\{ - \}~ - - - - [*]\{ - \}[*] - - - - !\{ - \}! - - - - /\{ - \}/ - - - - _\{ - \}_ - - - - \^{ - \}\^ - - - - ,{ - \}, - - - - [+]\{ - \}[+] - - - - [-]\{ - \}[-] - - - - [*]\S+[*] - - - - \{[^}]+\}(https?:\/\/\S+|image)\s - - - - \s\*~\S+ - - - - http[s]*:\/\/\S+ - - - - ^<<\s+\S+\.ss[ti] - - - - ^%+\s. - - - - ^code\{\s*$ - ^\}code\s*$ - - - - ^poem\{\s*$ - ^\}poem\s*$ - - - - ^group\{\s*$ - ^\}group\s*$ - - - - ^alt\{\s*$ - ^\}alt\s*$ - - - - <:(pb|np)> - - - - <:?br> - - - - ~\^(\s|$) - - - - ^\^~\s.+ - - - diff --git a/sundry/misc/editor-syntax-etc/kate/sisu.xml b/sundry/misc/editor-syntax-etc/kate/sisu.xml deleted file mode 100644 index a8054f2..0000000 --- a/sundry/misc/editor-syntax-etc/kate/sisu.xml +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - class - const - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sundry/misc/editor-syntax-etc/nano/nanorc b/sundry/misc/editor-syntax-etc/nano/nanorc deleted file mode 100644 index 30ba439..0000000 --- a/sundry/misc/editor-syntax-etc/nano/nanorc +++ /dev/null @@ -1,221 +0,0 @@ -## Sample initialization file for GNU nano -## Please note that you must have configured nano with --enable-nanorc -## for this file to be read! Also note that characters specially -## interpreted by the shell should not be escaped here. -## -## To make sure a value is not enabled, use "unset