From 214c1b729158084c51ff2caefe6fcb26271f02f3 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 11 Jul 2007 16:48:06 +0100 Subject: various fixes: cgi search for, manifest, concordance, diakonos syntax highlghting * cgi search subtitle and odf link * manifest and concordance, subtitle and author info * diakonos syntax highligthing; --- CHANGELOG | 10 +++++-- .../doc/sisu/sisu_markup_samples/dfsg/gpl2.fsf.sst | 2 +- .../doc/sisu/sisu_markup_samples/dfsg/gpl3.fsf.sst | 2 +- data/sisu/conf/syntax/README | 18 ++++++------ data/sisu/conf/syntax/diakonos.conf | 32 ++++++++++------------ lib/sisu/v0/cgi_pgsql.rb | 4 +-- lib/sisu/v0/cgi_sql_common.rb | 10 +++++-- lib/sisu/v0/cgi_sqlite.rb | 4 +-- lib/sisu/v0/concordance.rb | 2 +- lib/sisu/v0/defaults.rb | 2 +- lib/sisu/v0/i18n.rb | 2 +- lib/sisu/v0/manifest.rb | 1 + 12 files changed, 50 insertions(+), 39 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e1f016ad..b2623fa6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -23,9 +23,15 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.55.3.orig.tar.gz better * indentation levels reset - * cgi, generated sample search form, rearranged presentation + * cgi, generated sample search form, rearranged presentation, additional + links and result information provided - * editor syntax highlighting, kate, kwrite visited + * manifest and concordance, output presentation title and author information + more prominent + + * editor syntax highlighting (for SiSU), visited/improved + * kate, kwrite + * diakonos %% sisu_0.55.2.orig.tar.gz (2007-07-07:27/6) http://www.jus.uio.no/sisu/pkg/src/sisu_0.55.2.orig.tar.gz diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/gpl2.fsf.sst b/data/doc/sisu/sisu_markup_samples/dfsg/gpl2.fsf.sst index 1b161087..dfabc14e 100644 --- a/data/doc/sisu/sisu_markup_samples/dfsg/gpl2.fsf.sst +++ b/data/doc/sisu/sisu_markup_samples/dfsg/gpl2.fsf.sst @@ -1,6 +1,6 @@ % SiSU 0.38 -@title: GNU GENERAL PUBLIC LICENSE +@title: GNU GENERAL PUBLIC LICENSE v2 @author: Free Software Foundation diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/gpl3.fsf.sst b/data/doc/sisu/sisu_markup_samples/dfsg/gpl3.fsf.sst index edf4e303..358accce 100644 --- a/data/doc/sisu/sisu_markup_samples/dfsg/gpl3.fsf.sst +++ b/data/doc/sisu/sisu_markup_samples/dfsg/gpl3.fsf.sst @@ -1,6 +1,6 @@ SiSU 0.52 -@title: GNU GENERAL PUBLIC LICENSE +@title: GNU GENERAL PUBLIC LICENSE v3 @author: Free Software Foundation diff --git a/data/sisu/conf/syntax/README b/data/sisu/conf/syntax/README index 82d5ff67..9fde1d1e 100644 --- a/data/sisu/conf/syntax/README +++ b/data/sisu/conf/syntax/README @@ -3,15 +3,15 @@ This directory /usr/share/sisu-examples/sisu-examples/config/syntax_hi contains rudimentary sisu syntax highlighting files for: -* (g)vim http://www.vim.org +* (g)vim * package: sisu-vim * status: largely done * comments: not found here a vim syntax highlighting and folds component of sisu exists, see sisu-vim -* gedit http://www.gnome.org/projects/gedit -* gobby http://gobby.0x539.de/ +* gedit +* gobby file: sisu.lang place in: /usr/share/gtksourceview-1.0/language-specs @@ -20,7 +20,7 @@ contains rudimentary sisu syntax highlighting files for: * status: very basic syntax highlighting * comments: this editor features display line wrap and is used by Goby! -* nano http://www.nano-editor.org +* nano file: nanorc save as: ~/.nanorc @@ -30,7 +30,7 @@ contains rudimentary sisu syntax highlighting files for: no display line-wrap does line breaks -* diakonos (an editor written in ruby) http://purepistos.net/diakonos +* diakonos (an editor written in ruby) file: diakonos.conf save as: ~/.diakonos/diakonos.conf @@ -48,22 +48,22 @@ contains rudimentary sisu syntax highlighting files for: [settings::configure kate::{highlighting,filetypes}] [tools::highlighting::{markup,scripts}::SiSU] -* nedit http://www.nedit.org +* 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 http://www.gnu.org/software/emacs/emacs.html +* 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 http://www.vim.org - files: sisu-vim http://www.jus.uio.no/sisu/SiSU/download +* 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) diff --git a/data/sisu/conf/syntax/diakonos.conf b/data/sisu/conf/syntax/diakonos.conf index f40547bc..c7fa686b 100644 --- a/data/sisu/conf/syntax/diakonos.conf +++ b/data/sisu/conf/syntax/diakonos.conf @@ -931,34 +931,32 @@ lang.sisu.tokens.heading.format yellow bold #lang.sisu.tokens.heading.format white inverse lang.sisu.tokens.headings.case_insensitive ^(?:Chapter|Part|Section|Book|Article|Preamble|Appendix)\s.* lang.sisu.tokens.headings.format white bold -lang.sisu.tokens.bullet ^_[12]?\*\s+ +lang.sisu.tokens.bullet ^_[1-9]?\*\s+ lang.sisu.tokens.bullet.format yellow -lang.sisu.tokens.indent ^_[12]\s+ +lang.sisu.tokens.indent ^_[1-9]\s+ lang.sisu.tokens.indent.format yellow -lang.sisu.tokens.link \{.+?\}(?:http:\/\/\S+|image) -lang.sisu.tokens.link.format yellow -lang.sisu.tokens.url http:\/\/\S+ +lang.sisu.tokens.link \{.+?\}(?:https?://\S+|\.\./\S+|image) +lang.sisu.tokens.link.format cyan +lang.sisu.tokens.url http://\S+ lang.sisu.tokens.url.format blue bold lang.sisu.tokens.line_bold ^!_\s+.* lang.sisu.tokens.line_bold.format white bold -lang.sisu.tokens.font_bold [!*]\{.+?\}[!*] +lang.sisu.tokens.font_bold (([!*])\{.+?\}\2) lang.sisu.tokens.font_bold.format white bold -lang.sisu.tokens.font_modify [/_+-^,]\{.+?\}[/_+-^,] +lang.sisu.tokens.font_modify (([/_^,+-])\{.+?\}\2) lang.sisu.tokens.font_modify.format brown lang.sisu.tokens.page_break <:(?:pb|np)> lang.sisu.tokens.page_break.format white bold inverse -lang.sisu.tokens.br <(?:\/\s*)?br> +lang.sisu.tokens.br <:?br> lang.sisu.tokens.br.format white bold inverse lang.sisu.tokens.endnote_mark ~\^(?:\s|$) lang.sisu.tokens.endnote_mark.format green lang.sisu.tokens.endnote_content ^\^~\s.+ lang.sisu.tokens.endnote_content.format green - -lang.sisu.tokens.endnote.open ~\{ -lang.sisu.tokens.endnote.close \}~ -lang.sisu.tokens.endnote.format green -#lang.sisu.tokens.endnotes ~\{.+?\}~ -#lang.sisu.tokens.endnotes.format green +#lang.sisu.tokens.endnote.open ~\{ +#lang.sisu.tokens.endnote.close \}~ +lang.sisu.tokens.endnotes ~\{.+?\}~ +lang.sisu.tokens.endnotes.format green lang.sisu.tokens.group.open ^group\{ lang.sisu.tokens.group.close ^\}group lang.sisu.tokens.group.format green @@ -968,9 +966,9 @@ lang.sisu.tokens.poem.format green lang.sisu.tokens.code.open ^code\{ lang.sisu.tokens.code.close ^\}code lang.sisu.tokens.code.format green - -lang.sisu.tokens.error [a-zA-Z0-9,.::?!&]+http:\/\/\S+ -lang.sisu.tokens.error.format magenta +lang.sisu.tokens.error \s+$|<\S{2}\S+?>|[a-zA-Z0-9,.::?!&><]+http://\S+|http://\S+< +#lang.sisu.tokens.error \s+$|<\S+?>|[a-zA-Z0-9,.::?!&><]+http://\S+|http://\S+< +lang.sisu.tokens.error.format magenta reverse # Custom configuration files can be included. # If a setting is specified again, it overrides the previous setting given diff --git a/lib/sisu/v0/cgi_pgsql.rb b/lib/sisu/v0/cgi_pgsql.rb index 9a577337..b3a7a82b 100644 --- a/lib/sisu/v0/cgi_pgsql.rb +++ b/lib/sisu/v0/cgi_pgsql.rb @@ -185,7 +185,7 @@ module SiSU_CGI_pgsql def sql_select_body limit ||=@@limit offset ||=@@offset - @sql_statement[:body]=%{SELECT metadata.title, metadata.creator, metadata.filename, metadata.suffix, documents.body, documents.seg, documents.ocn, metadata.tid FROM documents, metadata WHERE (#@search_text) AND documents.metadata_tid = metadata.tid ORDER BY metadata.title, metadata.filename, documents.ocn} + @sql_statement[:body]=%{SELECT metadata.title, metadata.subtitle, metadata.creator, metadata.filename, metadata.suffix, documents.body, documents.seg, documents.ocn, metadata.tid FROM documents, metadata WHERE (#@search_text) AND documents.metadata_tid = metadata.tid ORDER BY metadata.title, metadata.filename, documents.ocn} @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;} select=@sql_statement[:body] + ' ' + @sql_statement[:range] select @@ -193,7 +193,7 @@ module SiSU_CGI_pgsql def sql_select_endnotes limit ||=@@limit offset ||=@@offset - @sql_statement[:endnotes]=%{SELECT metadata.title, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE (#@search_endnotes) AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, metadata.filename, endnotes.nr} + @sql_statement[:endnotes]=%{SELECT metadata.title, metadata.subtitle, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE (#@search_endnotes) AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, metadata.filename, endnotes.nr} @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;} select=@sql_statement[:endnotes] + ' ' + @sql_statement[:range] select diff --git a/lib/sisu/v0/cgi_sql_common.rb b/lib/sisu/v0/cgi_sql_common.rb index fbb627db..762632dc 100644 --- a/lib/sisu/v0/cgi_sql_common.rb +++ b/lib/sisu/v0/cgi_sql_common.rb @@ -764,7 +764,10 @@ module SiSU_CGI_sql end #metadata_found_body if c['tid'].to_i != oldtid.to_i - title=%{#{c['title']} by #{c['creator']} pdf portraitpdf landscape manifest
} if file_suffix=~/s/ #hmm watch file_suffix + ti=if c['subtitle'] =~/\S+/; "#{c['title']} - #{c['subtitle']}" + else c['title'] + end + title=%{toc html #{ti} by #{c['creator']} toc htmlpdf portraitpdf landscape odf manifest
} if file_suffix=~/s/ #hmm watch file_suffix if @text_search_flag; title='

'+title else title='
'+title end @@ -853,7 +856,10 @@ module SiSU_CGI_sql #metadata_found_endnotes if @text_search_flag if e['metadata_tid'].to_i != oldtid.to_i - title=%{

#{e['title']} by #{e['creator']} pdf portraitpdf landscape manifest
} if file_suffix=~/s/ + ti=if e['subtitle'] =~/\S+/; "#{e['title']} - #{e['subtitle']}" + else e['title'] + end + title=%{

toc html #{ti} by #{e['creator']} toc html pdf portraitpdf landscape odf manifest
} if file_suffix=~/s/ @counter_endn_doc+=1 oldtid=e['metadata_tid'].to_i else title = '' diff --git a/lib/sisu/v0/cgi_sqlite.rb b/lib/sisu/v0/cgi_sqlite.rb index 56b1e588..7a8bfe41 100644 --- a/lib/sisu/v0/cgi_sqlite.rb +++ b/lib/sisu/v0/cgi_sqlite.rb @@ -175,7 +175,7 @@ module SiSU_CGI_sqlite def sql_select_body limit ||=@@limit offset ||=@@offset - @sql_statement[:body]=%{SELECT metadata.title, metadata.creator, metadata.filename, metadata.suffix, documents.body, documents.seg, documents.ocn, metadata.tid FROM documents, metadata WHERE #{@search_text} AND documents.metadata_tid = metadata.tid ORDER BY metadata.title, metadata.filename, documents.ocn} + @sql_statement[:body]=%{SELECT metadata.title, metadata.subtitle, metadata.creator, metadata.filename, metadata.suffix, documents.body, documents.seg, documents.ocn, metadata.tid FROM documents, metadata WHERE #{@search_text} AND documents.metadata_tid = metadata.tid ORDER BY metadata.title, metadata.filename, documents.ocn} @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;} select=@sql_statement[:body] + ' ' + @sql_statement[:range] select @@ -183,7 +183,7 @@ module SiSU_CGI_sqlite def sql_select_endnotes limit ||=@@limit offset ||=@@offset - @sql_statement[:endnotes]= %{SELECT metadata.title, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE #{@search_endnotes} AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, metadata.filename, endnotes.nr} + @sql_statement[:endnotes]= %{SELECT metadata.title, metadata.subtitle, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE #{@search_endnotes} AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, metadata.filename, endnotes.nr} @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;} select=@sql_statement[:endnotes] + ' ' + @sql_statement[:range] select diff --git a/lib/sisu/v0/concordance.rb b/lib/sisu/v0/concordance.rb index e6c4184a..251d5b58 100644 --- a/lib/sisu/v0/concordance.rb +++ b/lib/sisu/v0/concordance.rb @@ -113,7 +113,7 @@ module SiSU_Concordance @lex_button=%{SiSU home -->} @lnk=lnk @doc_details =< 

Manifest #{@md.title}

            TOC TOC - table of contents for individual articles

            Full Text Full text (with indexed table of contents)

            PDF portrait pdf version of the document (portrait)

            PDF landscape pdf version of the document (landscape)

Word index links are to html versions of the text the segmented version followed by the scroll (single document) version.
[For segmented text references [T1], [T2] or [T3] appearing without a link, indicates that the word appears in a title (or subtitle) of the text (that is identifiable by the appended object citation number).]

+
 

Manifest #{@md.dc_title}
    #{@md.dc_creator}

            TOC TOC - table of contents for individual articles

            Full Text Full text (with indexed table of contents)

            PDF portrait pdf version of the document (portrait)

            PDF landscape pdf version of the document (landscape)

Word index links are to html versions of the text the segmented version followed by the scroll (single document) version.
[For segmented text references [T1], [T2] or [T3] appearing without a link, indicates that the word appears in a title (or subtitle) of the text (that is identifiable by the appended object citation number).]

WOK end def create diff --git a/lib/sisu/v0/defaults.rb b/lib/sisu/v0/defaults.rb index 694b2e83..ef4c9df4 100644 --- a/lib/sisu/v0/defaults.rb +++ b/lib/sisu/v0/defaults.rb @@ -770,7 +770,7 @@ module SiSU_Viz %{Contents} end def png_manifest - %{Document Manifest} + %{Document Manifest} end def png_doc %{Full Text} diff --git a/lib/sisu/v0/i18n.rb b/lib/sisu/v0/i18n.rb index a3908119..07204fb7 100644 --- a/lib/sisu/v0/i18n.rb +++ b/lib/sisu/v0/i18n.rb @@ -461,7 +461,7 @@ module SiSU_Translate 'Document Language Versions, manifests' end def manifest_description_output - 'SiSU manifest of generated output' + 'SiSU manifest' end def manifest_description_metadata 'SiSU manifest of document metadata' diff --git a/lib/sisu/v0/manifest.rb b/lib/sisu/v0/manifest.rb index 193d9c7e..931ea96b 100644 --- a/lib/sisu/v0/manifest.rb +++ b/lib/sisu/v0/manifest.rb @@ -476,6 +476,7 @@ SiSU manifest: #{@md.title} #{banner_table}

#{@md.dc_title}

+

#{@md.dc_creator}

WOK published_versions -- cgit v1.2.3