This patch adds start_highlight, end_highlight, and page_number_separator
attributes to htsearch, to improve configurability of output formats. It's
an adaptation of a similar patch by Sergey Yu. Abdurashitov, posted to the
htdig3-dev mailing list, with improvements and documentation added.
--- htdig-3.1.3/htcommon/defaults.cc.orig Wed Sep 22 11:18:39 1999
+++ htdig-3.1.3/htcommon/defaults.cc Fri Oct 29 15:54:40 1999
@@ -48,6 +48,7 @@ ConfigDefaults defaults[] =
{"doc_index", "${database_base}.docs.index"},
{"doc_list", "${database_base}.docs"},
{"end_ellipses", " ..."},
+ {"end_highlight", ""},
{"endings_affix_file", "${common_dir}/english.aff"},
{"endings_dictionary", "${common_dir}/english.0"},
{"endings_root2word_db", "${common_dir}/root2word.db"},
@@ -107,6 +108,7 @@ ConfigDefaults defaults[] =
{"no_title_text", "filename"},
{"nothing_found_file", "${common_dir}/nomatch.html"},
{"page_list_header", "
Pages:
"},
+ {"page_number_separator", "\" \""},
{"prefix_match_character", "*"},
{"prev_page_text", "[prev]"},
{"remove_bad_urls", "true"},
@@ -126,6 +128,7 @@ ConfigDefaults defaults[] =
{"star_image", "${image_url_prefix}/star.gif"},
{"star_patterns", ""},
{"start_ellipses", "... "},
+ {"start_highlight", ""},
{"start_url", "http://www.htdig.org/"},
{"substring_max_words", "25"},
{"synonym_db", "${common_dir}/synonyms.db"},
--- htdig-3.1.3/htdoc/attrs.html.orig Wed Oct 20 11:37:52 1999
+++ htdig-3.1.3/htdoc/attrs.html Fri Oct 29 15:51:06 1999
@@ -1232,6 +1232,53 @@
-
+
+ end_highlight
+
+ -
+
+ -
+ type:
+
+ -
+ string
+
+ -
+ used by:
+
+ -
+ htsearch
+
+ -
+ default:
+
+ -
+ </strong>
+
+ -
+ description:
+
+ -
+ When excerpts are displayed in the search output,
+ matched words will be highlighted using
+ start_highlight
+ and this string. You should ensure that
+ highlighting tags are balanced, that is, this
+ string should close any formatting tag opened
+ by start_highlight.
+
+ -
+ example:
+
+ -
+ end_highlight: </font>
+
+
+
+
+
+
+ -
endings_affix_file
@@ -1479,13 +1526,17 @@
-
This is the maximum number of characters the displayed
excerpt will be limited to. The first matched word will
- be bolded in the middle of the excerpt so that there is
+ be highlighted in the middle of the excerpt so that there is
some surrounding context.
The
start_ellipses and
end_ellipses are used to
indicate that the document contains text before and
after the displayed excerpt respectively.
+ The start_highlight
+ and end_highlight
+ are used to specify what formatting tags are used to
+ highlight matched words.
-
example:
@@ -4206,6 +4257,65 @@
-
+
+ page_number_separator
+
+ -
+
+ -
+ type:
+
+ -
+ quoted string list
+
+ -
+ used by:
+
+ -
+ htsearch
+
+ -
+ default:
+
+ -
+ " "
+
+ -
+ description:
+
+ -
+ The text strings in this list will be
+ used when putting together the PAGELIST
+ variable, for use in templates or the
+
+ search_results_footer file, when search
+ results fit on more than page. The PAGELIST
+ is the list of links at the bottom of the
+ search results page. The strings in the
+ list will be used in rotation, and will
+ separate individual entries taken from
+ page_number_text and
+ no_page_number_text.
+ There can be as many or as few strings in the
+ list as you like. If there are not enough for
+ the number of pages listed, it goes back to
+ the start of the list. If the list is empty,
+ a space is used. The text strings can contain
+ HTML tags. The strings need to be quoted if they
+ contain spaces, or to specify an empty string.
+
+ -
+ example:
+
+ -
+ page_number_separator: "</td> <td>"
+
+
+
+
+
+
+ -
page_number_text
@@ -5559,6 +5669,53 @@
-
+
+ start_highlight
+
+ -
+
+ -
+ type:
+
+ -
+ string
+
+ -
+ used by:
+
+ -
+ htsearch
+
+ -
+ default:
+
+ -
+ <strong>
+
+ -
+ description:
+
+ -
+ When excerpts are displayed in the search
+ output, matched words will be highlighted using
+ this string and
+ end_highlight. You should ensure that
+ highlighting tags are balanced, that is, any
+ formatting tags that this string opens should
+ be closed by end_highlight.
+
+ -
+ example:
+
+ -
+ start_highlight: <font color="#FF0000">
+
+
+
+
+
+
+ -
start_url
-
@@ -6732,7 +6889,7 @@
Andrew Scherpbier <andrew@contigo.com>
-Last modified: Fri Aug 6 15:00:15 EDT 1999
+Last modified: Fri Oct 29 16:50:59 EDT 1999