diff options
-rw-r--r-- | data/doc/sisu/CHANGELOG_v2 | 2 | ||||
-rw-r--r-- | data/sisu/v2/conf/convert/modify.rb | 44 |
2 files changed, 35 insertions, 11 deletions
diff --git a/data/doc/sisu/CHANGELOG_v2 b/data/doc/sisu/CHANGELOG_v2 index 248fff73..7101d7af 100644 --- a/data/doc/sisu/CHANGELOG_v2 +++ b/data/doc/sisu/CHANGELOG_v2 @@ -16,6 +16,8 @@ Reverse Chronological: http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/sisu_3.1.11 http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_3.1.11-1 + * modify sisu markup version script + %% 2.9.10 (2011-10-15:41/6) [see 3.1.1.orig.tar.xz] http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/sisu_3.1.1 http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_3.1.1-1 diff --git a/data/sisu/v2/conf/convert/modify.rb b/data/sisu/v2/conf/convert/modify.rb index 5f4f9ae0..c3fe47c9 100644 --- a/data/sisu/v2/conf/convert/modify.rb +++ b/data/sisu/v2/conf/convert/modify.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# encoding: utf-8 =begin * Name: modify.rb * Author: Ralph Amissah @@ -36,13 +37,12 @@ http://www.gnu.org/copyleft/gpl.html http://www.jus.uio.no/sisu/gpl3.fsf - © Ralph Amissah 1997, current 2006. - All Rights Reserved. + (C) Ralph Amissah 1997, current 2009. + All Rights Reserved. * Ralph Amissah: ralph@amissah.com ralph.amissah@gmail.com - * Notes: configure rc in ~/.sisu/sisurc.yaml =end module SiSU_Modify class Convert_markup @@ -51,6 +51,7 @@ module SiSU_Modify @description="This is a script that contains canned text conversions for reuse" end def current_match_and_replace #Disable, edit manually + clean_non_regular_characters #convert_pre_37_to_38_experimental end def message(text) @@ -93,6 +94,27 @@ WOK exit end #%% substitutions to be made + def clean_non_regular_characters + #/[^ a-zA-Z0-9,.!?;:/={}()%@#~\[\]"'´&$_+^-] + #/[^ a-zA-Z0-9,.!?;:/={}()%@#~\[\]"'´&$_+^•’‘`“”–ffifffflfifl-] + #message(%w{[^ a-zA-Z0-9,.!?;:/={}()%@#~\[\]"'´&$_+^-]}) + message(%q{clean non regular characters}) + [ + [/’/, "'"], + [/‘/, "'"], + [/´/, "'"], + [/`/, "'"], + [/[“”]/, '"'], + [/–/, '-'], + [/ff/, 'ff'], + [/ffi/, 'ffi'], + [/ffl/, 'ffl'], + [/fi/, 'fi'], + [/fl/, 'fl'], + [/^•/, '_* '], + [/•/, '*'] + ] + end def convert_pre_37_to_38_experimental message('convert sisu markup from 0.37 to 0.38 experimental (rad)') [ @@ -149,13 +171,13 @@ WOK p @files mr=nil #%% changes to make m match, r replace --------------------------> - if @cf =~/--help/: help + if @cf =~/--help/; help else message("WARNING, proceed at your own risk,\npermanent changes requested for the above named files\n best that you check (manually) what this file is set to do\n conversions set are at the top of the file") mr=case @cf - when /--convert|default/: current_match_and_replace - when /--(?:(?:37)?to38|rad)/: convert_pre_37_to_38_experimental - when /--(?:(?:38)?to37)/: convert_38_experimental_to_37 + when /--convert|default/; current_match_and_replace + when /--(?:(?:37)?to38|rad)/; convert_pre_37_to_38_experimental + when /--(?:(?:38)?to37)/; convert_38_experimental_to_37 else help end end @@ -190,7 +212,7 @@ WOK puts "match in #{i}" @flag_start=true cont.each do |y| - if y =~end_processing: @flag_end=true + if y =~end_processing; @flag_end=true end if @flag_start and not @flag_end match_and_replace.each do |m,r| @@ -206,11 +228,11 @@ WOK #end #if y =~m1 #end - if y=~/^\s*$/: @empty1=true + if y=~/^\s*$/; @empty1=true else @empty1=false end @file.puts y unless (@empty1==true and @empty2==true) - if y=~/^\s*$/: @empty2=true + if y=~/^\s*$/; @empty2=true else @empty2=false end #@file << y + "\n" @@ -242,7 +264,7 @@ match_and_replace=Array.new #WOK # exit #end -unless f.length > 0: f=Dir.glob("[a-z]*.ss?") #restricted to sisu type files, it need not be +unless f.length > 0; f=Dir.glob("[a-z]*.ss?") #restricted to sisu type files, it need not be end #f=Dir.glob("{bin,conf,data,lib}/**/*.rb") #sisu development #f=Dir.glob("[^_]/**/*") #all files subdirectories beneath pwd except those starting with _ |