summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-08-20 22:42:17 +0000
committerRalph Amissah <ralph@amissah.com>2014-08-20 22:42:17 +0000
commit766b4b6aa046fc125fd42561a6cafc4fe82ee3ad (patch)
tree0fb435b09078e4ec6477ec371c7c0a56c4c8d49c
parentvim, emacs, syntax hilighting, restrict heading matches, minor (diff)
downloadsisu-766b4b6aa046fc125fd42561a6cafc4fe82ee3ad.zip
sisu-766b4b6aa046fc125fd42561a6cafc4fe82ee3ad.tar.xz
v5 v6: texpdf, output, copyright & license
-rw-r--r--data/doc/sisu/CHANGELOG_v52
-rw-r--r--data/doc/sisu/CHANGELOG_v62
-rw-r--r--lib/sisu/v5/dp.rb28
-rw-r--r--lib/sisu/v5/texpdf.rb10
-rw-r--r--lib/sisu/v6/dp.rb28
-rw-r--r--lib/sisu/v6/texpdf.rb10
6 files changed, 68 insertions, 12 deletions
diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5
index 46665c4..f0bc0f4 100644
--- a/data/doc/sisu/CHANGELOG_v5
+++ b/data/doc/sisu/CHANGELOG_v5
@@ -38,6 +38,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.6.2.orig.tar.xz
sisu_5.6.2.orig.tar.xz
sisu_5.6.2-1.dsc
+* texpdf, output, copyright & license
+
* syntax hilighting, restrict heading matches, minor
* vim
* emacs
diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6
index 047bee7..82c7d07 100644
--- a/data/doc/sisu/CHANGELOG_v6
+++ b/data/doc/sisu/CHANGELOG_v6
@@ -28,6 +28,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.2.3.orig.tar.xz
sisu_6.2.3.orig.tar.xz
sisu_6.2.3-1.dsc
+* texpdf, output, copyright & license
+
* syntax hilighting, restrict heading matches, minor
* vim
* emacs
diff --git a/lib/sisu/v5/dp.rb b/lib/sisu/v5/dp.rb
index ef61f6b..33c6c56 100644
--- a/lib/sisu/v5/dp.rb
+++ b/lib/sisu/v5/dp.rb
@@ -583,6 +583,34 @@ module SiSU_Param
def sep(str)
' \\\\ '
end
+ def copyright_and_license
+ s=if @h['all'] then @h['all']
+ else
+ s=''
+ if defined? copyright.text \
+ and copyright.text \
+ and not copyright.text.empty?
+ v=sep(copyright.text)
+ s +=copyright.text + v
+ end
+ if defined? copyright.license \
+ and copyright.license \
+ and not copyright.license.empty?
+ s +=copyright.license
+ end
+ if s.empty?
+ SiSU_Screen::Ansi.new(
+ @opt.act[:color_state][:set],
+ 'WARNING Document Rights information missing; provide @rights: :copyright:'
+ ).warn unless @opt.act[:quiet][:set]==:on
+ else
+ l,n=Db[:col_info_note],'rights.all'
+ validate_length(s,l,n)
+ end
+ s=s.gsub(/ [\\]+\s+$/,'')
+ end
+ s
+ end
def all
s=if @h['all'] then @h['all']
else
diff --git a/lib/sisu/v5/texpdf.rb b/lib/sisu/v5/texpdf.rb
index d5e5139..25ee6eb 100644
--- a/lib/sisu/v5/texpdf.rb
+++ b/lib/sisu/v5/texpdf.rb
@@ -425,12 +425,10 @@ module SiSU_TeX
if defined? @md.rights.all \
and not @md.rights.all.empty?
rght=@md.rights #.author.dup #dup is necessary, else contents of :rights changed
- sp_char=SiSU_TeX_Pdf::SpecialCharacters.new(@md,rght.copyright.all)
- copymark=@md.author_copymark \
- ? '{\begin{small}\copyright\end{small}} '
- : ''
- copymark='Copyright {\begin{small}\copyright\end{small}} '
- copyright=sp_char.special_characters_safe.gsub(/^\s*Copyright \(C\)/, copymark)
+ sp_char=SiSU_TeX_Pdf::SpecialCharacters.new(@md,rght.copyright.copyright_and_license)
+ copymark='Copyright {\begin{small}{\copyright\end{small}} '
+ #copymark='Copyright {\begin{small}^{\copyright\end{small}} '
+ copyright=sp_char.special_characters_safe.gsub(/\s*Copyright \(C\)/, copymark)
@@rights||="\n #{Tex[:backslash]*2}[3]\\ \\linebreak #{copyright}"
end
if defined? @md.notes.prefix_b \
diff --git a/lib/sisu/v6/dp.rb b/lib/sisu/v6/dp.rb
index 5031710..111896d 100644
--- a/lib/sisu/v6/dp.rb
+++ b/lib/sisu/v6/dp.rb
@@ -583,6 +583,34 @@ module SiSU_Param
def sep(str)
' \\\\ '
end
+ def copyright_and_license
+ s=if @h['all'] then @h['all']
+ else
+ s=''
+ if defined? copyright.text \
+ and copyright.text \
+ and not copyright.text.empty?
+ v=sep(copyright.text)
+ s +=copyright.text + v
+ end
+ if defined? copyright.license \
+ and copyright.license \
+ and not copyright.license.empty?
+ s +=copyright.license
+ end
+ if s.empty?
+ SiSU_Screen::Ansi.new(
+ @opt.act[:color_state][:set],
+ 'WARNING Document Rights information missing; provide @rights: :copyright:'
+ ).warn unless @opt.act[:quiet][:set]==:on
+ else
+ l,n=Db[:col_info_note],'rights.all'
+ validate_length(s,l,n)
+ end
+ s=s.gsub(/ [\\]+\s+$/,'')
+ end
+ s
+ end
def all
s=if @h['all'] then @h['all']
else
diff --git a/lib/sisu/v6/texpdf.rb b/lib/sisu/v6/texpdf.rb
index a49d2c3..df6e96e 100644
--- a/lib/sisu/v6/texpdf.rb
+++ b/lib/sisu/v6/texpdf.rb
@@ -425,12 +425,10 @@ module SiSU_TeX
if defined? @md.rights.all \
and not @md.rights.all.empty?
rght=@md.rights #.author.dup #dup is necessary, else contents of :rights changed
- sp_char=SiSU_TeX_Pdf::SpecialCharacters.new(@md,rght.copyright.all)
- copymark=@md.author_copymark \
- ? '{\begin{small}\copyright\end{small}} '
- : ''
- copymark='Copyright {\begin{small}\copyright\end{small}} '
- copyright=sp_char.special_characters_safe.gsub(/^\s*Copyright \(C\)/, copymark)
+ sp_char=SiSU_TeX_Pdf::SpecialCharacters.new(@md,rght.copyright.copyright_and_license)
+ copymark='Copyright {\begin{small}{\copyright\end{small}} '
+ #copymark='Copyright {\begin{small}^{\copyright\end{small}} '
+ copyright=sp_char.special_characters_safe.gsub(/\s*Copyright \(C\)/, copymark)
@@rights||="\n #{Tex[:backslash]*2}[3]\\ \\linebreak #{copyright}"
end
if defined? @md.notes.prefix_b \