diff --git a/.gitignore b/.gitignore index 6802c23..cce3ef9 100644 --- a/.gitignore +++ b/.gitignore @@ -16,9 +16,51 @@ test/version_tmp tmp testproject wortsammler-gem.sublime-workspace -resources/pandocdefault.docx -resources/pandocdefault.epub -resources/pandocdefault.html -resources/pandocdefault.latex pandoc.css testoutput + +### jetbrains ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/workspace.xml +.idea/tasks.xml + +# Sensitive or high-churn files: +.idea/dataSources/ +.idea/dataSources.ids +.idea/dataSources.xml +.idea/dataSources.local.xml +.idea/sqlDataSources.xml +.idea/dynamic.xml +.idea/uiDesigner.xml + +# Gradle: +.idea/gradle.xml +.idea/libraries + +# Mongo Explorer plugin: +.idea/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +*.log diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 0000000..232f31c --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,32 @@ +FROM alpine:latest + + +RUN apk update &&\ + apk add texlive-xetex texmf-dist-latexextra less + +# from https://github.com/cybercode/alpine-ruby/blob/master/Dockerfile +# guess ist is to install native extensions + +RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \ + && apk update \ + && apk add --update-cache postgresql-client nodejs \ + libffi-dev readline sqlite build-base postgresql-dev \ + libc-dev linux-headers libxml2-dev libxslt-dev readline-dev gcc libc-dev \ + && rm -rf /var/cache/apk/* + +RUN apk update && apk upgrade && apk --update add \ + ruby ruby ruby-dev ruby-irb ruby-rake ruby-io-console ruby-bigdecimal ruby-json ruby-bundler ruby-rspec \ + libstdc++ tzdata bash ca-certificates \ + && echo 'gem: --no-document' > /etc/gemrc\ +# from https://hub.docker.com/r/ciandt/docker-alpine-pandoc/dockerfile^\ +# install pandoc +RUN \ + apk add ca-certificates wget \ + && wget -O /tmp/pandoc.tar.gz https://github.com/jgm/pandoc/releases/download/2.5/pandoc-2.5-linux.tar.gz \ + && tar xvzf /tmp/pandoc.tar.gz --strip-components 1 -C /usr/local/ \ + && ln /usr/local/bin/pandoc /usr/local/bin/pandoc_2.5 \ + && update-ca-certificates \ + && apk del wget ca-certificates\ + && rm /tmp/pandoc.tar.gz + + RUN apk update && apk add ghostscript diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..01359b6 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1 @@ +{ image: { file: .gitpod.Dockerfile } } diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..fc33622 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +202_wortsammler-gem \ No newline at end of file diff --git a/.idea/.rakeTasks b/.idea/.rakeTasks new file mode 100644 index 0000000..d369155 --- /dev/null +++ b/.idea/.rakeTasks @@ -0,0 +1,7 @@ + + diff --git a/.idea/202_wortsammler-gem.iml b/.idea/202_wortsammler-gem.iml new file mode 100644 index 0000000..f75b5d3 --- /dev/null +++ b/.idea/202_wortsammler-gem.iml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..1184e6b --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..b0db9b0 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..3b31283 --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/.idea/libraries/plantuml.xml b/.idea/libraries/plantuml.xml new file mode 100644 index 0000000..374c5d2 --- /dev/null +++ b/.idea/libraries/plantuml.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..27a20f5 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..36875c1 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..c80f219 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/202_wortsammler-gem.iml b/202_wortsammler-gem.iml new file mode 100644 index 0000000..eddc21d --- /dev/null +++ b/202_wortsammler-gem.iml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Gemfile b/Gemfile index 9c48a6d..2fa99cc 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,4 @@ source 'https://rubygems.org' # Specify your gem's dependencies in wortsammler.gemspec gemspec + diff --git a/README.md b/README.md index 825a031..aa4fa7d 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,17 @@ +[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/bwl21/wortsammler) + # Wortsammler +> **plaease note** +> : this project is not actively maintained. I try to keep it alive in +> order to fulfil my own needs + Wortsammler (colloquial German for *word collector*) is an environment to maintain doucmentation in markdown and publish it in various formats for different audiences. It originated in some project specific hacks -wrapping around [pandoc][]. But now I refactored it since I use it in -more than two projects now and think it might be beneficial for others -as well. +wrapping around [pandoc](http://johnmacfarlane.net/pandoc/). But now I +refactored it since I use it in more than two projects now and think it +might be beneficial for others as well. Typical application of Wortsammler is user manuals, project documents, user manuals. @@ -26,7 +32,6 @@ Basically Wortsammler comprises of - expected output formats - expected editions - Requirements tracing (upstream / downstream) - - a command line tool to produce the doucments (`wortsammler`) Wortsammler is built on top of other open source tools, in particular: @@ -45,7 +50,7 @@ The features are based on three appraoches: 1. particular pattern in existing markdown 2. embedded HTML/LaTeX -3. specific syntax in strikethrouh sections (e.g. ~~ED simple~~) +3. specific syntax in strikethrouh sections (e.g. ~~ED simple~~) ## Installation @@ -53,10 +58,9 @@ The features are based on three appraoches: In order to use Wortsammler, you need to install the prerequisites: -- ruby 1.9.3 of course -- pandoc 1.9.4.2 or above - - I plan to upgrade to 1.11.1 asap +- ruby 2.5 +- pandoc 2.5 or above. Note that in this version, ean executable named + pandoc_2.5 must be in the search path. - tex, in particular xelatex 3.1415926-2.4-0.9998 @@ -109,7 +113,6 @@ The rakefile is in `/30_Sources/ZSUPP_Tools` ## future plans -- provide a sublime text package - improve documentation (it is flying around in German and needs to be consolidated, please refer to ) @@ -132,33 +135,32 @@ MIT: http://www.opensource.org/licenses/mit-license.php ## thanks to -- John Mc Farlane for [pandoc][] +- John Mc Farlane for [pandoc](http://johnmacfarlane.net/pandoc/) ## Installation of the required software ### Ruby -Please use Ruby 1.9.3 +Please use Ruby 2.5 - mac: - installation requirex xcode with the commanline tools - - use Ruby Version Manager [https://rvm.io][] - - rvm install ruby_1.9.3 - - might take pretty long depending on wha you have on your mac. + - use Ruby Version Manager \[https://rvm.io\]\[\] + - rvm install ruby_2.5 + - might take pretty long depending on what you have on your mac. - after ruby is installed `gem install wortsammler` - - windows - - download von [http://rubyinstaller.org/downloads/][] + - download von + [http://rubyinstaller.org/downloads/](https://rubyinstaller.org/downloads/) - development kit installieren - [DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe][] + [DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe](https://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe) - Das braucht man nur, wenn man den Windows-Debugger verwenden - muss. In den scripten ist rquire ruby-debug aukommentiert. + you might need this to install gems ### pandoc -- Download [http://code.google.com/p/pandoc/downloads/list][] -- Homepage +- Download \[http://code.google.com/p/pandoc/downloads/list\]\[\] +- Homepage ### TeX @@ -171,9 +173,4 @@ Please use Ruby 1.9.3 Alternatively you can use - - [usbtex][] - - [pandoc]: http://johnmacfarlane.net/pandoc/ - [http://rubyinstaller.org/downloads/]: http://rubyforge.org/frs/%20download.php/76277/rubyinstaller-1.8.7-p370.exe - [DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe]: https://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe - [usbtex]: http://www.exomatik.net/U-Latex/USBTeXEnglish + - [usbtex](http://www.exomatik.net/U-Latex/USBTeXEnglish) diff --git a/Rakefile b/Rakefile index 9c1da54..0b36655 100644 --- a/Rakefile +++ b/Rakefile @@ -9,9 +9,9 @@ desc "Run specs" RSpec::Core::RakeTask.new(:spec, :focus) do |t, args| t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default. if args[:focus] then - usetags="--tag #{args[:focus]}" + usetags="-e #{args[:focus]}" else - usetags="--tag ~exp" + usetags=nil #"--tag ~exp" end t.rspec_opts = [usetags, " -fd -fd --out ./testresults/wortsammler_testresults.log -fh --out ./testresults/wortsammler_testresults.html"] @@ -34,7 +34,7 @@ end desc "get the default stylefiles from pandoc" task :getpandocstyles do - [:latex, :docx, :html, :epub].each{|format |sh "pandoc -D #{format} > resources/pandocdefault.#{format}"} + [:latex, :docx, :html, :epub].each{|format |sh "pandoc_2.0.5 -D #{format} > resources/pandocdefault.#{format}"} end desc "run tests" diff --git a/changelog.md b/changelog.md index f9d230c..0a35c40 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,22 @@ +# 2.0.0.dev.1 + +- now use pandoc 2.0.5 (requires pandoc_2.0.5 on path) +- tested with ruby 2.4.3 + +## BWC issues + +- install pandoc 2.0.5 best from zip file +- ensure that pandoc_2.0.5 is on your path +- adapt your latex-styles accordingly (add definition for \tightlist) +- pandoc no longer mangles undescore (`_`) in labels when producing + latex. If you use `\ref{T01ux5fnumber}` you can now go back to + `\ref{T01_number}` + # 1.0.2 (27.03.2017) + - fix plantuml handling with pandoc 1.13 -- prefix header labels with filename to avoid conflicts in merged files +- prefix header labels with filename to avoid conflicts in merged + files # 1.0.1 (12.09.2016) diff --git a/lib/wortsammler.rb b/lib/wortsammler.rb index 5f172ee..f9fbd3b 100644 --- a/lib/wortsammler.rb +++ b/lib/wortsammler.rb @@ -33,8 +33,8 @@ def self.execute(options) if options[:version] then puts "this is #{Wortsammler::PROGNAME} version #{Wortsammler::VERSION}\n" - pandoc=`pandoc -v`.split("\n")[0] rescue pandoc="error running pandoc" - xetex=`xelatex -v`.split("\n")[0] rescue pandoc="error running xelatex" + pandoc=`#{PANDOC_EXE} -v`.split("\n")[0] rescue pandoc="error running pandoc" + xetex=`#{LATEX_EXE} -v`.split("\n")[0] rescue pandoc="error running xelatex" $log.info "found #{pandoc}" $log.info "found #{xetex}" @@ -43,7 +43,7 @@ def self.execute(options) l= "-----------------" $log.info l - options.each {|k,v| $log.info "#{k}: #{v}"} + options.each { |k, v| $log.info "#{k}: #{v}" } $log.info l end @@ -61,11 +61,11 @@ def self.execute(options) ## # - # load the manifest + # load the manifest or use default configuration # - config=nil + config = ProoConfig.new(); if config_file=options[:manifest] then - config = ProoConfig.new(config_file) + config.load_from_file(config_file) end ## @@ -78,7 +78,7 @@ def self.execute(options) $log.error "path does not exist path '#{inputpath}'" exit(false) end - if File.file?(inputpath) #(RS_Mdc) + if File.file?(inputpath) #(RS_Mdc) input_files=[inputpath] elsif File.exists?(inputpath) input_files=Dir["#{inputpath}/**/*.md", "#{inputpath}/**/*.markdown", "#{inputpath}/**/*.plantuml"] @@ -93,17 +93,14 @@ def self.execute(options) if options[:beautify] - # process path - if input_files then - Wortsammler.beautify(input_files) + Wortsammler.beautify(input_files, config) end # process manifest - - if config then - Wortsammler.beautify(config.input) + if config.input then + Wortsammler.beautify(config.input, config) end unless input_files or config @@ -119,27 +116,24 @@ def self.execute(options) if options[:plantuml] - # process path - if input_files then Wortsammler.plantuml(input_files) end # process manifest - if config then + if config.input then Wortsammler.plantuml(config.input) end - unless input_files or config + unless input_files or config.input $log.error "no input specified. Please use -m or -i to specify input" exit false end end - ## # process collect in markdown files # @@ -154,18 +148,17 @@ def self.execute(options) # collect by manifest - if config then + if config.input then Wortsammler.collect_traces(config) end - unless input_files or config + unless input_files or config.input $log.error "no input specified. Please use -m or -i to specify input" exit false end end - ## # process files # @@ -189,12 +182,12 @@ def self.execute(options) FileUtils.mkdir_p(outputfolder) end - input_files.each{|f| Wortsammler.render_single_document(f, outputfolder, outputformats)} + input_files.each { |f| Wortsammler.render_single_document(f, outputfolder, outputformats, config) } end # collect by manifest - if config then + if config.input then Wortsammler.process(config) end @@ -205,19 +198,23 @@ def self.execute(options) end nil - end #execute + end + + #execute # # beautify a list of Documents # @param paths [Array of String] Array of filenames which shall be cleaned. + # @param [ProoConfig] config # # @return [Nil] no return - def self.beautify(paths) + def self.beautify(paths, config=nil) cleaner = PandocBeautifier.new($log) + cleaner.config = config if config - paths.each{|f| cleaner.beautify(f)} + paths.each { |f| cleaner.beautify(f) } nil end @@ -225,16 +222,16 @@ def self.beautify(paths) # # plantuml a list of Documents # @param paths [Array of String] Array of filenames which shall be converted. + # @param [ProoConfig] config # # @return [Nil] no return def self.plantuml(paths) - cleaner = PandocBeautifier.new($log) plantumljar=File.dirname(__FILE__)+"/../resources/plantuml.jar" - paths.each{|f| - cmd = "java -jar \"#{plantumljar}\" -v \"#{f}\" 2>&1" - r=`#{cmd}` + paths.each { |f| + cmd = "java -jar \"#{plantumljar}\" -v \"#{f}\" 2>&1" + r =`#{cmd}` no_of_images = r.split($/).grep(/Number of image/).first.split(":")[1] $log.info("#{no_of_images} uml diagram(s) in #{File.basename(f)}") @@ -245,13 +242,14 @@ def self.plantuml(paths) # - # process the documents according to the maanifest + # process the documents according to the manifest # # @param config [ProoConfig] A configuration object representing the manifest. # # @return [Nil] no return def self.process(config) cleaner = PandocBeautifier.new($log) + cleaner.config = config cleaner.generateDocument(config.input, config.outdir, @@ -272,13 +270,15 @@ def self.process(config) # render a single document # @param filename [String] The filename of the document file which shall be rendered # @param outputfolder [String] The path to the outputfolder where the output files shall be placed. + # @param [ProoConfig] config # # # @param outputformats [Array of String] The list of formats which shall be produced # # @return [Nil] no return - def self.render_single_document(filename, outputfolder, outputformats) + def self.render_single_document(filename, outputfolder, outputformats, config=nil) cleaner = PandocBeautifier.new($log) + cleaner.config = config if config cleaner.render_single_document(filename, outputfolder, outputformats) nil end @@ -299,14 +299,14 @@ def self.init_folders(root) "ZGEN_RequirementsTracing", "001_Main", "900_snippets" - ] + ] - folders.each{|folder| + folders.each { |folder| FileUtils.mkdir_p("#{root}/#{folder}") } resourcedir=File.dirname(__FILE__)+"/../resources" - Dir["#{resourcedir}/*.yaml"].each{|f| + Dir["#{resourcedir}/*.yaml"].each { |f| FileUtils.cp(f, "#{root}/ZSUPP_Manifests") } FileUtils.cp("#{resourcedir}/main.md", "#{root}/001_Main") @@ -326,17 +326,17 @@ def self.init_folders(root) # @return [Nil] no return def self.collect_traces(config) - files = config.input # get the input files - rootdir = config.rootdir # get the root directory + files = config.input # get the input files + rootdir = config.rootdir # get the root directory downstream_tracefile = config.downstream_tracefile # String to save downstram filenames - reqtracefile_base = config.reqtracefile_base # string to determine the requirements tracing results - upstream_tracefiles = config.upstream_tracefiles # String to read upstream tracefiles + reqtracefile_base = config.reqtracefile_base # string to determine the requirements tracing results + upstream_tracefiles = config.upstream_tracefiles # String to read upstream tracefiles traceable_set = TraceableSet.new # collect all traceables in input - files.each{|f| + files.each { |f| x=TraceableSet.processTracesInMdFile(f) traceable_set.merge(x) } @@ -345,7 +345,7 @@ def self.collect_traces(config) # upstream_traceable_set=TraceableSet.new unless upstream_tracefiles.nil? - upstream_tracefiles.each{|f| + upstream_tracefiles.each { |f| x=TraceableSet.processTracesInMdFile(f) upstream_traceable_set.merge(x) } @@ -363,20 +363,20 @@ def self.collect_traces(config) duplicates=all_traceable_set.duplicate_traces if duplicates.count > 0 $log.warn "duplicated trace ids found:" - duplicates.each{|d| d.each{|t| $log.warn "#{t.id} in #{t.info}"}} + duplicates.each { |d| d.each { |t| $log.warn "#{t.id} in #{t.info}" } } end # write traceables to the intermediate Tracing file - outname="#{rootdir}/#{reqtracefile_base}.md" + outname ="#{rootdir}/#{reqtracefile_base}.md" # poke ths sort order for the traceables all_traceable_set.sort_order=config.traceSortOrder if config.traceSortOrder - traceable_set.sort_order=config.traceSortOrder if config.traceSortOrder + traceable_set.sort_order =config.traceSortOrder if config.traceSortOrder # generate synopsis of traceableruby 1.8.7 garbage at end of file - tracelist="" - File.open(outname, "w"){|fx| + tracelist ="" + File.open(outname, "w") { |fx| fx.puts "" fx.puts "\\clearpage" fx.puts "" @@ -389,14 +389,14 @@ def self.collect_traces(config) # output the graphxml # write traceables to the intermediate Tracing file outname="#{rootdir}/#{reqtracefile_base}.graphml" - File.open(outname, "w") {|fx| fx.puts all_traceable_set.to_graphml} + File.open(outname, "w") { |fx| fx.puts all_traceable_set.to_graphml } outname="#{rootdir}/#{reqtracefile_base}Compare.txt" - File.open(outname, "w") {|fx| fx.puts traceable_set.to_compareEntries} + File.open(outname, "w") { |fx| fx.puts traceable_set.to_compareEntries } # write the downstream_trace file - to be included in downstream - speciifcations outname="#{rootdir}/#{downstream_tracefile}" - File.open(outname, "w") {|fx| + File.open(outname, "w") { |fx| fx.puts "" fx.puts "\\clearpage" fx.puts "" @@ -407,7 +407,7 @@ def self.collect_traces(config) # now add the upstream traces to input - files.concat( upstream_tracefiles) unless upstream_tracefiles.nil? + files.concat(upstream_tracefiles) unless upstream_tracefiles.nil? nil end @@ -419,6 +419,14 @@ def self.collect_traces(config) # # @return [Boolean] true if successful. otherwise exits the program def self.verify_options(options) + + if options[:process] or options[:beautify] or options[:coollect] then + unless options[:inputpath] or options[:manifest] then + $log.error "no input specified" + exit false + end + end + if options[:inputpath] or options[:manifest] then unless options[:process] or options[:beautify] or options[:collect] or options[:plantuml] then $log.error "no procesing option (p, b, c, u) specified" @@ -428,10 +436,10 @@ def self.verify_options(options) unless options[:outputfolder] then outputfolder="." - inputpath=options[:inputpath] + inputpath =options[:inputpath] unless inputpath.nil? then - outputfolder = inputpath if File.directory?(inputpath) - outputfolder = File.dirname(inputpath) if File.file?(inputpath) + outputfolder = inputpath if File.directory?(inputpath) + outputfolder = File.dirname(inputpath) if File.file?(inputpath) end options[:outputfolder] = outputfolder end @@ -447,5 +455,4 @@ def self.verify_options(options) end #verify_options - end # module \ No newline at end of file diff --git a/lib/wortsammler/class.Traceable.md.rb b/lib/wortsammler/class.Traceable.md.rb index d3cd042..d1acc3d 100644 --- a/lib/wortsammler/class.Traceable.md.rb +++ b/lib/wortsammler/class.Traceable.md.rb @@ -3,7 +3,7 @@ # #require 'ruby-debug' if not RUBY_PLATFORM=="i386-mingw32" require 'treetop' -require File.dirname(__FILE__) + "/class.treetophelper" +require File.dirname(__FILE__) + "/class.treetopHelper" require File.dirname(__FILE__) + "/class.Traceable" require File.dirname(__FILE__) + "/class.Traceable.md" @@ -13,6 +13,10 @@ class TraceableSet + def mk_hyperlink(id) + idm = id.gsub("_","-") + "[\[#{id}\]](#RT-#{idm})" + end # this generates a synopsis of traces in markdown Format # @param [Symbol] selectedCategory the the category of the Traceables @@ -23,20 +27,18 @@ def reqtraceSynopsis(selectedCategory) map{|t| tidm=t.id.gsub("_","-") - lContributes=t.contributes_to. - # map{|c| cm=c.gsub("_","-"); "[\[#{c}\]](#RT-#{cm})"} - map{|c| cm=c.gsub("_","-"); "\[#{c}\]"} + lContributes = t.contributes_to. + map { |c| mk_hyperlink(c) } luptraces = [uptrace_ids[t.id]].flatten.compact.map{|x| self[x]} luptraces=luptraces. sort_by{|x| trace_order_index(x.id)}. map{|u| - um = u.id.gsub("_","-") - " - [#{u.id}] #{u.header_orig}" + " - #{mk_hyperlink(u.id)} #{u.header_orig}" } - ["- ->[#{t.id}] **#{t.header_orig}**" + + ["- #{mk_hyperlink(t.id)} **#{t.header_orig}**" + # " (#{t.contributes_to.join(', ')})", "", " (#{lContributes.join(', ')})", "", luptraces @@ -50,7 +52,7 @@ def to_downstream_tracefile(selectedCategory) all_traces(selectedCategory). sort_by{|x| trace_order_index(x.id) }. map{|t| - "\n\n[#{t.id}] **#{t.header_orig}** { }()" + "\n\n\\[#{t.id}\\] **#{t.header_orig}** { }()" }.join("\n\n") end diff --git a/lib/wortsammler/class.Traceable.rb b/lib/wortsammler/class.Traceable.rb index 6778c06..0d7def9 100644 --- a/lib/wortsammler/class.Traceable.rb +++ b/lib/wortsammler/class.Traceable.rb @@ -23,16 +23,16 @@ class TraceableSet # @return [type] [description] def initialize() # the traces - @traces={} + @traces = {} # the list of supporters # supporters for foo 0 @@supported_by["foo"] - @supported_by={} + @supported_by = {} # define the sort order policy # it is the same for all slots - @sortOrder=[] + @sortOrder = [] end @@ -63,7 +63,7 @@ def add(traceable) # @param category [Symbol] Restrict the comparison to a particlar category # # @return [Array] the ids of the added traces (list of trace_id which are not in @referece_set) - def added_trace_ids(reference_set, category=nil) + def added_trace_ids(reference_set, category = nil) self.all_trace_ids(category) - reference_set.all_trace_ids(category) end @@ -74,9 +74,9 @@ def added_trace_ids(reference_set, category=nil) # @param category [Symbol] Restrict the operation to traceables of this category. # # @return [Array] List of trace_id which changed not in reference_set - def changed_trace_ids(reference_set, category=nil) - candidates=self.all_trace_ids(category) & reference_set.all_trace_ids(category) - candidates.map{|candidate| + def changed_trace_ids(reference_set, category = nil) + candidates = self.all_trace_ids(category) & reference_set.all_trace_ids(category) + candidates.map { |candidate| self[candidate].get_diff(reference_set[candidate]) }.compact end @@ -87,9 +87,9 @@ def changed_trace_ids(reference_set, category=nil) # @param category [Symbol] Restrict the operation to traceables of this category. # # @return [Array] List of trace_id which unchanged - def unchanged_trace_ids(reference_set, category=nil) - candidates=self.all_trace_ids(category) & reference_set.all_trace_ids(category) - candidates.select{|candidate| + def unchanged_trace_ids(reference_set, category = nil) + candidates = self.all_trace_ids(category) & reference_set.all_trace_ids(category) + candidates.select { |candidate| self[candidate].get_diff(reference_set[candidate]).nil? }.compact end @@ -101,7 +101,7 @@ def unchanged_trace_ids(reference_set, category=nil) # @param category [Symbol] Restrict the operation to traceables of this category. # # @return [Array] List of trace_id which are deleted (not in current set) - def deleted_trace_ids(reference_set, category=nil) + def deleted_trace_ids(reference_set, category = nil) reference_set.all_trace_ids(category) - self.all_trace_ids(category) end @@ -109,31 +109,31 @@ def deleted_trace_ids(reference_set, category=nil) # export the trace as graphml for yed # @return - the requirements tree in graphml def to_graphml - f = File.open("#{File.dirname(__FILE__)}/../../resources/requirementsSynopsis.graphml") + f = File.open("#{File.dirname(__FILE__)}/../../resources/requirementsSynopsis.graphml") doc = Nokogiri::XML(f) f.close - graph=doc.xpath("//xmlns:graph").first + graph = doc.xpath("//xmlns:graph").first # generate all nodes - self.all_traces(nil).each{|theTrace| - n_node = Nokogiri::XML::Node.new "node", doc - n_node["id"] = theTrace.id - n_data = Nokogiri::XML::Node.new "data", doc - n_data["key"]= "d6" - n_ShapeNode = Nokogiri::XML::Node.new "y:ShapeNode", doc - n_NodeLabel = Nokogiri::XML::Node.new "y:NodeLabel", doc + self.all_traces(nil).each { |theTrace| + n_node = Nokogiri::XML::Node.new "node", doc + n_node["id"] = theTrace.id + n_data = Nokogiri::XML::Node.new "data", doc + n_data["key"] = "d6" + n_ShapeNode = Nokogiri::XML::Node.new "y:ShapeNode", doc + n_NodeLabel = Nokogiri::XML::Node.new "y:NodeLabel", doc n_NodeLabel.content = "[#{theTrace.id}] #{theTrace.header_orig}" n_ShapeNode << n_NodeLabel n_data << n_ShapeNode n_node << n_data graph << n_node - theTrace.contributes_to.each{|up| - n_edge=Nokogiri::XML::Node.new "edge", doc - n_edge["source" ] = theTrace.id - n_edge["target" ] = up - n_edge["id" ] = "#{up}_#{theTrace.id}" + theTrace.contributes_to.each { |up| + n_edge = Nokogiri::XML::Node.new "edge", doc + n_edge["source"] = theTrace.id + n_edge["target"] = up + n_edge["id"] = "#{up}_#{theTrace.id}" graph << n_edge } } @@ -146,7 +146,7 @@ def to_graphml # @return [Array of String] an array of the registered Traceables # of the selectedCategory def all_trace_ids(selected_category = nil) - @traces.keys.select{|x| + @traces.keys.select { |x| y = @traces[x].first selected_category.nil? or y.category == selected_category }.sort @@ -161,7 +161,7 @@ def all_trace_ids(selected_category = nil) # # @return [Array of Traceable] The array of traceables def all_traces(selected_category = nil) - all_trace_ids(selected_category).map{|t| @traces[t].first} + all_trace_ids(selected_category).map { |t| @traces[t].first } end @@ -187,43 +187,43 @@ def [] (id) # this lists duplicate traces # @return [Array of String] the list of the id of duplicate Traces def duplicate_ids() - @traces.select{|id, traceables| traceables.length > 1}.map{|id, traceable| id}.sort + @traces.select { |id, traceables| traceables.length > 1 }.map { |id, traceable| id }.sort end # this lists duplicate traces # @return [Array of Traceable] the list duplicate Traces. def duplicate_traces() - @traces.select{|id, traceables| traceables.length > 1}.map{|id, traceable| traceable}.sort + @traces.select { |id, traceables| traceables.length > 1 }.map { |id, traceable| traceable }.sort end # this serializes a particular slot for caching # @param file [String] name of the cachefile def dump_to_marshal(file) - File.open(file, "wb"){|f| + File.open(file, "wb") { |f| Marshal.dump(self, f) } end # this loads cached information into a particular slot # @param file [String] name of the cachefile - def self.load_from_marshal(file) - a=nil - File.open(file, "rb"){|f| a=Marshal.load(f)} + def self.load_from_marshal(file) + a = nil + File.open(file, "rb") { |f| a = Marshal.load(f) } a end # this merges a TraceableSet # @return [Treaceable] the current traceable set def merge(set) - set.all_traces_as_arrays.values.flatten.each{|t| self.add(t)} + set.all_traces_as_arrays.values.flatten.each { |t| self.add(t) } end # this retunrs traces marked as supported but not being defined # @return [Array of String] the list of the id of undefined Traces # traces which are marked as uptraces but do not exist. def undefined_ids - @supported_by.keys.select{|t| not @traces.has_key?(t)}.sort + @supported_by.keys.select { |t| not @traces.has_key?(t) }.sort end # @@ -243,7 +243,7 @@ def uptrace_ids # it is placed according to the sequence # in the array. Otherwise it is sorted at the end def sort_order= (sort_order) - @sort_order=sort_order + @sort_order = sort_order end # this determines the sort order index of a trace @@ -252,11 +252,11 @@ def sort_order= (sort_order) # the sort order index shall be coumputed. # @return [String] the sort key of the given id. def trace_order_index(trace_id) - global=@sort_order.index{|x| trace_id.start_with? x} || - (@sort_order.length+1) + global = @sort_order.index { |x| trace_id.start_with? x } || + (@sort_order.length + 1) # add the {index} of the trace to - orderId = [global.to_s.rjust(5,"0"),trace_id].join("_") + orderId = [global.to_s.rjust(5, "0"), trace_id].join("_") orderId end @@ -272,11 +272,10 @@ def trace_order_index(trace_id) # # @return [type] [description] def to_compareEntries - all_traces.sort.map{|t| "\n\n[#{t.id}]\n#{t.as_oneline}" }.join("\n") + all_traces.sort.map { |t| "\n\n[#{t.id}]\n#{t.as_oneline}" }.join("\n") end - ############################# private @@ -286,7 +285,7 @@ def to_compareEntries # @param [Nokogiri::XML::Document] doc - the document # @return [Nokogiri::XML::Document] the beautified document def xp(doc) - xsl =<<-XSL + xsl = <<-XSL @@ -307,16 +306,19 @@ def xp(doc) end +class Traceable + def clear_trace_id(id) + id.gsub("\\_", "_") + end -class Traceable include Comparable # String: The trace-Id - attr_accessor :id + attr_reader :id # string: the alternative Id, used e.g. for the constraint number - attr_accessor :alternative_id + attr_reader :alternative_id # String: The header in plain text attr_accessor :header_plain # String: The header in original format @@ -326,7 +328,7 @@ class Traceable # String: he body in original format attr_accessor :body_orig # Array of Strings: The uplink as an array of Trace-ids - attr_accessor :contributes_to + attr_reader :contributes_to # String: the Traceable in its original format attr_accessor :trace_orig # String: origin of the entry @@ -338,18 +340,30 @@ class Traceable def initialize() - @id = "" + @id = "" @alternative_id = "" - @header_orig = "" - @body_plain = "" - @body_orig = "" + @header_orig = "" + @body_plain = "" + @body_orig = "" @contributes_to = [] - @trace_orig = "" - @category = "" - @info = "" + @trace_orig = "" + @category = "" + @info = "" + end + + def id=(id) + @id = clear_trace_id(id) + end + + def alternative_id=() + @alternative_id = clear_trace_id(id) + end + + def contributes_to=(list) + @contributes_to = list.map { |id| id = clear_trace_id(id) } end - # define the comparison to makeit really comaprable + # define the comparison to makeit really comparable # @param [Traceable] other the other traceable for comparison. def <=> (other) @id <=> other.id @@ -366,19 +380,19 @@ def get_diff(other) if newval == oldval result = nil else - diff_as_html= "
#{other.trace_orig}

#{self.trace_orig}
"#Diffy::Diff.new(other.trace_orig, self.trace_orig).to_s(:text) - rawDiff = Diffy::Diff.new(self.trace_orig, other.trace_orig) - diff_as_html=rawDiff.to_s(:html) + diff_as_html = "
#{other.trace_orig}

#{self.trace_orig}
" #Diffy::Diff.new(other.trace_orig, self.trace_orig).to_s(:text) + rawDiff = Diffy::Diff.new(self.trace_orig, other.trace_orig) + diff_as_html = rawDiff.to_s(:html) - result = [self.id, similarity, diff_as_html] - diff_as_html=nil + result = [self.id, similarity, diff_as_html] + diff_as_html = nil end result end def get_comparison_string - "#{header_orig};#{body_orig};#{contributes_to.sort}".gsub(/\s+/," ") + "#{header_orig};#{body_orig};#{contributes_to.sort}".gsub(/\s+/, " ") end def as_oneline diff --git a/lib/wortsammler/class.proolib.rb b/lib/wortsammler/class.proolib.rb index 0adaa60..2041829 100644 --- a/lib/wortsammler/class.proolib.rb +++ b/lib/wortsammler/class.proolib.rb @@ -1,982 +1,1102 @@ -# -# This script converts the trace-References in a markdown file -# to hot references. -# -# usage prepareTracingInPandoc -# -# Traces are formatted according to [RS_DM_008]. -# -# Trace itself becomes the target, uptraces are converted to references. -# -# Traces can also be referenced by -# -# -require 'rubygems' -require 'yaml' -require 'tmpdir' -require 'nokogiri' -require "rubyXL" -require 'logger' -require 'wortsammler/latex_helper' - - -Encoding.default_external = Encoding::UTF_8 -Encoding.default_internal = Encoding::UTF_8 - -# TODO: make these patterns part of the configuration - -ANY_ANCHOR_PATTERN = // -ANY_REF_PATTERN = /([^<]*)<\/a>/ - -TRACE_ANCHOR_PATTERN = /\[(\w+_\w+_\w+)\](\s*\*\*)/ -UPTRACE_REF_PATTERN = /\}\( ((\w+_\w+_\w+) (,\s*\w+_\w+_\w+)*)\)/x -TRACE_REF_PATTERN = /->\[(\w+_\w+_\w+)\]/ - -# filename -# heading -# level -# pages to include -# pageclearance -INCLUDE_PDF_PATTERN = /^\s+~~PDF\s+"(.+)" \s+ "(.+)" \s* (\d*) \s* (\d+-\d+)? \s* (clearpage|cleardoublepage)?~~/x - -INCLUDE_MD_PATTERN = /(\s*)~~MD\s+"(.+)"~~/x - -SNIPPET_PATTERN = /(\s*)~~SN \s+ (\w+)~~/x - -EMBEDDED_IMAGE_PATTERN = /~~EMBED\s+ "(.+)" \s+ (r|l|i|o) \s+ (.+) \s+ (.+)~~/x - -EXPECTED_RESULT_PATTERN = /(^\s*)~~~~\s*\{.expectedResult\s+label=\"([A-Za-z]+_[A-Za-z]+_[0-9]+)\"}\s([^~]*)~~~~/x - -PLANTUML_PATTERN = /[~`]{3,}\s+{\.plantuml}\s+@startuml\s+([^\n]+)(\s+title\s+([^\n]+))?[^~`]+[~`]{3,}/x - -# -# This mixin convertes a file path to the os Path representation -# todo maybe replace this by a builtin ruby stuff such as "pathname" -# -class String - # convert the string to a path notation of the current operating system - def to_osPath - gsub(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR) - end - - # convert the string to a path notation of ruby. - def to_rubyPath - gsub(File::ALT_SEPARATOR || File::SEPARATOR, File::SEPARATOR) - end - - # adding quotes around the string. Main purpose is to escape blanks - # in file paths. - def esc - "\"#{self}\"" - end -end - - - -# -# This class provides methods to tweak the reference according to the -# target document format -# -# -class ReferenceTweaker - - #This attribute keeps the target format - attr_accessor :target, :log - - - private - - # this prepares the reference in the target format - # - # :string: the Id of the referenced Traceable - def prepareTraceReferences(string) - result=string.gsub(/\s*/,"").split(",").map{|trace| - itrace = mkInternalTraceId(trace) - texTrace = mkTexTraceDisplay(trace) - if @target == "pdf" then - "\\hyperlink{#{itrace}}{#{texTrace}}" - else - "[#{trace}](\##{itrace})" - end - } - result.join(", ") - end - - - # - # [prepareExpectedResults description] - # @param label [type] [description] - # @param body [type] [description] - # - # @return [type] [description] - def prepareExpectedResults(indent="", original_label, body) - result_items=body.split("- ")[1..-1].map{|i|i.strip} - result= ["\\begin{Form}"] - - label=original_label.gsub(/_/, "-") - j="00" - result << result_items.map{|i| - j = j.next - "\\CheckBox[name=#{label}-#{j}]{} #{i}" - } - result << "\\vspace{1em}" - result << "\\ChoiceMenu[combo, name=#{label}-verdict, default=none]{Test verdict:}{none, ok-30, ok-60, ok, fail, pending}" - result << "\\vspace{1em}" - result << ["\\TextField[ name=#{label}-comment , width=40em, height=2cm, multiline=true, backgroundcolor={0.9 0.9 0.9}] {}"] - result << ["\\end{Form}"] - - unless $1.nil? then - leading_whitespace=$1.split("\n",100) - leading_lines=leading_whitespace[0..-1].join("\n") - leading_spaces=leading_whitespace.last || "" - replacetext=leading_lines+replacetext_raw.gsub("\n", "\n#{leading_spaces}") - end - - result=result.compact.flatten.map{|i|"#{indent}#{i}"} - result.join("\n#{indent}\n") - end - - # this tweaks the reference-Id to be comaptible as TeX label - # private methd - def mkInternalTraceId(string) - string.gsub("_","-") - end - - # this tweaks the reference-id to be displayed in TeX - # private method - def mkTexTraceDisplay(trace) - trace.gsub("_", "\\_") - end - - - - # - # This replaces markdown inlays - # it is a subroutine which is called - # recursively - # todo: handle indentation - # - # @param text [String] text in which the markdown inlays shall be processed - # @return [String] The resulting text - def replace_md_inlay(text) - text.gsub!(INCLUDE_MD_PATTERN){|m| - if File.exist?($2) then - replacetext_raw=File.open($2,:encoding => 'bom|utf-8').read - unless $1.nil? then - leading_whitespace=$1.split("\n",100) - leading_lines=leading_whitespace[0..-1].join("\n") - leading_spaces=leading_whitespace.last || "" - replacetext=leading_lines+replacetext_raw.gsub("\n", "\n#{leading_spaces}") - end - else - replacetext="" - @log.warn("File not found: #{$2}") - end - result=replace_md_inlay(replacetext) - result - } - text - end - - public - - # constructor - # :target: the target format - # in which the referneces shall be represented - #todo: improve logger approach - def initialize(target, logger=nil) - @target=target - - @log=logger || $logger || nil - - if @log == nil - @log = Logger.new(STDOUT) - @log.level = Logger::INFO - @log.datetime_format = "%Y-%m-%d %H:%M:%S" - @log.formatter = proc do |severity, datetime, progname, msg| - "#{datetime}: #{msg}\n" - end - end - end - - # this does the postprocessing - # of the file - # in particluar handle wortsammler's specific syntax. - def prepareFile(infile, outfile) - - infileIo=File.new(infile) - text = infileIo.readlines.join - infileIo.close - - #include pdf files - - if @target == "pdf" - text.gsub!(INCLUDE_PDF_PATTERN){|m| - - if $4 - pages="[pages=#{$4}]" - else - pages="" - end - - if $5 - clearpage=$5 - else - clearpage="cleardoublepage" - end - - if $3.length > 0 - level=$3 - else - level=9 - end - - "\n\n\\#{clearpage}\n\\bookmark[level=#{level},page=\\thepage]{#{$2}}\n\\includepdf#{pages}{#{$1}}" - } - else #if not pdf then it gets a regular external link - text.gsub!(INCLUDE_PDF_PATTERN){|m| - "[#{$2}](#{$1})" - } - end - - # include Markdown files - # - # - text = replace_md_inlay(text) - - - # embed images - # - if @target == "pdf" - text.gsub!(EMBEDDED_IMAGE_PATTERN){|m| - "\\wsembedimage{#{$1}}{#{$2}}{#{$3}}{#{$4}}" - } - else #if not pdf then it gets a regular image - text.gsub!(EMBEDDED_IMAGE_PATTERN){|m| - "![#{$1}](#{$1})" - } - end - - #inject the anchors for references to traces ->[traceid] - if @target == "pdf" then - text.gsub!(TRACE_ANCHOR_PATTERN){|m| "[#{$1}]#{$2}\\hypertarget{#{mkInternalTraceId($1)}}{}"} - else - text.gsub!(TRACE_ANCHOR_PATTERN){|m| "
[#{$1}]#{$2}"} - end - - #substitute arbitrary anchors for arbitrary targets - if @target == "pdf" then - text.gsub!(ANY_ANCHOR_PATTERN){|m| "\\hypertarget{#{mkInternalTraceId($1)}}{}"} - else - # it is already html - end - - #substitute arbitrary document internal references - if @target == "pdf" then - text.gsub!(ANY_REF_PATTERN){|m| "\\hyperlink{#{$1}}{#{mkTexTraceDisplay($2)}}"} - else - # it is already html - end - - # substitute the uptrace references - text.gsub!(UPTRACE_REF_PATTERN){|m| "}(#{prepareTraceReferences($1)})"} - - # substitute the informal trace references - text.gsub!(TRACE_REF_PATTERN){|m| "[#{prepareTraceReferences($1)}]"} - - - # substitute expected Results - # - # - if @target == "pdf" then - text.gsub!(EXPECTED_RESULT_PATTERN){|m| "#{prepareExpectedResults($1, $2, $3)}"} - else - # it is already leave it as it is - end - - # substitute plantuml - # - # note this is substituted in any case - # - #if @target == "pdf" then - text.gsub!(PLANTUML_PATTERN){|m| ""} - - #else - # it is already leave it as it is - #end - - File.open(outfile, "w"){|f| f.puts(text)} - end -end - - - -# -# This class handles the configuration of WortSammler framework -# - -class ProoConfig - attr_reader :input, # An array with the input filenames - :outdir, # directory where to place the output files - :outname, # basis to determine the output files - :format, # array of output formats - :traceSortOrder, # Array of strings to determine the sort ord - :vars, # hash of variables for pandoc - :editions, # hash of editions for pandoc - :snippets, # Array of strings to determine snippet filenames - :upstream_tracefiles, # Array of strings to determine upstream tracefile names - :downstream_tracefile, # String to save downstram filename - :reqtracefile_base, # string to determine the requirements tracing results - :frontmatter, # Array of string to determine input filenames of frontmatter - :rootdir, # String directory of the configuration file - :stylefiles # Hash of stylefiles path to pandoc latex style file - - - # constructor - # @param [String] configFileName name of the configfile (without .yaml) - # @param [Symbol] configSelect Default configuration. If not specified - # the very first entry in the config file - # will apply. - # TODO: not yet implemented. - # @return [ProoConfig] instance - def initialize(configFileName, configSelect=nil) - begin - config = YAML.load(File.new(configFileName)) - rescue Exception => e - unless File.exist?(configFileName) then - $log.error "config file not found '#{configFileName}'" - else - $log.error "config file could not be loaded '#{configFileName}'" - if File.directory?(configFileName)then - # note that windows does not disinguish this. - $log.error "#{configFileName} is a directory" - end - $log.error "reason '#{e.message}'" - end - exit(false) - end - - basePath = File.dirname(configFileName) - - # this makes an absolute path based on the absolute path - # of the configuration file - expand_path=lambda do |lf| - File.expand_path("#{basePath}/#{lf}") - end - - - #activeConfigs=config.select{|x| [x[:name]] & ConfigSelet} - - selectedConfig=config.first - #TODO: check the config file - @input = selectedConfig[:input].map{|file| File.expand_path("#{basePath}/#{file}")} - @outdir = File.expand_path("#{basePath}/#{selectedConfig[:outdir]}") - @outname = selectedConfig[:outname] - @format = selectedConfig[:format] - @traceSortOrder = selectedConfig[:traceSortOrder] - @vars = selectedConfig[:vars] || {} - @editions = selectedConfig[:editions] || nil - - @downstream_tracefile = selectedConfig[:downstream_tracefile] || nil - - @reqtracefile_base = selectedConfig[:reqtracefile_base] #todo expand path - - @upstream_tracefiles = selectedConfig[:upstream_tracefiles] || nil - @upstream_tracefiles = @upstream_tracefiles.map{|file| File.expand_path("#{basePath}/#{file}")} unless @upstream_tracefiles.nil? - @frontmatter = selectedConfig[:frontmatter] || nil - @frontmatter = selectedConfig[:frontmatter].map{|file| File.expand_path("#{basePath}/#{file}")} unless @frontmatter.nil? - @rootdir = basePath - - stylefiles = selectedConfig[:stylefiles] || nil - if stylefiles.nil? - @stylefiles = { - :latex => expand_path.call("../ZSUPP_Styles/default.latex"), - :docx => expand_path.call("../ZSUPP_Styles/default.docx"), - :html => expand_path.call("../ZSUPP_Styles/default.css") - } - else - @stylefiles = stylefiles.map{ |key,value| {key => expand_path.call(value)} }.reduce(:merge) - end - - snippets = selectedConfig[:snippets] - if snippets.nil? - @snippets = nil - else - @snippets = snippets.map{|file| File.expand_path("#{basePath}/#{file}")} - end - end -end - - -# -# This class provides the major functionalites -# -# Note that it is called PandocBeautifier for historical reasons -# -# provides methods to Process a pandoc file -# - -class PandocBeautifier - - attr_accessor :log - - # the constructor - # @param [Logger] logger logger object to be applied. - # if none is specified, a default logger - # will be implemented - - def initialize(logger=nil) - - @view_pattern = /~~ED((\s*(\w+))*)~~/ - # @view_pattern = /<\?ED((\s*(\w+))*)\?>/ - @tempdir = Dir.mktmpdir - - @log=logger || $logger || nil - - if @log == nil - @log = Logger.new(STDOUT) - @log.level = Logger::INFO - @log.datetime_format = "%Y-%m-%d %H:%M:%S" - @log.formatter = proc do |severity, datetime, progname, msg| - "#{datetime}: #{msg}\n" - end - - end - end - - - - # - - # This checks if an appropriate pandoc version can be - # started on the machine - - # - - # @return [boolean] true if an appropriate version is available - def check_pandoc_version - required_version_string="1.11" - begin - pandoc_version=`pandoc -v`.split("\n").first.split(" ")[1] - if pandoc_version < required_version_string then - @log.error "found pandoc #{pandoc_version} need #{required_version_string}" - result = false - else - result = true - end - rescue Exception => e - @log.error("could not run pandoc: #{e.message}") - result=false - end - result - end - - # perform the beautify - # * process the file with pandoc - # * revoke some quotes introduced by pandoc - # @param [String] file the name of the file to be beautified - def beautify(file) - - @log.debug(" Cleaning: \"#{file}\"") - - docfile = File.new(file) - olddoc = docfile.readlines.join - docfile.close - - # process the file in pandoc - cmd="pandoc -s #{file.esc} -f markdown -t markdown --atx-headers --id-prefix=#{File.basename(file).esc}_ " - newdoc = `#{cmd}` - @log.debug "beautify #{file.esc}: #{$?}" - @log.debug(" finished: \"#{file}\"") - - # tweak the quoting - if $?.success? then - # do this twice since the replacement - # does not work on e.g. 2\_3\_4\_5. - # - newdoc.gsub!(/(\w)\\_(\w)/, '\1_\2') - newdoc.gsub!(/(\w)\\_(\w)/, '\1_\2') - - # fix more quoting - newdoc.gsub!('-\\>[', '->[') - - # (RS_Mdc) - # TODO: fix Table width toggles sometimes - if (not olddoc == newdoc) then ##only touch the file if it is really changed - File.open(file, "w"){|f| f.puts(newdoc)} - File.open(file+".bak", "w"){|f| f.puts(olddoc)} # (RS_Mdc_) # remove this if needed - @log.debug(" cleaned: \"#{file}\"") - else - @log.debug("was clean: \"#{file}\"") - end - #TODO: error handling here - else - @log.error("error calling pandoc - please watch the screen output") - end - end - - - # this replaces the text snippets in files - def replace_snippets_in_file(infile, snippets) - input_data = File.open(infile){|f| f.readlines.join} - output_data=input_data.clone - - @log.debug("replacing snippets in #{infile}") - - replace_snippets_in_text(output_data, snippets) - - if (not input_data == output_data) - File.open(infile, "w"){|f| f.puts output_data} - end - end - - # this replaces the snippets in a text - def replace_snippets_in_text(text, snippets) - changed=false - text.gsub!(SNIPPET_PATTERN){|m| - replacetext_raw=snippets[$2.to_sym] - - if replacetext_raw - changed=true - unless $1.nil? then - leading_whitespace=$1.split("\n",100) - leading_lines=leading_whitespace[0..-1].join("\n") - leading_spaces=leading_whitespace.last || "" - replacetext=leading_lines+replacetext_raw.gsub("\n", "\n#{leading_spaces}") - end - @log.debug("replaced snippet #{$2} with #{replacetext}") - else - replacetext=m - @log.warn("Snippet not found: #{$2}") - end - replacetext - } - #recursively process nested snippets - #todo: this approach might rais undefined snippets twice if there are defined and undefined ones - replace_snippets_in_text(text, snippets) if changed==true - end - - - # - # Ths determines the view filter - # - # @param [String] line - the current input line - # @param [String] view - the currently selected view - # - # @return true/false if a view-command is found, else nil - def get_filter_command(line, view) - r = line.match(@view_pattern) - - if not r.nil? - found = r[1].split(" ") - result = (found & [view, "all"].flatten).any? - else - result = nil - end - - result - end - - # - # This filters the document according to the target audience - # - # @param [String] inputfile name of inputfile - # @param [String] outputfile name of outputfile - # @param [String] view - name of intended view - - def filter_document_variant(inputfile, outputfile, view) - - input_data = File.open(inputfile){|f| f.readlines} - - output_data = Array.new - is_active = true - input_data.each{|l| - switch=self.get_filter_command(l, view) - l.gsub!(@view_pattern, "") - is_active = switch unless switch.nil? - @log.debug "select edtiion #{view}: #{is_active}: #{l.strip}" - - output_data << l if is_active - } - - File.open(outputfile, "w"){|f| f.puts output_data.join } - end - - # - # This filters the document according to the target audience - # - # @param [String] inputfile name of inputfile - # @param [String] outputfile name of outputfile - # @param [String] view - name of intended view - - def process_debug_info(inputfile, outputfile, view) - - input_data = File.open(inputfile){|f| f.readlines } - - output_data = Array.new - - input_data.each{|l| - l.gsub!(@view_pattern){|p| - if $1.strip == "all" then - color="black" - else - color="red" - end - - "\\color{#{color}}\\rule{2cm}{0.5mm}\\newline\\marginpar{#{$1.strip}}" - - } - - l.gsub!(/todo:|TODO:/){|p| "#{p}\\marginpar{TODO}"} - - output_data << l - } - - File.open(outputfile, "w"){|f| f.puts output_data.join } - end - - - # This compiles the input documents to one single file - # it also beautifies the input files - # - # @param [Array of String] input - the input files to be processed in the given sequence - # @param [String] output - the the name of the output file - def collect_document(input, output) - inputs=input.map{|xx| xx.esc.to_osPath }.join(" ") # qoute cond combine the inputs - inputname=File.basename(input.first) - - #now combine the input files - @log.debug("combining the input files #{inputname} et al") - cmd="pandoc -s -o #{output} --ascii #{inputs}" # note that inputs is already quoted - system(cmd) - if $?.success? then - PandocBeautifier.new().beautify(output) - end - end - - # - # This loads snipptes from xlsx file - # @param [String] file name of the xlsx file - # @return [Hash] a hash with the snippetes - # - def load_snippets_from_xlsx(file) - temp_filename = "#{@tempdir}/snippett.xlsx" - FileUtils::copy(file, temp_filename) - wb=RubyXL::Parser.parse(temp_filename) - result={} - wb.first.each{|row| - key, the_value = row - unless key.nil? - unless the_value.nil? - result[key.value.to_sym] = resolve_xml_entities(the_value.value) rescue "" - end - end - } - result - end - - # - # this resolves xml entities in Text (lt, gt, amp) - # @param [String] text with entities - # @return [String] text with replaced entities - def resolve_xml_entities(text) - result=text - result.gsub!("<", "<") - result.gsub!(">", ">") - result.gsub!("&", "&") - result - end - - # - # This generates the final document - # - # It actually does this in two steps: - # - # 1. process front matter to laTeX - # 2. process documents - # - # @param [Array of String] input the input files to be processed in the given sequence - # @param [String] outdir the output directory - # @param [String] outname the base name of the output file. It is a basename in case the - # output format requires multiple files - # @param [Array of String] format list of formats which shall be generated. - # supported formats: "pdf", "latex", "html", "docx", "rtf", txt - # @param [Hash] vars - the variables passed to pandoc - # @param [Hash] editions - the editions to process; default nil - no edition processing - # @param [Array of String] snippetfiles the list of files containing snippets - # @param [String] frontmatter file path to frontmatter the file to processed as frontmatter - # @param [ProoConfig] config - the configuration file to be used - def generateDocument(input, outdir, outname, format, vars, editions=nil, snippetfiles=nil, frontmatter=nil, config=nil) - - # combine the input files - - temp_filename = "#{@tempdir}/x.md".to_osPath - temp_frontmatter = "#{@tempdir}/xfrontmatter.md".to_osPath unless frontmatter.nil? - collect_document(input, temp_filename) - collect_document(frontmatter, temp_frontmatter) unless frontmatter.nil? - - # process the snippets - - if not snippetfiles.nil? - snippets={} - snippetfiles.each{|f| - if File.exists?(f) - type=File.extname(f) - case type - when ".yaml" - x=YAML.load(File.new(f)) - when ".xlsx" - x=load_snippets_from_xlsx(f) - else - @log.error("Unsupported File format for snipptets: #{type}") - x={} - end - snippets.merge!(x) - else - @log.error("Snippet file not found: #{f}") - end - } - - replace_snippets_in_file(temp_filename, snippets) - end - - vars_frontmatter=vars.clone - vars_frontmatter[:usetoc] = "nousetoc" - - - if editions.nil? - # there are no editions - unless frontmatter.nil? then - render_document(temp_frontmatter, tempdir, temp_frontmatter, ["frontmatter"], vars_frontmatter) - vars[:frontmatter] = "#{tempdir}/#{temp_frontmatter}.latex" - end - render_document(temp_filename, outdir, outname, format, vars, config) - else - # process the editions - editions.each{|edition_name, properties| - edition_out_filename = "#{outname}_#{properties[:filepart]}" - edition_temp_frontmatter = "#{@tempdir}/#{edition_out_filename}_frontmatter.md" unless frontmatter.nil? - edition_temp_filename = "#{@tempdir}/#{edition_out_filename}.md" - vars[:title] = properties[:title] - - if properties[:debug] - process_debug_info(temp_frontmatter, edition_temp_frontmatter, edition_name.to_s) unless frontmatter.nil? - process_debug_info(temp_filename, edition_temp_filename, edition_name.to_s) - lvars=vars.clone - lvars[:linenumbers] = "true" - unless frontmatter.nil? # frontmatter - lvars[:usetoc] = "nousetoc" - render_document(edition_temp_frontmatter, @tempdir, "xfrontmatter", ["frontmatter"], lvars) - lvars[:usetoc] = vars[:usetoc] || "usetoc" - lvars[:frontmatter] = "#{@tempdir}/xfrontmatter.latex" - end - render_document(edition_temp_filename, outdir, edition_out_filename, ["pdf", "latex"], lvars, config) - else - unless frontmatter.nil? # frontmatter - filter_document_variant(temp_frontmatter, edition_temp_frontmatter, edition_name.to_s) - render_document(edition_temp_frontmatter, @tempdir, "xfrontmatter", ["frontmatter"], vars_frontmatter) - vars[:frontmatter]="#{@tempdir}/xfrontmatter.latex" - end - filter_document_variant(temp_filename, edition_temp_filename, edition_name.to_s) - render_document(edition_temp_filename, outdir, edition_out_filename, format, vars, config) - end - } - end - end - - # - - # render a single file - # @param input [String] path to the inputfile - # @param outdir [String] path to the output directory - # @param format [Array of String] formats - # @return [nil] no useful return value - def render_single_document(input, outdir, format) - outname=File.basename(input, ".*") - render_document(input, outdir, outname, format, {:geometry=>"a4paper"}) - end - # - # This renders the final document - # @param [String] input the input file - # @param [String] outdir the output directory - # @param [String] outname the base name of the output file. It is a basename in case the - # output format requires multiple files - # @param [Array of String] format list of formats which shall be generated. - # supported formats: "pdf", "latex", "html", "docx", "rtf", txt - # @param [Hash] vars - the variables passed to pandoc - - # @param config [ProoConfig] the entire config object (for future extensions) - # @return nil - - def render_document(input, outdir, outname, format, vars, config=nil) - - #TODO: Clarify the following - # on Windows, Tempdir contains a drive letter. But drive letter - # seems not to work in pandoc -> pdf if the path separator ist forward - # slash. There are two options to overcome this - # - # 1. set tempdir such that it does not contain a drive letter - # 2. use Dir.mktempdir but ensure that all provided file names - # use the platform specific SEPARATOR - # - # for whatever Reason, I decided for 2. - - tempfile = input - tempfilePdf = "#{@tempdir}/x.TeX.md".to_osPath - tempfileHtml = "#{@tempdir}/x.html.md".to_osPath - outfile = "#{outdir}/#{outname}".to_osPath - outfilePdf = "#{outfile}.pdf" - outfileDocx = "#{outfile}.docx" - outfileHtml = "#{outfile}.html" - outfileRtf = "#{outfile}.rtf" - outfileLatex = "#{outfile}.latex" - outfileText = "#{outfile}.txt" - outfileSlide = "#{outfile}.slide.html" - - if vars.has_key? :frontmatter - latexTitleInclude = "--include-before-body=#{vars[:frontmatter].esc}" - else - latexTitleInclude - end - - #todo: make config required, so it can be reduced to the else part - if config.nil? then - latexStyleFile = File.dirname(File.expand_path(__FILE__))+"/../../resources/default.wortsammler.latex" - latexStyleFile = File.expand_path(latexStyleFile).to_osPath - css_style_file = File.dirname(File.expand_path(__FILE__))+"/../../resources/default.wortsammler.css" - css_style_file = File.expand_path(css_style_file).to_osPath - else - latexStyleFile = config.stylefiles[:latex] - css_style_file = config.stylefiles[:css] - end - - - toc = "--toc" - toc = "" if vars[:usetoc]=="nousetoc" - - if vars[:documentclass]=="book" - option_chapters = "--chapters" - else - option_chapter = "" - end - - begin - vars_string=vars.map.map{|key, value| "-V #{key}=#{value.esc}"}.join(" ") - rescue - require 'pry';binding.pry - end - - @log.info("rendering #{outname} as [#{format.join(', ')}]") - - supported_formats=["pdf", "latex", "frontmatter", "docx", "html", "txt", "rtf", "slide"] - wrong_format=format - supported_formats - wrong_format.each{|f|@log.error("format not supported: #{f}")} - - begin - - if format.include?("frontmatter") then - - ReferenceTweaker.new("pdf").prepareFile(tempfile, tempfilePdf) - - cmd="pandoc -S #{tempfilePdf.esc} --latex-engine xelatex #{vars_string} --ascii -o #{outfileLatex.esc}" - `#{cmd}` - end - - - if (format.include?("pdf") | format.include?("latex")) then - @log.debug("creating #{outfileLatex}") - ReferenceTweaker.new("pdf").prepareFile(tempfile, tempfilePdf) - - cmd="pandoc -S #{tempfilePdf.esc} #{toc} --standalone #{option_chapters} --latex-engine xelatex --number-sections #{vars_string}" + - " --template #{latexStyleFile.esc} --ascii -o #{outfileLatex.esc} #{latexTitleInclude}" - `#{cmd}` - end - - - if format.include?("pdf") then - @log.debug("creating #{outfilePdf}") - ReferenceTweaker.new("pdf").prepareFile(tempfile, tempfilePdf) - #cmd="pandoc -S #{tempfilePdf.esc} #{toc} --standalone #{option_chapters} --latex-engine xelatex --number-sections #{vars_string}" + - # " --template #{latexStyleFile.esc} --ascii -o #{outfilePdf.esc} #{latexTitleInclude}" - cmd="xelatex -halt-on-error -interaction nonstopmode -output-directory=#{outdir.esc} #{outfileLatex.esc}" - #cmdmkindex = "makeindex \"#{outfile.esc}.idx\"" - - latex=LatexHelper.new.set_latex_command(cmd).setlogger(@log) - latex.run(outfileLatex) - - messages=latex.log_analyze("#{outdir}/#{outname}.log") - - removeables = ["toc", "aux", "bak", "idx", "ilg", "ind" ] - removeables << "log" unless messages > 0 - - - removeables << "latex" unless format.include?("latex") - removeables = removeables.map{|e| "#{outdir}/#{outname}.#{e}"}.select{|f| File.exists?(f)} - removeables.each{|e| - @log.debug "removing file: #{e}" - FileUtils.rm e - } - end - - if format.include?("html") then - #todo: handle css - @log.debug("creating #{outfileHtml}") - - ReferenceTweaker.new("html").prepareFile(tempfile, tempfileHtml) - - cmd="pandoc -S #{tempfileHtml.esc} --toc --standalone --self-contained --ascii --number-sections #{vars_string}" + - " -o #{outfileHtml.esc}" - - `#{cmd}` - end - - if format.include?("docx") then - #todo: handle style file - @log.debug("creating #{outfileDocx}") - - ReferenceTweaker.new("html").prepareFile(tempfile, tempfileHtml) - - cmd="pandoc -S #{tempfileHtml.esc} #{toc} --standalone --self-contained --ascii --number-sections #{vars_string}" + - " -o #{outfileDocx.esc}" - cmd="pandoc -S #{tempfileHtml.esc} --toc --standalone --self-contained --ascii --number-sections #{vars_string}" + - " -o #{outfileDocx.esc}" - `#{cmd}` - end - - if format.include?("rtf") then - @log.debug("creating #{outfileRtf}") - ReferenceTweaker.new("html").prepareFile(tempfile, tempfileHtml) - - cmd="pandoc -S #{tempfileHtml.esc} --toc --standalone --self-contained --ascii --number-sections #{vars_string}" + - " -o #{outfileRtf.esc}" - `#{cmd}` - end - - if format.include?("txt") then - @log.debug("creating #{outfileText}") - - ReferenceTweaker.new("pdf").prepareFile(tempfile, tempfileHtml) - - cmd="pandoc -S #{tempfileHtml.esc} --toc --standalone --self-contained --ascii --number-sections #{vars_string}" + - " -t plain -o #{outfileText.esc}" - `#{cmd}` - end - - if format.include?("slide") then - @log.debug("creating #{outfileSlide}") - - ReferenceTweaker.new("slide").prepareFile(tempfile, tempfilePdf) - #todo: hanlde stylefile - cmd="pandoc -S #{tempfileHtml.esc} --toc --standalone --number-sections #{vars_string}" + - " --ascii -t dzslides --slide-level 2 -o #{outfileSlide.esc}" - `#{cmd}` - end - rescue Exception => e - @log.error "failed to perform #{cmd}, \n#{e.message}" - @log.error e.backtrace.join("\n") - #TODO make a try catch block kere - end - nil - end - -end +# +# This script converts the trace-References in a markdown file +# to hot references. +# +# usage prepareTracingInPandoc +# +# Traces are formatted according to [RS_DM_008]. +# +# Trace itself becomes the target, uptraces are converted to references. +# +# Traces can also be referenced by +# +# +require 'rubygems' +require 'yaml' +require 'tmpdir' +require 'nokogiri' +require "rubyXL" +require 'logger' +require 'wortsammler/latex_helper' + + +Encoding.default_external = Encoding::UTF_8 +Encoding.default_internal = Encoding::UTF_8 + +# TODO: make these patterns part of the configuration + +PANDOC_EXE ="pandoc_2.5 " # wat +LATEX_EXE = "xelatex " + +ANY_ANCHOR_PATTERN = // +ANY_REF_PATTERN = /([^<]*)<\/a>/ + +TRACE_ANCHOR_PATTERN = /\[(\w+_\w+_\w+)\](\s*\*\*)/ +UPTRACE_REF_PATTERN = /\}\( ((\w+_\w+_\w+) (,\s*\w+_\w+_\w+)*)\)/x +TRACE_REF_PATTERN = /->\[(\w+_\w+_\w+)\]/ + +# filename +# heading +# level +# pages to include +# pageclearance +INCLUDE_PDF_PATTERN = /^\s+~~PDF\s+"(.+)" \s+ "(.+)" \s* (\d*) \s* (\d+-\d+)? \s* (clearpage|cleardoublepage)?~~/x + +INCLUDE_MD_PATTERN = /(\s*)~~MD\s+\\?"(.+)\\?"~~/x + +SNIPPET_PATTERN = /(\s*)~~SN \s+ (\w+)~~/x + +EMBEDDED_IMAGE_PATTERN = /~~EMBED\s+ "(.+)" \s+ (r|l|i|o) \s+ (.+) \s+ (.+)~~/x + +EXPECTED_RESULT_PATTERN = /(^\s*)[~`]{3,}\s*\{.expectedResult\s+label=\"([A-Za-z]+\\?_[A-Za-z]+\\?_[0-9]+)\"}\s([^~`]+)[~`]{3,}/x + +PLANTUML_PATTERN = /[~`]{3,}\s+{\.plantuml}\s+@startuml\s+([^\n]+)(\s+title\s+([^\n]+))?[^~`]+ v/x + +# +# This mixin convertes a file path to the os Path representation +# todo maybe replace this by a builtin ruby stuff such as "pathname" +# +class String + # convert the string to a path notation of the current operating system + def to_osPath + gsub(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR) + end + + # convert the string to a path notation of ruby. + def to_rubyPath + gsub(File::ALT_SEPARATOR || File::SEPARATOR, File::SEPARATOR) + end + + # adding quotes around the string. Main purpose is to escape blanks + # in file paths. + def esc + "\"#{self}\"" + end +end + + +# +# This class provides methods to tweak the reference according to the +# target document format +# +# +class ReferenceTweaker + + #This attribute keeps the target format + attr_accessor :target, :log + + + private + + # this prepares the reference in the target format + # + # :string: the Id of the referenced Traceable + def prepareTraceReferences(string) + result=string.gsub(/\s*/, "").split(",").map { |trace| + itrace = mkInternalTraceId(trace) + texTrace = mkTexTraceDisplay(trace) + if @target == "pdf" then + "\\hyperlink{#{itrace}}{#{texTrace}}" + else + "[#{trace}](\##{itrace})" + end + } + result.join(", ") + end + + + # + # [prepareExpectedResults description] + # @param label [type] [description] + # @param body [type] [description] + # + # @return [type] [description] + def prepareExpectedResults(indent="", original_label, body) + result_items=body.split("- ")[1..-1].map { |i| i.strip } + result = ["\\begin{Form}"] + + label=original_label.gsub(/_/, "-") + j ="00" + result << result_items.map { |i| + j = j.next + "\\CheckBox[name=#{label}-#{j}]{} #{i}" + } + result << "\\vspace{1em}" + result << "\\ChoiceMenu[combo, name=#{label}-verdict, default=none]{Test verdict:}{none, ok-30, ok-60, ok, fail, pending}" + result << "\\vspace{1em}" + result << ["\\TextField[ name=#{label}-comment , width=40em, height=2cm, multiline=true, backgroundcolor={0.9 0.9 0.9}] {}"] + result << ["\\end{Form}"] + + unless $1.nil? then + leading_whitespace=$1.split("\n", 100) + leading_lines =leading_whitespace[0..-1].join("\n") + leading_spaces =leading_whitespace.last || "" + replacetext =leading_lines+replacetext_raw.gsub("\n", "\n#{leading_spaces}") + end + + result=result.compact.flatten.map { |i| "#{indent}#{i}" } + result.join("\n#{indent}\n") + end + + # this tweaks the reference-Id to be comaptible as TeX label + # private methd + def mkInternalTraceId(string) + string.gsub("_", "-") + end + + # this tweaks the reference-id to be displayed in TeX + # private method + def mkTexTraceDisplay(trace) + trace.gsub("_", "\\_") + end + + + # + # This replaces markdown inlays + # it is a subroutine which is called + # recursively + # todo: handle indentation + # + # @param text [String] text in which the markdown inlays shall be processed + # @return [String] The resulting text + def replace_md_inlay(text) + text.gsub!(INCLUDE_MD_PATTERN) { |m| + infile = $2.gsub("\\_", "_") + if File.exist?(infile) then + replacetext_raw = File.open(infile, :encoding => 'bom|utf-8').read + unless $1.nil? then + leading_whitespace = $1.split("\n", 100) + leading_lines = leading_whitespace[0 .. -1].join("\n") + leading_spaces = leading_whitespace.last || "" + replacetext = leading_lines + replacetext_raw.gsub("\n", "\n#{leading_spaces}") + else + replacetext = replacetext_raw + end + else + replacetext = "" + @log.warn("File not found: #{$2}") + end + result = replace_md_inlay(replacetext) + result + } + text + end + + public + + # constructor + # :target: the target format + # in which the referneces shall be represented + #todo: improve logger approach + def initialize(target, logger=nil) + @target=target + + @log=logger || $logger || nil + + if @log == nil + @log = Logger.new(STDOUT) + @log.level = Logger::INFO + @log.datetime_format = "%Y-%m-%d %H:%M:%S" + @log.formatter = proc do |severity, datetime, progname, msg| + "#{datetime}: #{msg}\n" + end + end + end + + # this does the postprocessing + # of the file + # in particluar handle wortsammler's specific syntax. + def prepareFile(infile, outfile) + + infileIo=File.new(infile) + text = infileIo.readlines.join + infileIo.close + + #include pdf files + + if @target == "pdf" + text.gsub!(INCLUDE_PDF_PATTERN) { |m| + + if $4 + pages="[pages=#{$4}]" + else + pages="" + end + + if $5 + clearpage=$5 + else + clearpage="cleardoublepage" + end + + if $3.length > 0 + level=$3 + else + level=9 + end + + "\n\n\\#{clearpage}\n\\bookmark[level=#{level},page=\\thepage]{#{$2}}\n\\includepdf#{pages}{#{$1}}" + } + else #if not pdf then it gets a regular external link + text.gsub!(INCLUDE_PDF_PATTERN) { |m| + "[#{$2}](#{$1})" + } + end + + # include Markdown files + # + # + text = replace_md_inlay(text) + + + # embed images + # + if @target == "pdf" + text.gsub!(EMBEDDED_IMAGE_PATTERN) { |m| + "\\wsembedimage{#{$1}}{#{$2}}{#{$3}}{#{$4}}" + } + else #if not pdf then it gets a regular image + text.gsub!(EMBEDDED_IMAGE_PATTERN) { |m| + "![#{$1}](#{$1})" + } + end + + #inject the anchors for references to traces ->[traceid] + if @target == "pdf" then + text.gsub!(TRACE_ANCHOR_PATTERN) { |m| "[#{$1}]#{$2}\\hypertarget{#{mkInternalTraceId($1)}}{}" } + else + text.gsub!(TRACE_ANCHOR_PATTERN) { |m| "[#{$1}]#{$2}" } + end + + #substitute arbitrary anchors for arbitrary targets + if @target == "pdf" then + text.gsub!(ANY_ANCHOR_PATTERN) { |m| "\\hypertarget{#{mkInternalTraceId($1)}}{}" } + else + # it is already html + end + + #substitute arbitrary document internal references + if @target == "pdf" then + text.gsub!(ANY_REF_PATTERN) { |m| "\\hyperlink{#{$1}}{#{mkTexTraceDisplay($2)}}" } + else + # it is already html + end + + # substitute the uptrace references + text.gsub!(UPTRACE_REF_PATTERN) { |m| "}(#{prepareTraceReferences($1)})" } + + # substitute the informal trace references + text.gsub!(TRACE_REF_PATTERN) { |m| "[#{prepareTraceReferences($1)}]" } + + + # substitute expected Results + # + # + if @target == "pdf" then + text.gsub!(EXPECTED_RESULT_PATTERN) { |m| "#{prepareExpectedResults($1, $2, $3)}" } + else + # it is already leave it as it is + end + + # substitute plantuml + # + # note this is substituted in any case + # + #if @target == "pdf" then + text.gsub!(PLANTUML_PATTERN) { |m| "" } + + #else + # it is already leave it as it is + #end + + File.open(outfile, "w") { |f| f.puts(text) } + end +end + + +# +# This class handles the configuration of WortSammler framework +# + +class ProoConfig + attr_reader :input, # An array with the input filenames + :outdir, # directory where to place the output files + :outname, # basis to determine the output files + :format, # array of output formats + :traceSortOrder, # Array of strings to determine the sort ord + :vars, # hash of variables for pandoc + :editions, # hash of editions for pandoc + :snippets, # Array of strings to determine snippet filenames + :upstream_tracefiles, # Array of strings to determine upstream tracefile names + :downstream_tracefile, # String to save downstram filename + :reqtracefile_base, # string to determine the requirements tracing results + :frontmatter, # Array of string to determine input filenames of frontmatter + :rootdir, # String directory of the configuration file + :stylefiles, # Hash of stylefiles path to pandoc latex style file + :mdreaderoptions, # string to be appended to -f markdown specifier in pandoc + :mdwriteroptions # string to be appendod to -t markdown in pandoc + + + # constructor + def initialize + @mdreaderoptions = %w{ + +fenced_code_blocks + +compact_definition_lists + -space_in_atx_header + }.join() + + @mdwriteroptions = %w{ + -backtick_code_blocks + +fenced_code_blocks + +compact_definition_lists + +space_in_atx_header + +yaml_metadata_block + }.join() + end + + # @param [String] configFileName name of the configfile (without .yaml) + # @param [Symbol] configSelect Default configuration. If not specified + # the very first entry in the config file + # will apply. + # TODO: not yet implemented. + # @return [ProoConfig] instance + def load_from_file(configFileName, configSelect=nil) + begin + config = YAML.load(File.new(configFileName)) + rescue Exception => e + unless File.exist?(configFileName) then + $log.error "config file not found '#{configFileName}'" + else + $log.error "config file could not be loaded '#{configFileName}'" + if File.directory?(configFileName) then + # note that windows does not disinguish this. + $log.error "#{configFileName} is a directory" + end + $log.error "reason '#{e.message}'" + end + exit(false) + end + + basePath = File.dirname(configFileName) + + # this makes an absolute path based on the absolute path + # of the configuration file + expand_path =lambda do |lf| + File.expand_path("#{basePath}/#{lf}") + end + + + #activeConfigs=config.select{|x| [x[:name]] & ConfigSelet} + + selectedConfig = config.first + #TODO: check the config file + #TODO: refactor the configuration processing + @input = selectedConfig[:input].map { |file| File.expand_path("#{basePath}/#{file}") } + @outdir = File.expand_path("#{basePath}/#{selectedConfig[:outdir]}") + @outname = selectedConfig[:outname] + @format = selectedConfig[:format] + @traceSortOrder = selectedConfig[:traceSortOrder] + @vars = selectedConfig[:vars] || {} + @editions = selectedConfig[:editions] || nil + + @downstream_tracefile = selectedConfig[:downstream_tracefile] || nil + + @reqtracefile_base = selectedConfig[:reqtracefile_base] #todo expand path + + @upstream_tracefiles = selectedConfig[:upstream_tracefiles] || nil + @upstream_tracefiles = @upstream_tracefiles.map { |file| File.expand_path("#{basePath}/#{file}") } unless @upstream_tracefiles.nil? + @frontmatter = selectedConfig[:frontmatter] || nil + @frontmatter = selectedConfig[:frontmatter].map { |file| File.expand_path("#{basePath}/#{file}") } unless @frontmatter.nil? + @rootdir = basePath + + @mdreaderoptions = selectedConfig[:mdreaderoptions].join() if selectedConfig[:mdreaderoptions] + @mdwriteroptions = selectedConfig[:mdwriteroptions].join() if selectedConfig[:mdwriteroptions] + + + stylefiles = selectedConfig[:stylefiles] || nil + if stylefiles.nil? + @stylefiles = { + :latex => expand_path.call("../ZSUPP_Styles/default.latex"), + :docx => expand_path.call("../ZSUPP_Styles/default.docx"), + :html => expand_path.call("../ZSUPP_Styles/default.css") + } + else + @stylefiles = stylefiles.map { |key, value| { key => expand_path.call(value) } }.reduce(:merge) + end + + snippets = selectedConfig[:snippets] + if snippets.nil? + @snippets = nil + else + @snippets = snippets.map { |file| File.expand_path("#{basePath}/#{file}") } + end + end +end + + +# +# This class provides the major functionalites +# +# Note that it is called PandocBeautifier for historical reasons +# +# provides methods to Process a pandoc file +# + +class PandocBeautifier + + attr_accessor :log, :config + + # the constructor + # @param [Logger] logger logger object to be applied. + # if none is specified, a default logger + # will be implemented + def initialize(logger = nil) + + @markdown_output_switches = %w{ + +backtick_code_blocks + -fenced_code_blocks + +compact_definition_lists + +space_in_atx_header + +yaml_metadata_block + }.join() + + @markdown_input_switches = %w{ + +smart + +backtick_code_blocks + +fenced_code_blocks + +compact_definition_lists + -space_in_atx_header + }.join() + + + @view_pattern = /~~ED((\s*(\w+))*)~~/ + # @view_pattern = /<\?ED((\s*(\w+))*)\?>/ + @tempdir = Dir.mktmpdir + + @config = ProoConfig.new() + + @log=logger || $logger || nil + + if @log == nil + @log = Logger.new(STDOUT) + @log.level = Logger::INFO + @log.datetime_format = "%Y-%m-%d %H:%M:%S" + @log.formatter = proc do |severity, datetime, progname, msg| + "#{datetime}: #{msg}\n" + end + + end + end + + + # + + # This checks if an appropriate pandoc version can be + # started on the machine + + # + + # @return [boolean] true if an appropriate version is available + def check_pandoc_version + required_version_string="2.0.5" + begin + pandoc_version=`#{PANDOC_EXE} -v`.split("\n").first.split(" ")[1] + if pandoc_version < required_version_string then + @log.error "found pandoc #{pandoc_version} need #{required_version_string}" + result = false + else + result = true + end + rescue Exception => e + @log.error("could not run pandoc: #{e.message}") + result=false + end + result + end + + # perform the beautify + # * process the file with pandoc + # * revoke some quotes introduced by pandoc + # @param [String] file the name of the file to be beautified + def beautify(file) + + @log.debug(" Cleaning: \"#{file}\"") + + docfile = File.new(file) + olddoc = docfile.readlines.join + docfile.close + + # process the file in pandoc + cmd = "#{PANDOC_EXE} --standalone #{file.esc} -f markdown#{@markdown_input_switches} -t markdown#{@markdown_output_switches} --atx-headers --id-prefix=#{File.basename(file).esc}_ " + + newdoc = `#{cmd}` + @log.debug "beautify #{file.esc}: #{$?}" + @log.debug(" finished: \"#{file}\"") + + # tweak the quoting + if $?.success? then + # (RS_Mdc) + # TODO: fix Table width toggles sometimes + if (not olddoc == newdoc) then ##only touch the file if it is really changed + File.open(file, "w") { |f| f.puts(newdoc) } + File.open(file+".bak", "w") { |f| f.puts(olddoc) } # (RS_Mdc_) # remove this if needed + @log.debug(" cleaned: \"#{file}\"") + else + @log.debug("was clean: \"#{file}\"") + end + #TODO: error handling here + else + @log.error("error calling pandoc - please watch the screen output") + end + end + + + # this replaces the text snippets in files + def replace_snippets_in_file(infile, snippets) + input_data = File.open(infile) { |f| f.readlines.join } + output_data=input_data.clone + + @log.debug("replacing snippets in #{infile}") + + replace_snippets_in_text(output_data, snippets) + + if (not input_data == output_data) + File.open(infile, "w") { |f| f.puts output_data } + end + end + + # this replaces the snippets in a text + def replace_snippets_in_text(text, snippets) + changed=false + text.gsub!(SNIPPET_PATTERN) { |m| + replacetext_raw=snippets[$2.to_sym] + + if replacetext_raw + changed=true + unless $1.nil? then + leading_whitespace=$1.split("\n", 100) + leading_lines =leading_whitespace[0..-1].join("\n") + leading_spaces =leading_whitespace.last || "" + replacetext =leading_lines+replacetext_raw.gsub("\n", "\n#{leading_spaces}") + end + @log.debug("replaced snippet #{$2} with #{replacetext}") + else + replacetext=m + @log.warn("Snippet not found: #{$2}") + end + replacetext + } + #recursively process nested snippets + #todo: this approach might rais undefined snippets twice if there are defined and undefined ones + replace_snippets_in_text(text, snippets) if changed==true + end + + + # + # Ths determines the view filter + # + # @param [String] line - the current input line + # @param [String] view - the currently selected view + # + # @return true/false if a view-command is found, else nil + def get_filter_command(line, view) + r = line.match(@view_pattern) + + if not r.nil? + found = r[1].split(" ") + result = (found & [view, "all"].flatten).any? + else + result = nil + end + + result + end + + # + # This filters the document according to the target audience + # + # @param [String] inputfile name of inputfile + # @param [String] outputfile name of outputfile + # @param [String] view - name of intended view + + def filter_document_variant(inputfile, outputfile, view) + + input_data = File.open(inputfile) { |f| f.readlines } + + output_data = Array.new + is_active = true + input_data.each { |l| + switch=self.get_filter_command(l, view) + l.gsub!(@view_pattern, "") + is_active = switch unless switch.nil? + @log.debug "select edtiion #{view}: #{is_active}: #{l.strip}" + + output_data << l if is_active + } + + File.open(outputfile, "w") { |f| f.puts output_data.join } + end + + # + # This filters the document according to the target audience + # + # @param [String] inputfile name of inputfile + # @param [String] outputfile name of outputfile + # @param [String] view - name of intended view + + def process_debug_info(inputfile, outputfile, view) + + input_data = File.open(inputfile) { |f| f.readlines } + + output_data = Array.new + + input_data.each { |l| + l.gsub!(@view_pattern) { |p| + if $1.strip == "all" then + color="black" + else + color="red" + end + + "\\color{#{color}}\\rule{2cm}{0.5mm}\\newline\\marginpar{#{$1.strip}}" + + } + + l.gsub!(/todo:|TODO:/) { |p| "#{p}\\marginpar{TODO}" } + + output_data << l + } + + File.open(outputfile, "w") { |f| f.puts output_data.join } + end + + + # This compiles the input documents to one single file + # it also beautifies the input files + # + # @param [Array of String] input - the input files to be processed in the given sequence + # @param [String] output - the the name of the output file + def collect_document(input, output) + inputs =input.map { |xx| xx.esc.to_osPath }.join(" ") # qoute cond combine the inputs + inputname=File.basename(input.first) + + #now combine the input files + @log.debug("combining the input files #{inputname} et al") + cmd="#{PANDOC_EXE} -f markdown#{@markdown_input_switches} --standalone -t markdown#{@markdown_output_switches} -o #{output} --ascii #{inputs}" # note that inputs is already quoted + system(cmd) + if $?.success? then + PandocBeautifier.new().beautify(output) + end + end + + # + # This loads snipptes from xlsx file + # @param [String] file name of the xlsx file + # @return [Hash] a hash with the snippetes + # + def load_snippets_from_xlsx(file) + temp_filename = "#{@tempdir}/snippett.xlsx" + FileUtils::copy(file, temp_filename) + wb =RubyXL::Parser.parse(temp_filename) + result={} + wb.first.each { |row| + key, the_value = row + unless key.nil? + unless the_value.nil? + result[key.value.to_sym] = resolve_xml_entities(the_value.value) rescue "" + end + end + } + result + end + + # + # this resolves xml entities in Text (lt, gt, amp) + # @param [String] text with entities + # @return [String] text with replaced entities + def resolve_xml_entities(text) + result=text + result.gsub!("<", "<") + result.gsub!(">", ">") + result.gsub!("&", "&") + result + end + + # + # This generates the final document + # + # It actually does this in two steps: + # + # 1. process front matter to laTeX + # 2. process documents + # + # @param [Array of String] input the input files to be processed in the given sequence + # @param [String] outdir the output directory + # @param [String] outname the base name of the output file. It is a basename in case the + # output format requires multiple files + # @param [Array of String] format list of formats which shall be generated. + # supported formats: "pdf", "latex", "html", "docx", "rtf", txt + # @param [Hash] vars - the variables passed to pandoc + # @param [Hash] editions - the editions to process; default nil - no edition processing + # @param [Array of String] snippetfiles the list of files containing snippets + # @param [String] frontmatter file path to frontmatter the file to processed as frontmatter + # @param [ProoConfig] config - the configuration file to be used + def generateDocument(input, outdir, outname, format, vars, editions=nil, snippetfiles=nil, frontmatter=nil, config=nil) + + # combine the input files + + temp_filename = "#{@tempdir}/x.md".to_osPath + temp_frontmatter = "#{@tempdir}/xfrontmatter.md".to_osPath unless frontmatter.nil? + collect_document(input, temp_filename) + collect_document(frontmatter, temp_frontmatter) unless frontmatter.nil? + + # process the snippets + + if not snippetfiles.nil? + snippets={} + snippetfiles.each { |f| + if File.exists?(f) + type=File.extname(f) + case type + when ".yaml" + x=YAML.load(File.new(f)) + when ".xlsx" + x=load_snippets_from_xlsx(f) + else + @log.error("Unsupported File format for snipptets: #{type}") + x={} + end + snippets.merge!(x) + else + @log.error("Snippet file not found: #{f}") + end + } + + replace_snippets_in_file(temp_filename, snippets) + end + + vars_frontmatter =vars.clone + vars_frontmatter[:usetoc] = "nousetoc" + + + if editions.nil? + # there are no editions + unless frontmatter.nil? then + render_document(temp_frontmatter, tempdir, temp_frontmatter, ["frontmatter"], vars_frontmatter) + vars[:frontmatter] = "#{tempdir}/#{temp_frontmatter}.latex" + end + render_document(temp_filename, outdir, outname, format, vars, config) + else + # process the editions + editions.each { |edition_name, properties| + edition_out_filename = "#{outname}_#{properties[:filepart]}" + edition_temp_frontmatter = "#{@tempdir}/#{edition_out_filename}_frontmatter.md" unless frontmatter.nil? + edition_temp_filename = "#{@tempdir}/#{edition_out_filename}.md" + vars[:title] = properties[:title] + + editionformats = properties[:format] || format + + if properties[:debug] + process_debug_info(temp_frontmatter, edition_temp_frontmatter, edition_name.to_s) unless frontmatter.nil? + process_debug_info(temp_filename, edition_temp_filename, edition_name.to_s) + lvars =vars.clone + lvars[:linenumbers] = "true" + unless frontmatter.nil? # frontmatter + lvars[:usetoc] = "nousetoc" + render_document(edition_temp_frontmatter, @tempdir, "xfrontmatter", ["frontmatter"], lvars) + lvars[:usetoc] = vars[:usetoc] || "usetoc" + lvars[:frontmatter] = "#{@tempdir}/xfrontmatter.latex" + end + render_document(edition_temp_filename, outdir, edition_out_filename, ["pdf", "latex"], lvars, config) + else + unless frontmatter.nil? # frontmatter + filter_document_variant(temp_frontmatter, edition_temp_frontmatter, edition_name.to_s) + render_document(edition_temp_frontmatter, @tempdir, "xfrontmatter", ["frontmatter"], vars_frontmatter) + vars[:frontmatter]="#{@tempdir}/xfrontmatter.latex" + end + + filter_document_variant(temp_filename, edition_temp_filename, edition_name.to_s) + render_document(edition_temp_filename, outdir, edition_out_filename, editionformats, vars, config) + end + } + end + end + + # + + # render a single file + # @param input [String] path to the inputfile + # @param outdir [String] path to the output directory + # @param format [Array of String] formats + # @return [nil] no useful return value + def render_single_document(input, outdir, format) + outname=File.basename(input, ".*") + render_document(input, outdir, outname, format, { :geometry => "a4paper" }) + end + + # + # This renders the final document + # @param [String] input the input file + # @param [String] outdir the output directory + # @param [String] outname the base name of the output file. It is a basename in case the + # output format requires multiple files + # @param [Array of String] format list of formats which shall be generated. + # supported formats: "pdf", "latex", "html", "docx", "rtf", txt + # @param [Hash] vars - the variables passed to pandoc + + # @param config [ProoConfig] the entire config object (for future extensions) + # @return nil + + def render_document(input, outdir, outname, format, vars, config=nil) + + #TODO: Clarify the following + # on Windows, Tempdir contains a drive letter. But drive letter + # seems not to work in pandoc -> pdf if the path separator ist forward + # slash. There are two options to overcome this + # + # 1. set tempdir such that it does not contain a drive letter + # 2. use Dir.mktempdir but ensure that all provided file names + # use the platform specific SEPARATOR + # + # for whatever Reason, I decided for 2. + + tempfile = input + tempfilePdf = "#{@tempdir}/x.TeX.md".to_osPath + tempfileHtml = "#{@tempdir}/x.html.md".to_osPath + outfile = "#{outdir}/#{outname}".to_osPath + outfilePdf = "#{outfile}.pdf" + outfileDocx = "#{outfile}.docx" + outfileHtml = "#{outfile}.html" + outfileRtf = "#{outfile}.rtf" + outfileLatex = "#{outfile}.latex" + outfileText = "#{outfile}.txt" + outfileSlide = "#{outfile}.slide.html" + + + ## format handle + + # todo: use this information ... + + format_config = { + 'pdf' => { + tempfile: :pdf, + outfile: "#{outfile}.pdf" + }, + 'html' => { + tempfile: :html, + outfile: "#{outfile}.html" + }, + 'docx' => { + tempfile: :html, + outfile: "#{outfile}.docx" + }, + 'rtf' => { + tempfile: :html, + outfile: "#{outfile}.rtf" + }, + 'latex' => { + tempfile: :pdf, + outfile: "#{outfile}.latex" + }, + 'text' => { + tempfile: :html, + outfile: "#{outfile}.text" + }, + 'dzslides' => { + tempfile: :html, + outfile: "#{outfile}.slide.html" + }, + + :beamer => { + tempfile: :pdf, + outfile: "#{outfile}.beamer.pdf" + }, + + 'markdown' => { + tempfile: :html, + outfile: "#{outfile}.slide.html" + } + } + + tempfile_config = { + pdf: "#{@tempdir}/x.TeX.md".to_osPath, + html: "#{@tempdir}/x.html.md".to_osPath + } + + + if vars.has_key? :frontmatter + latexTitleInclude = "--include-before-body=#{vars[:frontmatter].esc}" + else + latexTitleInclude + end + + #todo: make config required, so it can be reduced to the else part + if config.nil? then + latexStyleFile = File.dirname(File.expand_path(__FILE__))+"/../../resources/default.wortsammler.latex" + latexStyleFile = File.expand_path(latexStyleFile).to_osPath + css_style_file = File.dirname(File.expand_path(__FILE__))+"/../../resources/default.wortsammler.css" + css_style_file = File.expand_path(css_style_file).to_osPath + else + latexStyleFile = config.stylefiles[:latex] + css_style_file = config.stylefiles[:css] + end + + + toc = "--toc" + toc = "" if vars[:usetoc]=="nousetoc" + + if vars[:documentclass]=="book" + option_chapters = "--chapters" + else + option_chapter = "" + end + + begin + vars_string=vars.map.map { |key, value| "-V #{key}=#{value.esc}" }.join(" ") + rescue + #todo require 'pry'; binding.pry + end + + @log.info("rendering #{outname} as [#{format.join(', ')}]") + + supported_formats=["pdf", "latex", "frontmatter", "docx", "html", "txt", "rtf", "slidy", "md", "beamer"] + wrong_format =format - supported_formats + wrong_format.each { |f| @log.error("format not supported: #{f}") } + + begin + + if format.include?("frontmatter") then + + ReferenceTweaker.new("pdf").prepareFile(tempfile, tempfilePdf) + + cmd="#{PANDOC_EXE} -f markdown#{@markdown_input_switches} #{tempfilePdf.esc} --pdf-engine xelatex #{vars_string} --ascii -t latex+smart -o #{outfileLatex.esc}" + `#{cmd}` + end + + + if (format.include?("pdf") | format.include?("latex")) then + @log.debug("creating #{outfileLatex}") + ReferenceTweaker.new("pdf").prepareFile(tempfile, tempfilePdf) + + cmd="#{PANDOC_EXE} -f markdown#{@markdown_input_switches} #{tempfilePdf.esc} #{toc} --standalone #{option_chapters} --pdf-engine xelatex --number-sections #{vars_string}" + + " --template #{latexStyleFile.esc} --ascii -t latex+smart -o #{outfileLatex.esc} #{latexTitleInclude}" + `#{cmd}` + + end + + + + if format.include?("pdf") then + @log.debug("creating #{outfilePdf}") + ReferenceTweaker.new("pdf").prepareFile(tempfile, tempfilePdf) + #cmd="#{PANDOC_EXE} -S #{tempfilePdf.esc} #{toc} --standalone #{option_chapters} --latex-engine xelatex --number-sections #{vars_string}" + + # " --template #{latexStyleFile.esc} --ascii -o #{outfilePdf.esc} #{latexTitleInclude}" + cmd ="#{LATEX_EXE} -halt-on-error -interaction nonstopmode -output-directory=#{outdir.esc} #{outfileLatex.esc}" + #cmdmkindex = "makeindex \"#{outfile.esc}.idx\"" + + latex=LatexHelper.new.set_latex_command(cmd).setlogger(@log) + latex.run(outfileLatex) + + messages=latex.log_analyze("#{outdir}/#{outname}.log") + + removeables = ["toc", "aux", "bak", "idx", "ilg", "ind"] + removeables << "log" unless messages > 0 + + + removeables << "latex" unless format.include?("latex") + removeables = removeables.map { |e| "#{outdir}/#{outname}.#{e}" }.select { |f| File.exists?(f) } + removeables.each { |e| + @log.debug "removing file: #{e}" + FileUtils.rm e + } + end + + if format.include?("html") then + #todo: handle css + @log.debug("creating #{outfileHtml}") + + ReferenceTweaker.new("html").prepareFile(tempfile, tempfileHtml) + + cmd="#{PANDOC_EXE} -f markdown#{@markdown_input_switches} #{tempfileHtml.esc} --toc --standalone --self-contained --ascii --number-sections #{vars_string}" + + " -t html+smart -o #{outfileHtml.esc}" + + `#{cmd}` + end + + if format.include?("docx") then + #todo: handle style file + @log.debug("creating #{outfileDocx}") + + ReferenceTweaker.new("html").prepareFile(tempfile, tempfileHtml) + + cmd="#{PANDOC_EXE} -f markdown#{@markdown_input_switches} #{tempfileHtml.esc} #{toc} --standalone --self-contained --ascii --number-sections #{vars_string}" + + " -f docx+smart -o #{outfileDocx.esc}" + cmd="#{PANDOC_EXE} -f markdown#{@markdown_input_switches} #{tempfileHtml.esc} --toc --standalone --self-contained --ascii --number-sections #{vars_string}" + + " -t docx+smart -o #{outfileDocx.esc}" + `#{cmd}` + end + + if format.include?("rtf") then + @log.debug("creating #{outfileRtf}") + ReferenceTweaker.new("html").prepareFile(tempfile, tempfileHtml) + + cmd="#{PANDOC_EXE} -f markdown#{@markdown_input_switches} #{tempfileHtml.esc} --toc --standalone --self-contained --ascii --number-sections #{vars_string}" + + " -t rtf+smart -o #{outfileRtf.esc}" + `#{cmd}` + end + + if format.include?("txt") then + @log.debug("creating #{outfileText}") + + ReferenceTweaker.new("pdf").prepareFile(tempfile, tempfileHtml) + + cmd="#{PANDOC_EXE} -f markdown#{@markdown_input_switches} #{tempfileHtml.esc} --toc --standalone --self-contained --ascii --number-sections #{vars_string}" + + " -t plain+smart -o #{outfileText.esc}" + `#{cmd}` + end + + if format.include?("slidy") then + @log.debug("creating #{outfileSlide}") + + ReferenceTweaker.new("html").prepareFile(tempfile, tempfileHtml) + #todo: handle stylefile + cmd="#{PANDOC_EXE} -f markdown#{@markdown_input_switches} #{tempfileHtml.esc} --toc --standalone --self-contained #{vars_string}" + + " --ascii -t s5+smart --slide-level 1 -o #{outfileSlide.esc}" + `#{cmd}` + end + + if format.include?("beamer") then + outfile = format_config[:beamer][:outfile] + tempformat = format_config[:beamer][:tempfile] + tempfile_out = tempfile_config[tempformat] + @log.debug("creating #{outfile}") + ReferenceTweaker.new(tempformat).prepareFile(tempfile, tempfile_out) + + cmd = %Q{#{PANDOC_EXE} -t beamer #{tempfile_out.esc} -V theme:Warsaw -o #{outfile.esc}} + `#{cmd}` + + #messages=latex.log_analyze("#{outdir}/#{outname}.log") + messages = 0 + + removeables = ["toc", "aux", "bak", "idx", "ilg", "ind"] + removeables << "log" unless messages > 0 + + + removeables << "latex" unless format.include?("latex") + removeables = removeables.map { |e| "#{outdir}/#{outname}.#{e}" }.select { |f| File.exists?(f) } + removeables.each { |e| + @log.debug "removing file: #{e}" + FileUtils.rm e + } + end + + + rescue Exception => e + @log.error "failed to perform #{cmd}, \n#{e.message}" + @log.error e.backtrace.join("\n") + #TODO make a try catch block kere + end + nil + end + +end diff --git a/lib/wortsammler/mdTraceParser.treetop b/lib/wortsammler/mdTraceParser.treetop index e2a778b..a2459c4 100644 --- a/lib/wortsammler/mdTraceParser.treetop +++ b/lib/wortsammler/mdTraceParser.treetop @@ -25,12 +25,12 @@ grammar TraceInMarkdown end rule traceId - "[" payload:label "]" + ("[" / "\\[") payload:label ("]" / "\\]") end rule label - [a-zA-Z]+ "_" [a-zA-Z]+ "_" [0-9]+ + [a-zA-Z]+ ("_" / "\\_") [a-zA-Z]+ ("_" / "\\_") [0-9]+ end rule traceHead diff --git a/lib/wortsammler/version.rb b/lib/wortsammler/version.rb index 20cf87b..3fcf250 100644 --- a/lib/wortsammler/version.rb +++ b/lib/wortsammler/version.rb @@ -1,4 +1,4 @@ module Wortsammler PROGNAME="wortsammler" - VERSION = "1.0.2" + VERSION = "2.0.1" end diff --git a/resources/default.wortsammler.latex b/resources/default.wortsammler.latex index 58f17c1..570c022 100644 --- a/resources/default.wortsammler.latex +++ b/resources/default.wortsammler.latex @@ -65,7 +65,7 @@ $if(fancy-enums)$ }\makeatother \usepackage{enumerate} $endif$ -\usepackage{longtable} +\usepackage{longtable,booktabs} \usepackage{float} % provides the H option for float placement \usepackage{graphicx} % We will generate all images so they have a width \maxwidth. This means @@ -256,10 +256,11 @@ $if(linenumbers)$ \setlength\linenumbersep{1mm} \modulolinenumbers[5] $endif$ - +\providecommand{\tightlist}{% + \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} \usepackage{makeidx} \makeindex - +% % %\renewcommand{Befehl der Gliederungsebene z.B. \chapter}{\@startsection{Name z.B. chapter}{Ebene z.B. 0}{Einrückung z.B. 0pt}{Abstand zum vorigen Text z.B. 3.5ex plus 1ex minus 0pt\relax}{Abstand zum nachfolgenden Text z.B. 2.5ex plus 0.5ex minus 0pt\relax}{Schrift z.B. \normalfont\Large\bfseries}} % diff --git a/resources/main.md b/resources/main.md index fcab741..80eef32 100644 --- a/resources/main.md +++ b/resources/main.md @@ -236,7 +236,7 @@ Paragraphs like starting with `~~MD "lib/01234/xxxx/yyyy.md"~~` - will be replaced by the content of the argument. It shold even work + will be replaced by the content of the argument. It should even work inline. }(RS_Comp_003) diff --git a/resources/pandocdefault.docx b/resources/pandocdefault.docx new file mode 100644 index 0000000..e69de29 diff --git a/resources/pandocdefault.epub b/resources/pandocdefault.epub new file mode 100644 index 0000000..ffe2305 --- /dev/null +++ b/resources/pandocdefault.epub @@ -0,0 +1,70 @@ + + + + + + + $pagetitle$ + +$if(highlighting-css)$ + +$endif$ +$for(css)$ + +$endfor$ +$for(header-includes)$ + $header-includes$ +$endfor$ + + +$if(titlepage)$ +
+$for(title)$ +$if(title.type)$ +

$title.text$

+$else$ +

$title$

+$endif$ +$endfor$ +$if(subtitle)$ +

$subtitle$

+$endif$ +$for(author)$ +

$author$

+$endfor$ +$for(creator)$ +

$creator.text$

+$endfor$ +$if(publisher)$ +

$publisher$

+$endif$ +$if(date)$ +

$date$

+$endif$ +$if(rights)$ +
$rights$
+$endif$ +
+$else$ +$for(include-before)$ +$include-before$ +$endfor$ +$body$ +$for(include-after)$ +$include-after$ +$endfor$ +$endif$ + + + diff --git a/resources/pandocdefault.html b/resources/pandocdefault.html new file mode 100644 index 0000000..2272a01 --- /dev/null +++ b/resources/pandocdefault.html @@ -0,0 +1,73 @@ + + + + + + +$for(author-meta)$ + +$endfor$ +$if(date-meta)$ + +$endif$ +$if(keywords)$ + +$endif$ + $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ + +$if(highlighting-css)$ + +$endif$ +$for(css)$ + +$endfor$ +$if(math)$ + $math$ +$endif$ + +$for(header-includes)$ + $header-includes$ +$endfor$ + + +$for(include-before)$ +$include-before$ +$endfor$ +$if(title)$ +
+

$title$

+$if(subtitle)$ +

$subtitle$

+$endif$ +$for(author)$ +

$author$

+$endfor$ +$if(date)$ +

$date$

+$endif$ +
+$endif$ +$if(toc)$ + +$endif$ +$body$ +$for(include-after)$ +$include-after$ +$endfor$ + + diff --git a/resources/pandocdefault.latex b/resources/pandocdefault.latex new file mode 100644 index 0000000..a9191aa --- /dev/null +++ b/resources/pandocdefault.latex @@ -0,0 +1,403 @@ +\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere +\PassOptionsToPackage{hyphens}{url} +$if(colorlinks)$ +\PassOptionsToPackage{dvipsnames,svgnames*,x11names*}{xcolor} +$endif$ +% +\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$if(beamer)$ignorenonframetext,$if(handout)$handout,$endif$$if(aspectratio)$aspectratio=$aspectratio$,$endif$$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$} +$if(beamer)$ +\setbeamertemplate{caption}[numbered] +\setbeamertemplate{caption label separator}{: } +\setbeamercolor{caption name}{fg=normal text.fg} +\beamertemplatenavigationsymbols$if(navigation)$$navigation$$else$empty$endif$ +$endif$ +$if(beamerarticle)$ +\usepackage{beamerarticle} % needs to be loaded first +$endif$ +$if(fontfamily)$ +\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$} +$else$ +\usepackage{lmodern} +$endif$ +$if(linestretch)$ +\usepackage{setspace} +\setstretch{$linestretch$} +$endif$ +\usepackage{amssymb,amsmath} +\usepackage{ifxetex,ifluatex} +\usepackage{fixltx2e} % provides \textsubscript +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc} + \usepackage[utf8]{inputenc} + \usepackage{textcomp} % provides euro and other symbols +\else % if luatex or xelatex +$if(mathspec)$ + \ifxetex + \usepackage{mathspec} + \else + \usepackage{unicode-math} + \fi +$else$ + \usepackage{unicode-math} +$endif$ + \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase} +$for(fontfamilies)$ + \newfontfamily{$fontfamilies.name$}[$fontfamilies.options$]{$fontfamilies.font$} +$endfor$ +$if(mainfont)$ + \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$} +$endif$ +$if(sansfont)$ + \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$} +$endif$ +$if(monofont)$ + \setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$} +$endif$ +$if(mathfont)$ +$if(mathspec)$ + \ifxetex + \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} + \else + \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} + \fi +$else$ + \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} +$endif$ +$endif$ +$if(CJKmainfont)$ + \ifxetex + \usepackage{xeCJK} + \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$} + \fi +$endif$ +$if(luatexjapresetoptions)$ + \ifluatex + \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset} + \fi +$endif$ +$if(CJKmainfont)$ + \ifluatex + \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec} + \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$} + \fi +$endif$ +\fi +$if(beamer)$ +$if(theme)$ +\usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$} +$endif$ +$if(colortheme)$ +\usecolortheme{$colortheme$} +$endif$ +$if(fonttheme)$ +\usefonttheme{$fonttheme$} +$endif$ +$if(mainfont)$ +\usefonttheme{serif} % use mainfont rather than sansfont for slide text +$endif$ +$if(innertheme)$ +\useinnertheme{$innertheme$} +$endif$ +$if(outertheme)$ +\useoutertheme{$outertheme$} +$endif$ +$endif$ +% use upquote if available, for straight quotes in verbatim environments +\IfFileExists{upquote.sty}{\usepackage{upquote}}{} +% use microtype if available +\IfFileExists{microtype.sty}{% +\usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype} +\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts +}{} +$if(indent)$ +$else$ +\IfFileExists{parskip.sty}{% +\usepackage{parskip} +}{% else +\setlength{\parindent}{0pt} +\setlength{\parskip}{6pt plus 2pt minus 1pt} +} +$endif$ +$if(verbatim-in-note)$ +\usepackage{fancyvrb} +$endif$ +$if(colorlinks)$ +\usepackage{xcolor} +$endif$ +\usepackage{hyperref} +\hypersetup{ +$if(title-meta)$ + pdftitle={$title-meta$}, +$endif$ +$if(author-meta)$ + pdfauthor={$author-meta$}, +$endif$ +$if(keywords)$ + pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$}, +$endif$ +$if(colorlinks)$ + colorlinks=true, + linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$, + citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$, + urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$, +$else$ + pdfborder={0 0 0}, +$endif$ + breaklinks=true} +\urlstyle{same} % don't use monospace font for urls +$if(verbatim-in-note)$ +\VerbatimFootnotes % allows verbatim text in footnotes +$endif$ +$if(geometry)$ +\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} +$endif$ +$if(beamer)$ +\newif\ifbibliography +$endif$ +$if(listings)$ +\usepackage{listings} +\newcommand{\passthrough}[1]{#1} +$endif$ +$if(lhs)$ +\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} +$endif$ +$if(highlighting-macros)$ +$highlighting-macros$ +$endif$ +$if(tables)$ +\usepackage{longtable,booktabs} +$if(beamer)$ +\usepackage{caption} +% These lines are needed to make table captions work with longtable: +\makeatletter +\def\fnum@table{\tablename~\thetable} +\makeatother +$else$ +% Fix footnotes in tables (requires footnote package) +\IfFileExists{footnote.sty}{\usepackage{footnote}\makesavenoteenv{longtable}}{} +$endif$ +$endif$ +$if(graphics)$ +\usepackage{graphicx,grffile} +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} +\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi} +\makeatother +% Scale images if necessary, so that they will not overflow the page +% margins by default, and it is still possible to overwrite the defaults +% using explicit options in \includegraphics[width, height, ...]{} +\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} +$endif$ +$if(beamer)$ +% Prevent slide breaks in the middle of a paragraph: +\widowpenalties 1 10000 +\raggedbottom +$if(section-titles)$ +\AtBeginPart{ + \let\insertpartnumber\relax + \let\partname\relax + \frame{\partpage} +} +\AtBeginSection{ + \ifbibliography + \else + \let\insertsectionnumber\relax + \let\sectionname\relax + \frame{\sectionpage} + \fi +} +\AtBeginSubsection{ + \let\insertsubsectionnumber\relax + \let\subsectionname\relax + \frame{\subsectionpage} +} +$endif$ +$endif$ +$if(links-as-notes)$ +% Make links footnotes instead of hotlinks: +\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}} +$endif$ +$if(strikeout)$ +\usepackage[normalem]{ulem} +% avoid problems with \sout in headers with hyperref: +\pdfstringdefDisableCommands{\renewcommand{\sout}{}} +$endif$ +\setlength{\emergencystretch}{3em} % prevent overfull lines +\providecommand{\tightlist}{% + \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} +$if(numbersections)$ +\setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$} +$else$ +\setcounter{secnumdepth}{0} +$endif$ +$if(beamer)$ +$else$ +$if(subparagraph)$ +$else$ +% Redefines (sub)paragraphs to behave more like sections +\ifx\paragraph\undefined\else +\let\oldparagraph\paragraph +\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}} +\fi +\ifx\subparagraph\undefined\else +\let\oldsubparagraph\subparagraph +\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}} +\fi +$endif$ +$endif$ +$if(pagestyle)$ +\pagestyle{$pagestyle$} +$endif$ + +% set default figure placement to htbp +\makeatletter +\def\fps@figure{htbp} +\makeatother + +$for(header-includes)$ +$header-includes$ +$endfor$ +$if(lang)$ +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel} +$if(babel-newcommands)$ + $babel-newcommands$ +$endif$ +\else + % load polyglossia as late as possible as it *could* call bidi if RTL lang (e.g. Hebrew or Arabic) + \usepackage{polyglossia} + \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$} +$for(polyglossia-otherlangs)$ + \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$} +$endfor$ +\fi +$endif$ +$if(dir)$ +\ifxetex + % load bidi as late as possible as it modifies e.g. graphicx + $if(latex-dir-rtl)$ + \usepackage[RTLdocument]{bidi} + $else$ + \usepackage{bidi} + $endif$ +\fi +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \TeXXeTstate=1 + \newcommand{\RL}[1]{\beginR #1\endR} + \newcommand{\LR}[1]{\beginL #1\endL} + \newenvironment{RTL}{\beginR}{\endR} + \newenvironment{LTR}{\beginL}{\endL} +\fi +$endif$ +$if(natbib)$ +\usepackage[$natbiboptions$]{natbib} +\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$} +$endif$ +$if(biblatex)$ +\usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex} +$for(bibliography)$ +\addbibresource{$bibliography$} +$endfor$ +$endif$ + +$if(title)$ +\title{$title$$if(thanks)$\thanks{$thanks$}$endif$} +$endif$ +$if(subtitle)$ +\providecommand{\subtitle}[1]{} +\subtitle{$subtitle$} +$endif$ +$if(author)$ +\author{$for(author)$$author$$sep$ \and $endfor$} +$endif$ +$if(institute)$ +\providecommand{\institute}[1]{} +\institute{$for(institute)$$institute$$sep$ \and $endfor$} +$endif$ +\date{$date$} +$if(beamer)$ +$if(titlegraphic)$ +\titlegraphic{\includegraphics{$titlegraphic$}} +$endif$ +$if(logo)$ +\logo{\includegraphics{$logo$}} +$endif$ +$endif$ + +\begin{document} +$if(title)$ +$if(beamer)$ +\frame{\titlepage} +$else$ +\maketitle +$endif$ +$if(abstract)$ +\begin{abstract} +$abstract$ +\end{abstract} +$endif$ +$endif$ + +$for(include-before)$ +$include-before$ + +$endfor$ +$if(toc)$ +$if(beamer)$ +\begin{frame} +\tableofcontents[hideallsubsections] +\end{frame} +$else$ +{ +$if(colorlinks)$ +\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$$endif$} +$endif$ +\setcounter{tocdepth}{$toc-depth$} +\tableofcontents +} +$endif$ +$endif$ +$if(lot)$ +\listoftables +$endif$ +$if(lof)$ +\listoffigures +$endif$ +$body$ + +$if(natbib)$ +$if(bibliography)$ +$if(biblio-title)$ +$if(book-class)$ +\renewcommand\bibname{$biblio-title$} +$else$ +\renewcommand\refname{$biblio-title$} +$endif$ +$endif$ +$if(beamer)$ +\begin{frame}[allowframebreaks]{$biblio-title$} +\bibliographytrue +$endif$ +\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$} +$if(beamer)$ +\end{frame} +$endif$ + +$endif$ +$endif$ +$if(biblatex)$ +$if(beamer)$ +\begin{frame}[allowframebreaks]{$biblio-title$} +\bibliographytrue +\printbibliography[heading=none] +\end{frame} +$else$ +\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$ +$endif$ + +$endif$ +$for(include-after)$ +$include-after$ + +$endfor$ +\end{document} diff --git a/resources/sample_the-sample-document.yaml b/resources/sample_the-sample-document.yaml index a321faa..693956a 100644 --- a/resources/sample_the-sample-document.yaml +++ b/resources/sample_the-sample-document.yaml @@ -7,9 +7,11 @@ - docx - html - pdf + - beamer + - slidy :vars: - :lang: german + :lang: de-de :fontsize: 12pt :mainfont: Calibri :sansfont: Calibri @@ -39,14 +41,38 @@ :title: Main requirements (review) :filepart: review :debug: true + :format: + - latex + - docx + - html + - pdf :compact: :title: Main requirements (compact) :filepart: compact + :format: + - latex + - docx + - html + - pdf + :extended: :title: Main requirements (extended) :filepart: mieter + :format: + - latex + - docx + - html + - pdf + + + :folien: + :title: Beamer + :filepart: folien + :format: + - beamer + - pdf :snippets: - ../900_snippets/snippets.xlsx diff --git a/spec/TC_EXP_001.md b/spec/TC_EXP_001.md index b44a169..e8e0c33 100644 --- a/spec/TC_EXP_001.md +++ b/spec/TC_EXP_001.md @@ -8,9 +8,10 @@ : Perform the following steps - Create a report of used images which do not have a model release - + Expected Results : There should not be an image without model release + ~~~~ {.expectedResult label="TC_DES_003"} - logo on every page - color scheme shall be seen diff --git a/spec/Zupfnoter.jpg b/spec/Zupfnoter.jpg new file mode 100644 index 0000000..4bfd724 Binary files /dev/null and b/spec/Zupfnoter.jpg differ diff --git a/spec/tc_exp_003_reference.txt b/spec/tc_exp_003_reference.txt index 5bd930a..559fd32 100644 --- a/spec/tc_exp_003_reference.txt +++ b/spec/tc_exp_003_reference.txt @@ -1,38 +1,26 @@ - this is headline - - this is TC\_EXP\_003\_1 - - this is md TC\_EXP\_003\_2 - - this is md TC\_EXP\_003\_2 -this is headline -================ +THIS IS HEADLINE - now verbatim by indent inclucde TC_EXP_003_1.md - ## this is TC_EXP_003_1 - - we now include TC_EXP_003_2 from TC_EXP_003_1 - - ## this is md TC_EXP_003_2 - - - hugo - - - hugo2 - - end of TC_EXP_003_2 - - end of TC_EXP_003_1 -now full format inclucde TC_EXP_003_1.md + now verbatim by indent inclucde TC_EXP_003_1.md## this is TC_EXP_003_1 -this is TC_EXP_003_1 --------------------- + we now include TC_EXP_003_2 from TC_EXP_003_1## this is md TC_EXP_003_2 -we now include TC_EXP_003_2 from TC_EXP_003_1 + - hugo -this is md TC_EXP_003_2 ------------------------ + - hugo2 + + end of TC_EXP_003_2 + + end of TC_EXP_003_1 + +now full format inclucde TC_EXP_003_1.md## this is TC_EXP_003_1 + +we now include TC_EXP_003_2 from TC_EXP_003_1## this is md TC_EXP_003_2 - hugo @@ -42,10 +30,7 @@ end of TC_EXP_003_2 end of TC_EXP_003_1 -now full format inclucde TC_EXP_003_2.md - -this is md TC_EXP_003_2 ------------------------ +now full format inclucde TC_EXP_003_2.md## this is md TC_EXP_003_2 - hugo diff --git a/spec/test_beautify.md b/spec/test_beautify.md index 16a0f0a..43ed4cf 100644 --- a/spec/test_beautify.md +++ b/spec/test_beautify.md @@ -19,7 +19,6 @@ this ~~~~ - ``` {#backtick_codeblock} this @@ -28,3 +27,16 @@ this codedblock ``` + + + **QNAP Store** **iSCSI-Name** + ---------------- ------------------------ ------------------------------------------------- + **KTLStore3** ktlstore3target1\_lun0 altes Replica-Volumen für KTLAZ-Host1 + ktlstore3target2\_lun0 Hauptspeichervolumen (Laufwerk D auf KTLHost3) + ktlstore3excvol1 Speicher für Exchange (Laufwerk E auf KTLHost3) + ktlstore3excvol2 Speicher für Exchange (Laufwerk F auf KTLHost3) + **KTLStore4** ktlstore4target1\_lun0 1,5 TB Volume auf + ktlstore4target2\_lun0 Hauptspeichervolumen für KTLHost4 Laufwerk D + ktlstore4excvol1 Speicher für Exchange (Laufwerk E auf KTLHost4) + ktlstore4excvol2 Speicher für Exchange (Laufwerk F auf KTLHost4) + diff --git a/spec/test_beautify_reference.md b/spec/test_beautify_reference.md index de2052d..3130ce8 100644 --- a/spec/test_beautify_reference.md +++ b/spec/test_beautify_reference.md @@ -1,6 +1,9 @@ -% Test Markdown -% Bernhard Weichel -% 1.12.2014 +--- +author: +- Bernhard Weichel +date: '1.12.2014' +title: Test Markdown +--- # Test headlines @@ -25,3 +28,14 @@ this codedblock ~~~~ + + **QNAP Store** **iSCSI-Name** + ---------------- ------------------------ ------------------------------------------------- + **KTLStore3** ktlstore3target1\_lun0 altes Replica-Volumen für KTLAZ-Host1 + ktlstore3target2\_lun0 Hauptspeichervolumen (Laufwerk D auf KTLHost3) + ktlstore3excvol1 Speicher für Exchange (Laufwerk E auf KTLHost3) + ktlstore3excvol2 Speicher für Exchange (Laufwerk F auf KTLHost3) + **KTLStore4** ktlstore4target1\_lun0 1,5 TB Volume auf + ktlstore4target2\_lun0 Hauptspeichervolumen für KTLHost4 Laufwerk D + ktlstore4excvol1 Speicher für Exchange (Laufwerk E auf KTLHost4) + ktlstore4excvol2 Speicher für Exchange (Laufwerk F auf KTLHost4) diff --git a/spec/test_mkindex.latex b/spec/test_mkindex.latex new file mode 100644 index 0000000..24619d2 --- /dev/null +++ b/spec/test_mkindex.latex @@ -0,0 +1,250 @@ +\documentclass[twoside,a4paper,]{article} +\usepackage[T1]{fontenc} +\usepackage{lmodern} +\usepackage{amssymb,amsmath} +\usepackage{ifxetex,ifluatex} +\usepackage{fixltx2e} % provides \textsubscript +% use microtype if available +\IfFileExists{microtype.sty}{\usepackage{microtype}}{} +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \usepackage[utf8]{inputenc} + \usepackage{eurosym} +\else % if luatex or xelatex + \usepackage{fontspec} + \ifxetex + \usepackage{xltxtra,xunicode} + \fi + \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} + \newcommand{\euro}{€} +\fi +\usepackage[a4paper]{geometry} +\usepackage{longtable} +\usepackage{float} % provides the H option for float placement +\usepackage{graphicx} +% We will generate all images so they have a width \maxwidth. This means +% that they will get their normal width if they fit onto the page, but +% are scaled down if they would overflow the margins. +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth +\else\Gin@nat@width\fi} +\makeatother +\let\Oldincludegraphics\includegraphics +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth +\else\Gin@nat@width\fi} +\makeatother +\let\Oldincludegraphics\includegraphics +%\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}} +% Determine if the image is too wide for the page. +% +{% + \catcode`\@=11\relax% + \gdef\includegraphics{\@ifnextchar[{\Oldincludegraphics}{\Oldincludegraphics[width=\maxwidth]}}% +}% +% + +\ifxetex + \usepackage[setpagesize=false, % page size defined by xetex + unicode=false, % unicode breaks when used with xetex + bookmarksdepth=3, % + xetex]{hyperref} +\else + \usepackage[unicode=true]{hyperref} +\fi +\hypersetup{breaklinks=true, + bookmarks=true, + pdfauthor={}, + pdftitle={}, + colorlinks=true, + urlcolor=blue, + linkcolor=magenta, + pdfborder={0 0 0}} +\urlstyle{same} % don't use monospace font for urls +\setlength{\parindent}{0pt} +\setlength{\parskip}{6pt plus 2pt minus 1pt} +\setlength{\emergencystretch}{3em} % prevent overfull lines +\setcounter{secnumdepth}{5} + +\author{} +\date{} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Wortsammler specific settings +% +%list environment by reinhard Jahraus +{\catcode`\@=11\relax% +\gdef\itemize{% + \ifnum \@itemdepth >\thr@@\@toodeep\else + \advance\@itemdepth\@ne + \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% + \expandafter + \list + \csname\@itemitem\endcsname + {\def\makelabel##1{\hss\llap{##1}}% + \addtolength{\leftmargin}{-10pt}% 29.37pt + \addtolength{\rightmargin}{0.0pt}% 0.0pt + \addtolength{\labelsep}{0pt}% 23.50pt + \addtolength{\itemsep}{-3.0pt}% 5.0pt + \addtolength{\parsep}{-1pt}% 5.0pt + \addtolength{\topsep}{-5pt}% 10.0pt + \addtolength{\partopsep}{0pt}% 3.0pt + }% + \fi} +}% + +% +% improve nesting of lists +% %http://stackoverflow.com/questions/1935952/maximum-nesting-level-of-lists-in-latex +% +\usepackage{enumitem} +\setlistdepth{9} +\setlist[itemize,1]{label=$\bullet$} +\setlist[itemize,2]{label=$\bullet$} +\setlist[itemize,3]{label=$\bullet$} +\setlist[itemize,4]{label=$\bullet$} +\setlist[itemize,5]{label=$\bullet$} +\setlist[itemize,6]{label=$\bullet$} +\setlist[itemize,7]{label=$\bullet$} +\setlist[itemize,8]{label=$\bullet$} +\setlist[itemize,9]{label=$\bullet$} +\renewlist{itemize}{itemize}{9} +% +% multicol +% +\usepackage{multicol} +\newcommand{\wsbegintwocol}{\begin{multicols}{2}} +\newcommand{\wsendtwocol}{\end{multicols}} + +% +% embed an image in the text +% +% usage: \wsembedimage{file}{r|l}{width}{height} +\usepackage{wrapfig} +\usepackage{needspace} +\newcommand{\wsembedimage}[4]{\needspace{#4}\begin{wrapfigure}{#2}{#3}\centering% +\vspace{-5mm}\includegraphics{#1}\vspace{-1cm}\end{wrapfigure}} +% +% adjust page layout +% +\setlength{\oddsidemargin}{-0.5cm} +\setlength{\evensidemargin}{-0.5cm} +\setlength{\textwidth}{17cm} +\setlength{\topmargin}{-2.0cm} +\setlength{\headheight}{1cm} +\setlength{\headsep}{1.5cm} +\setlength{\textheight}{25cm} +\setlength{\footskip}{1cm} + +% adjust the toc layout +\makeatletter +% \renewcommand*\l@section{\@dottedtocline{2}{1.8em}{4em}} + \renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{4em}} + \renewcommand*\l@subsubsection{\@dottedtocline{2}{5.5em}{4em}} +\makeatother + +\usepackage{pdfpages} +\usepackage{bookmark} +\usepackage{fancyhdr} +\pagestyle{fancy} +\chead{\begin{center}\textbf{} \end{center}} +\rhead{\leftmark} +\lfoot{} +\rfoot{\today~} +\renewcommand{\footrulewidth}{0.4pt} +% +\renewcommand{\familydefault}{\sfdefault} +% +% Marginpars shall always be right +\makeatletter + \def\marginparright{\@mparswitchfalse} + \def\marginparoutside{\@mparswitchtrue} +\makeatother +\marginparright +% +% +\raggedbottom +% + + +\usepackage{makeidx} +\makeindex + +% +%\renewcommand{Befehl der Gliederungsebene z.B. \chapter}{\@startsection{Name z.B. chapter}{Ebene z.B. 0}{Einrückung z.B. 0pt}{Abstand zum vorigen Text z.B. 3.5ex plus 1ex minus 0pt\relax}{Abstand zum nachfolgenden Text z.B. 2.5ex plus 0.5ex minus 0pt\relax}{Schrift z.B. \normalfont\Large\bfseries}} +% +% \makeatletter% +% \renewcommand{\chapter}{\@startsection{chapter}{0}{0pt}{3.5ex plus 1ex minus 0pt\relax}{2.5ex plus 0.5ex minus 0pt\relax}{\normalfont\Large\bfseries}}% +% \makeatother% +% +% +% Wortsammler extensions end here +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{document} + + +{ +\hypersetup{linkcolor=black} +\setcounter{tocdepth}{1} +\tableofcontents +\newpage +} + +\section{Das ist ein Test zur +Indexerstellung}\label{das-ist-ein-test-zur-indexerstellung} + +Dies ist ein Typoblindtext\index{Typoblindtext}. An ihm kann man sehen, +ob alle Buchstaben da sind und wie sie aussehen. Manchmal benutzt man +Worte wie Hamburgefonts, Rafgenduks oder Handgloves, um Schriften zu +testen. + +Manchmal Sätze\index{Sätze}, die alle Buchstaben des Alphabets enthalten +- man nennt diese Sätze »Pangrams«. Sehr bekannt ist dieser: The quick +brown fox jumps over the lazy old dog. Oft werden in Typoblindtexte auch +fremdsprachige Satzteile eingebaut (AVAIL® and Wefox™ are testing aussi +la Kerning), um die Wirkung in anderen Sprachen zu testen. In Lateinisch +sieht zum Beispiel fast jede Schrift gut aus. Quod erat demonstrandum. +Seit 1975 fehlen in den meisten Testtexten die Zahlen, weswegen nach +TypoGb. 204 § ab dem Jahr 2034 Zahlen in 86 der Texte zur Pflicht +werden. Nichteinhaltung wird mit bis zu 245 \euro{} oder 368 \$ +bestraft. Genauso wichtig in sind mittlerweile auch Âçcèñtë, die in +neueren Schriften aber fast immer enthalten sind. Ein wichtiges aber +schwierig zu integrierendes Feld sind OpenType-Funktionalitäten. Je nach +Software und Voreinstellungen können eingebaute Kapitälchen, Kerning +oder Ligaturen (sehr pfiffig) nicht richtig dargestellt werden.Dies ist +ein Typoblindtext. An ihm kann man sehen, ob alle Buchstaben da sind und +wie sie aussehen. Manchmal benutzt man Worte wie Hamburgefonts, +Rafgenduks + +\index{Über}\index{Uder}\index{Ufer}\index{Äpfelchen} \clearpage + +Dies ist ein Typoblindtext\index{Typoblindtext}. An ihm kann man sehen, +ob alle Buchstaben da sind und wie sie aussehen. Manchmal benutzt man +Worte wie Hamburgefonts, Rafgenduks oder Handgloves, um Schriften zu +testen. Manchmal Sätze, die alle Buchstaben des Alphabets enthalten - +man nennt diese Sätze »Pangrams«. Sehr bekannt ist dieser: The quick +brown fox jumps over the lazy old dog. Oft werden in Typoblindtexte auch +fremdsprachige Satzteile eingebaut (AVAIL® and Wefox™ are testing aussi +la Kerning), um die Wirkung in anderen Sprachen zu testen. In Lateinisch +sieht zum Beispiel fast jede Schrift gut aus. Quod erat demonstrandum. +Seit 1975 fehlen in den meisten Testtexten die Zahlen, weswegen nach +TypoGb. 204 § ab dem Jahr 2034 Zahlen in 86 der Texte zur Pflicht +werden. Nichteinhaltung wird mit bis zu 245 \euro{} oder 368 \$ +bestraft. Genauso wichtig in sind mittlerweile auch Âçcèñtë, die in +neueren Schriften aber fast immer enthalten sind. Ein wichtiges aber +schwierig zu integrierendes Feld sind OpenType-Funktionalitäten. Je nach +Software und Voreinstellungen können eingebaute Kapitälchen, Kerning +oder Ligaturen (sehr pfiffig) nicht richtig dargestellt werden.Dies ist +ein Typoblindtext. An ihm kann man sehen, ob alle Buchstaben da sind und +wie sie aussehen. Manchmal benutzt man Worte wie Hamburgefonts, +Rafgenduks + +\clearpage + +hier kommt der Index + +\printindex + +ende des Index + +\end{document} diff --git a/spec/test_mkindex.lst b/spec/test_mkindex.lst new file mode 100644 index 0000000..f328f5b --- /dev/null +++ b/spec/test_mkindex.lst @@ -0,0 +1,108 @@ +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:42: rendering test_mkindex as [pdf, latex] +[WARN] wortsammler 1.0.3: 2018-07-17 19:03:46: for details see line 151 test_mkindex.log +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: Package fixltx2e Warning: fixltx2e is not required with releases after 2015 +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: (fixltx2e) All fixes are now in the LaTeX kernel. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: (fixltx2e) See the latexrelease package for details. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: ) (/usr/local/texlive/2015/texmf-dist/tex/latex/microtype/microtype.sty +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: +[WARN] wortsammler 1.0.3: 2018-07-17 19:03:46: for details see line 733 test_mkindex.log +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: Package hyperref Warning: Option `bookmarks' has already been used, +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: (hyperref) setting the option has no effect on input line 61. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/se-ascii-print.def +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: File: se-ascii-print.def 2011/12/02 v1.10 stringenc: Printable ASCII characters +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: +[WARN] wortsammler 1.0.3: 2018-07-17 19:03:46: for details see line 980 test_mkindex.log +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: Package Fancyhdr Warning: \headheight is too small (28.45274pt): +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: Make it at least 35.60004pt. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: We now make it that large for the rest of the document. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: This may cause the page layout to be inconsistent, however. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: +[WARN] wortsammler 1.0.3: 2018-07-17 19:03:46: for details see line 997 test_mkindex.log +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: Package Fancyhdr Warning: \headheight is too small (28.45274pt): +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: Make it at least 35.60004pt. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: We now make it that large for the rest of the document. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: This may cause the page layout to be inconsistent, however. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: +[WARN] wortsammler 1.0.3: 2018-07-17 19:03:46: for details see line 1004 test_mkindex.log +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: Package Fancyhdr Warning: \headheight is too small (28.45274pt): +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: Make it at least 35.60004pt. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: We now make it that large for the rest of the document. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: This may cause the page layout to be inconsistent, however. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: +[WARN] wortsammler 1.0.3: 2018-07-17 19:03:46: for details see line 1015 test_mkindex.log +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: Package Fancyhdr Warning: \headheight is too small (28.45274pt): +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: Make it at least 35.60004pt. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: We now make it that large for the rest of the document. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: This may cause the page layout to be inconsistent, however. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: +[WARN] wortsammler 1.0.3: 2018-07-17 19:03:46: for details see line 1029 test_mkindex.log +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: Package Fancyhdr Warning: \headheight is too small (28.45274pt): +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: Make it at least 35.60004pt. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: We now make it that large for the rest of the document. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: This may cause the page layout to be inconsistent, however. +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: Output written on /Users/beweiche/beweiche_noTimeMachine/202_wortsammler-gem/sp +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: ec/test_mkindex.pdf (6 pages). +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: logfilter: errors = 0 +[INFO] wortsammler 1.0.3: 2018-07-17 19:03:46: logfilter: warnings = 7 +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:35: rendering test_mkindex as [pdf, latex] +[WARN] wortsammler 1.0.3: 2018-07-17 19:06:38: for details see line 151 test_mkindex.log +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: Package fixltx2e Warning: fixltx2e is not required with releases after 2015 +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: (fixltx2e) All fixes are now in the LaTeX kernel. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: (fixltx2e) See the latexrelease package for details. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: ) (/usr/local/texlive/2015/texmf-dist/tex/latex/microtype/microtype.sty +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: +[WARN] wortsammler 1.0.3: 2018-07-17 19:06:38: for details see line 733 test_mkindex.log +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: Package hyperref Warning: Option `bookmarks' has already been used, +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: (hyperref) setting the option has no effect on input line 61. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/se-ascii-print.def +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: File: se-ascii-print.def 2011/12/02 v1.10 stringenc: Printable ASCII characters +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: +[WARN] wortsammler 1.0.3: 2018-07-17 19:06:38: for details see line 980 test_mkindex.log +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: Package Fancyhdr Warning: \headheight is too small (28.45274pt): +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: Make it at least 35.60004pt. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: We now make it that large for the rest of the document. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: This may cause the page layout to be inconsistent, however. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: +[WARN] wortsammler 1.0.3: 2018-07-17 19:06:38: for details see line 997 test_mkindex.log +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: Package Fancyhdr Warning: \headheight is too small (28.45274pt): +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: Make it at least 35.60004pt. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: We now make it that large for the rest of the document. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: This may cause the page layout to be inconsistent, however. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: +[WARN] wortsammler 1.0.3: 2018-07-17 19:06:38: for details see line 1004 test_mkindex.log +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: Package Fancyhdr Warning: \headheight is too small (28.45274pt): +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: Make it at least 35.60004pt. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: We now make it that large for the rest of the document. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: This may cause the page layout to be inconsistent, however. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: +[WARN] wortsammler 1.0.3: 2018-07-17 19:06:38: for details see line 1015 test_mkindex.log +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: Package Fancyhdr Warning: \headheight is too small (28.45274pt): +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: Make it at least 35.60004pt. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: We now make it that large for the rest of the document. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: This may cause the page layout to be inconsistent, however. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: +[WARN] wortsammler 1.0.3: 2018-07-17 19:06:38: for details see line 1029 test_mkindex.log +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: Package Fancyhdr Warning: \headheight is too small (28.45274pt): +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: Make it at least 35.60004pt. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: We now make it that large for the rest of the document. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: This may cause the page layout to be inconsistent, however. +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: Output written on /Users/beweiche/beweiche_noTimeMachine/202_wortsammler-gem/sp +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: ec/test_mkindex.pdf (6 pages). +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: logfilter: errors = 0 +[INFO] wortsammler 1.0.3: 2018-07-17 19:06:38: logfilter: warnings = 7 diff --git a/spec/test_mkindex.pdf b/spec/test_mkindex.pdf new file mode 100644 index 0000000..037742f Binary files /dev/null and b/spec/test_mkindex.pdf differ diff --git a/spec/test_mkindex.txt b/spec/test_mkindex.txt new file mode 100644 index 0000000..0fd6654 --- /dev/null +++ b/spec/test_mkindex.txt @@ -0,0 +1,60 @@ +CONTENTS + +CONTENTS + +Contents +1 Das ist ein Test zur Indexerstellung 2 + +1 + +July 17, 2018 + + 1 + +DAS IST EIN TEST ZUR INDEXERSTELLUNG + +1 Das ist ein Test zur Indexerstellung +Dies ist ein Typoblindtext. An ihm kann man sehen, ob alle Buchstaben da sind und wie sie aussehen. Manchmal benutzt man Worte wie Hamburgefonts, Rafgenduks oder Handgloves, um Schriften zu testen. Manchmal Stze, die alle Buchstaben des Alphabets enthalten - man nennt diese Stze Pangrams. Sehr bekannt ist dieser: The quick brown fox jumps over the lazy old dog. Oft werden in Typoblindtexte auch fremdsprachige Satzteile eingebaut (AVAIL and WefoxTM are testing aussi la Kerning), um die Wirkung in anderen Sprachen zu testen. In Lateinisch sieht zum Beispiel fast jede Schrift gut aus. Quod erat demonstrandum. Seit 1975 fehlen in den meisten Testtexten die Zahlen, weswegen nach TypoGb. 204 ab dem Jahr 2034 Zahlen in 86 der Texte zur Pflicht werden. Nichteinhaltung wird mit bis zu 245 oder 368 $ bestraft. Genauso wichtig in sind mittlerweile auch ct, die in neueren Schriften aber fast immer enthalten sind. Ein wichtiges aber schwierig zu integrierendes Feld sind OpenType-Funktionalitten. Je nach Software und Voreinstellungen knnen eingebaute Kapitlchen, Kerning oder Ligaturen (sehr pfiffig) nicht richtig dargestellt werden.Dies ist ein Typoblindtext. An ihm kann man sehen, ob alle Buchstaben da sind und wie sie aussehen. Manchmal benutzt man Worte wie Hamburgefonts, Rafgenduks + +2 + +July 17, 2018 + + 1 DAS IST EIN TEST ZUR INDEXERSTELLUNG + +1 + +DAS IST EIN TEST ZUR INDEXERSTELLUNG + +Dies ist ein Typoblindtext. An ihm kann man sehen, ob alle Buchstaben da sind und wie sie aussehen. Manchmal benutzt man Worte wie Hamburgefonts, Rafgenduks oder Handgloves, um Schriften zu testen. Manchmal Stze, die alle Buchstaben des Alphabets enthalten - man nennt diese Stze Pangrams. Sehr bekannt ist dieser: The quick brown fox jumps over the lazy old dog. Oft werden in Typoblindtexte auch fremdsprachige Satzteile eingebaut (AVAIL and WefoxTM are testing aussi la Kerning), um die Wirkung in anderen Sprachen zu testen. In Lateinisch sieht zum Beispiel fast jede Schrift gut aus. Quod erat demonstrandum. Seit 1975 fehlen in den meisten Testtexten die Zahlen, weswegen nach TypoGb. 204 ab dem Jahr 2034 Zahlen in 86 der Texte zur Pflicht werden. Nichteinhaltung wird mit bis zu 245 oder 368 $ bestraft. Genauso wichtig in sind mittlerweile auch ct, die in neueren Schriften aber fast immer enthalten sind. Ein wichtiges aber schwierig zu integrierendes Feld sind OpenType-Funktionalitten. Je nach Software und Voreinstellungen knnen eingebaute Kapitlchen, Kerning oder Ligaturen (sehr pfiffig) nicht richtig dargestellt werden.Dies ist ein Typoblindtext. An ihm kann man sehen, ob alle Buchstaben da sind und wie sie aussehen. Manchmal benutzt man Worte wie Hamburgefonts, Rafgenduks + +3 + +July 17, 2018 + + 1 + +DAS IST EIN TEST ZUR INDEXERSTELLUNG + +hier kommt der Index + +4 + +July 17, 2018 + + Index +Stze, 2 Typoblindtext, 2, 3 Uder, 2 Ufer, 2 pfelchen, 2 ber, 2 + +5 + + INDEX + +INDEX + +ende des Index + +6 + +July 17, 2018 + + \ No newline at end of file diff --git a/spec/test_mkindex_reference.txt b/spec/test_mkindex_reference.txt index c688838..9d56c27 100644 --- a/spec/test_mkindex_reference.txt +++ b/spec/test_mkindex_reference.txt @@ -3,35 +3,22 @@ CONTENTS CONTENTS Contents -1 Das ist ein Test zur Indexerstellung - -2 +1 Das ist ein Test zur Indexerstellung 2 1 -December 17, 2014 +January 5, 2019 1 DAS IST EIN TEST ZUR INDEXERSTELLUNG 1 Das ist ein Test zur Indexerstellung -Dies ist ein Typoblindtext. An ihm kann man sehen, ob alle Buchstaben da sind und wie sie aussehen. Manchmal -benutzt man Worte wie Hamburgefonts, Rafgenduks oder Handgloves, um Schriften zu testen. -Manchmal Sätze, die alle Buchstaben des Alphabets enthalten - man nennt diese Sätze »Pangrams«. Sehr bekannt -ist dieser: The quick brown fox jumps over the lazy old dog. Oft werden in Typoblindtexte auch fremdsprachige -Satzteile eingebaut (AVAIL® and Wefox™ are testing aussi la Kerning), um die Wirkung in anderen Sprachen zu -testen. In Lateinisch sieht zum Beispiel fast jede Schrift gut aus. Quod erat demonstrandum. Seit 1975 fehlen in -den meisten Testtexten die Zahlen, weswegen nach TypoGb. 204 § ab dem Jahr 2034 Zahlen in 86 der Texte zur -Pflicht werden. Nichteinhaltung wird mit bis zu 245 € oder 368 $ bestraft. Genauso wichtig in sind mittlerweile auch -Âçcèñtë, die in neueren Schriften aber fast immer enthalten sind. Ein wichtiges aber schwierig zu integrierendes Feld -sind OpenType-Funktionalitäten. Je nach Software und Voreinstellungen können eingebaute Kapitälchen, Kerning -oder Ligaturen (sehr pfiffig) nicht richtig dargestellt werden.Dies ist ein Typoblindtext. An ihm kann man sehen, ob -alle Buchstaben da sind und wie sie aussehen. Manchmal benutzt man Worte wie Hamburgefonts, Rafgenduks +Dies ist ein Typoblindtext. An ihm kann man sehen, ob alle Buchstaben da sind und wie sie aussehen. Manchmal benutzt man Worte wie Hamburgefonts, Rafgenduks oder Handgloves, um Schriften zu testen. Manchmal Stze, die alle Buchstaben des Alphabets enthalten - man nennt diese Stze Pangrams. Sehr bekannt ist dieser: The quick brown fox jumps over the lazy old dog. Oft werden in Typoblindtexte auch fremdsprachige Satzteile eingebaut (AVAIL and WefoxTM are testing aussi la Kerning), um die Wirkung in anderen Sprachen zu testen. In Lateinisch sieht zum Beispiel fast jede Schrift gut aus. Quod erat demonstrandum. Seit 1975 fehlen in den meisten Testtexten die Zahlen, weswegen nach TypoGb. 204 ab dem Jahr 2034 Zahlen in 86 der Texte zur Pflicht werden. Nichteinhaltung wird mit bis zu 245 oder 368 $ bestraft. Genauso wichtig in sind mittlerweile auch ct, die in neueren Schriften aber fast immer enthalten sind. Ein wichtiges aber schwierig zu integrierendes Feld sind OpenType-Funktionalitten. Je nach Software und Voreinstellungen knnen eingebaute Kapitlchen, Kerning oder Ligaturen (sehr pfiffig) nicht richtig dargestellt werden.Dies ist ein Typoblindtext. An ihm kann man sehen, ob alle Buchstaben da sind und wie sie aussehen. Manchmal benutzt man Worte wie Hamburgefonts, Rafgenduks 2 -December 17, 2014 +January 5, 2019 1 DAS IST EIN TEST ZUR INDEXERSTELLUNG @@ -39,22 +26,11 @@ December 17, 2014 DAS IST EIN TEST ZUR INDEXERSTELLUNG -Dies ist ein Typoblindtext. An ihm kann man sehen, ob alle Buchstaben da sind und wie sie aussehen. Manchmal -benutzt man Worte wie Hamburgefonts, Rafgenduks oder Handgloves, um Schriften zu testen. Manchmal Sätze, -die alle Buchstaben des Alphabets enthalten - man nennt diese Sätze »Pangrams«. Sehr bekannt ist dieser: The -quick brown fox jumps over the lazy old dog. Oft werden in Typoblindtexte auch fremdsprachige Satzteile eingebaut -(AVAIL® and Wefox™ are testing aussi la Kerning), um die Wirkung in anderen Sprachen zu testen. In Lateinisch sieht -zum Beispiel fast jede Schrift gut aus. Quod erat demonstrandum. Seit 1975 fehlen in den meisten Testtexten die -Zahlen, weswegen nach TypoGb. 204 § ab dem Jahr 2034 Zahlen in 86 der Texte zur Pflicht werden. Nichteinhaltung -wird mit bis zu 245 € oder 368 $ bestraft. Genauso wichtig in sind mittlerweile auch Âçcèñtë, die in neueren Schriften -aber fast immer enthalten sind. Ein wichtiges aber schwierig zu integrierendes Feld sind OpenType-Funktionalitäten. -Je nach Software und Voreinstellungen können eingebaute Kapitälchen, Kerning oder Ligaturen (sehr pfiffig) nicht -richtig dargestellt werden.Dies ist ein Typoblindtext. An ihm kann man sehen, ob alle Buchstaben da sind und wie -sie aussehen. Manchmal benutzt man Worte wie Hamburgefonts, Rafgenduks +Dies ist ein Typoblindtext. An ihm kann man sehen, ob alle Buchstaben da sind und wie sie aussehen. Manchmal benutzt man Worte wie Hamburgefonts, Rafgenduks oder Handgloves, um Schriften zu testen. Manchmal Stze, die alle Buchstaben des Alphabets enthalten - man nennt diese Stze Pangrams. Sehr bekannt ist dieser: The quick brown fox jumps over the lazy old dog. Oft werden in Typoblindtexte auch fremdsprachige Satzteile eingebaut (AVAIL and WefoxTM are testing aussi la Kerning), um die Wirkung in anderen Sprachen zu testen. In Lateinisch sieht zum Beispiel fast jede Schrift gut aus. Quod erat demonstrandum. Seit 1975 fehlen in den meisten Testtexten die Zahlen, weswegen nach TypoGb. 204 ab dem Jahr 2034 Zahlen in 86 der Texte zur Pflicht werden. Nichteinhaltung wird mit bis zu 245 oder 368 $ bestraft. Genauso wichtig in sind mittlerweile auch ct, die in neueren Schriften aber fast immer enthalten sind. Ein wichtiges aber schwierig zu integrierendes Feld sind OpenType-Funktionalitten. Je nach Software und Voreinstellungen knnen eingebaute Kapitlchen, Kerning oder Ligaturen (sehr pfiffig) nicht richtig dargestellt werden.Dies ist ein Typoblindtext. An ihm kann man sehen, ob alle Buchstaben da sind und wie sie aussehen. Manchmal benutzt man Worte wie Hamburgefonts, Rafgenduks 3 -December 17, 2014 +January 5, 2019 1 @@ -64,15 +40,10 @@ hier kommt der Index 4 -December 17, 2014 +January 5, 2019 Index -Sätze, 2 -Typoblindtext, 2, 3 -Uder, 2 -Ufer, 2 -Äpfelchen, 2 -Über, 2 +Stze, 2 Typoblindtext, 2, 3 Uder, 2 Ufer, 2 pfelchen, 2 ber, 2 5 @@ -84,6 +55,6 @@ ende des Index 6 -December 17, 2014 +January 5, 2019 \ No newline at end of file diff --git a/spec/test_slides.md b/spec/test_slides.md new file mode 100644 index 0000000..5972181 --- /dev/null +++ b/spec/test_slides.md @@ -0,0 +1,38 @@ +% Wortsammler Test Slides +% Bernhard Weichel +% 17.12.2014 + +# Slide 1 + +This is text on Slide 1 + +## this is subtitle in Slide 1 + +Lorem ipsum blafasel + +# Slide 2: Lists + +## Bullets + +* bullte 1 +* bullet 2 +* bullet 3 + +## Numeric + +1. Number 1 +2. Number 2 +3. Number 3 + +## definition + +MD +: Markdown, really cool + +Wortsammler +: Wortsammler also really cool + +# an image + +![Zupfnoter](Zupfnoter.jpg) + diff --git a/spec/wortsammler_spec.rb b/spec/wortsammler_spec.rb index b0e5d1d..dde591d 100644 --- a/spec/wortsammler_spec.rb +++ b/spec/wortsammler_spec.rb @@ -1,12 +1,13 @@ require 'rake' require 'tmpdir' require 'pry' +require 'wortsammler.rb' wortsammlerbin = "'#{File.expand_path("bin")}'" -wortsammler = "'#{File.expand_path(File.join("bin", "wortsammler"))}'" +wortsammler = "'#{File.expand_path(File.join("bin", "wortsammler"))}'" testprojectdir = "testproject/30_Sources" -specdir = File.dirname(__FILE__) -testoutput = "#{specdir}/../testoutput" +specdir = File.dirname(__FILE__) +testoutput = "#{specdir}/../testoutput" describe "Wortsammler generic issues" do @@ -14,12 +15,12 @@ it "provides a help", :exp => false do result = `#{wortsammler} -h` result.should include("Usage: Wortsammler [options]") - $?.success?.should==true + $?.success?.should == true end it "runs silent", :exp => false do result = `#{wortsammler}` - result.empty?.should==true + result.empty?.should == true end it "reports version numbers", :exp => false do @@ -37,16 +38,16 @@ it "can create a new project folder", :exp => false do FileUtils.rm_rf(testprojectdir) system "#{wortsammler} -n #{testprojectdir}" - $?.success?.should==true + $?.success?.should == true Dir["#{testprojectdir}/**/*"].should include "#{testprojectdir}/001_Main" Dir["#{testprojectdir}/**/snippets.xlsx"].should include "#{testprojectdir}/900_snippets/snippets.xlsx" end it "does not initialize into an existing project folder" do - tempdir=Dir.mktmpdir + tempdir = Dir.mktmpdir `#{wortsammler} -n #{tempdir}` - $?.success?.should==false + $?.success?.should == false end it "controls the pandoc options by document class" do @@ -57,7 +58,7 @@ describe "Wortsammler options validator" do it "rejects no processing" do system "#{wortsammler} -i." - $?.success?.should==false + $?.success?.should == false end @@ -67,58 +68,58 @@ it "beautifies all markdown files in a folder" do - tempdir=Dir.mktmpdir - mdtext="#this is headline\n\n lorem ipsum\n\nbla fasel" + tempdir = Dir.mktmpdir + mdtext = "#this is headline\n\n lorem ipsum\n\nbla fasel" - cycles=10 + cycles = 10 cycles.times { |i| File.open("#{tempdir}/#{i}.md", "w") { |f| f.puts mdtext } } system "#{wortsammler} -bi #{tempdir}" - $?.success?.should==true + $?.success?.should == true cycles.times { |i| - beautified_result=File.open("#{tempdir}/#{i}.md").readlines.join + beautified_result = File.open("#{tempdir}/#{i}.md").readlines.join beautified_result.should include("# this is headline") } end - it "beautifies a single file" do - tempdir=Dir.mktmpdir - mdfile="#{tempdir}/single.md" - mdtext="#this is headline\n\n lorem ipsum\n\nbla fasel" + it "beautifies a single file", exp: false do + tempdir = Dir.mktmpdir + mdfile = "#{tempdir}/single.md" + mdtext = "#this is headline\n\n lorem ipsum\n\nbla fasel" File.open(mdfile, "w") { |f| f.puts mdtext } system "#{wortsammler} -bi #{mdfile}" - $?.success?.should==true + $?.success?.should == true - beautified_result=File.open(mdfile).readlines.join + beautified_result = File.open(mdfile).readlines.join beautified_result.should include("# this is headline") end it "recognizes if the specified manifest file is a directory", exp: false do FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") { |d| - manifest="../ZSUPP_Manifests" - cmd= "#{wortsammler} -bm #{manifest} 2>&1" - r=`#{cmd}` - r.include?("directory").should==true + manifest = "../ZSUPP_Manifests" + cmd = "#{wortsammler} -bm #{manifest} 2>&1" + r = `#{cmd}` + r.include?("directory").should == true } - $?.success?.should==false + $?.success?.should == false end it "beautifies input files in a manifest" do FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") { |d| manifest = "../ZSUPP_Manifests/sample_the-sample-document.yaml" - cmd = "#{wortsammler} -bm #{manifest}" + cmd = "#{wortsammler} -bm #{manifest}" system cmd } - $?.success?.should==true + $?.success?.should == true end it "claims missing input" do system "#{wortsammler} -b" - $?.success?.should==false + $?.success?.should == false end @@ -128,9 +129,9 @@ end it "creates a semantically unchanged markdown file", exp: false do - testname = 'test_beautify' - inputfile = %Q{#{specdir}/#{testname}.md} - outputfile = %Q{#{testoutput}/#{testname}.md} + testname = 'test_beautify' + inputfile = %Q{#{specdir}/#{testname}.md} + outputfile = %Q{#{testoutput}/#{testname}.md} referencefile = %Q{#{specdir}/#{testname}_reference.md} FileUtils.cp(inputfile, outputfile) @@ -138,7 +139,7 @@ system cmd reference = File.open(referencefile).read - result = File.open(outputfile).read + result = File.open(outputfile).read result.should == reference end @@ -147,50 +148,50 @@ describe "Wortsammler conversion" do it "converts a single file to output format" do - tempdir=Dir.mktmpdir - mdfile="#{tempdir}/single.md" - mdtext="#this is headline\n\n lorem ipsum\n\nbla fasel" + tempdir = Dir.mktmpdir + mdfile = "#{tempdir}/single.md" + mdtext = "#this is headline\n\n lorem ipsum\n\nbla fasel" File.open(mdfile, "w") { |f| f.puts mdtext } system "#{wortsammler} -pi #{mdfile} -o #{tempdir} -f latex:pdf:html:docx" - $?.success?.should==true + $?.success?.should == true - Dir["#{tempdir}/*"].map { |f| File.basename(f) }.should== ["single.docx", - "single.html", - "single.latex", - "single.log", - "single.md", - "single.pdf" + Dir["#{tempdir}/*"].map { |f| File.basename(f) }.sort.should == ["single.docx", + "single.html", + "single.latex", + "single.log", + "single.md", + "single.pdf" ] end it "converts a single file to default output format" do - tempdir=Dir.mktmpdir - mdfile="#{tempdir}/single.md" - mdtext="#this is headline\n\n lorem ipsum\n\nbla fasel" + tempdir = Dir.mktmpdir + mdfile = "#{tempdir}/single.md" + mdtext = "#this is headline\n\n lorem ipsum\n\nbla fasel" File.open(mdfile, "w") { |f| f.puts mdtext } system "#{wortsammler} -pi #{mdfile} -o #{tempdir}" - $?.success?.should==true + $?.success?.should == true - Dir["#{tempdir}/*"].map { |f| File.basename(f) }.should== ["single.log", - "single.md", - "single.pdf" + Dir["#{tempdir}/*"].map { |f| File.basename(f) }.sort.should == ["single.log", + "single.md", + "single.pdf" ] end it "handles chapters up to 6 levels", exp: false do - tempdir="#{specdir}/../testoutput" - mdfile="#{tempdir}/chapternesting.md" - mdtext="#this is headline\n\n lorem ipsum\n\nbla fasel" + tempdir = "#{specdir}/../testoutput" + mdfile = "#{tempdir}/chapternesting.md" + mdtext = "#this is headline\n\n lorem ipsum\n\nbla fasel" def lorem(j) (1.upto 100).map { |i| "text_#{j} lorem ipsum #{i} dolor " }.join(" ") end def chapter(i, depth) - ["\n\n", "##########"[1..depth], " this is example on level #{i} .. #{depth}\n\n", + ["\n\n", "##########"[1 .. depth], " this is example on level #{i} .. #{depth}\n\n", lorem(i), ].join("") end @@ -204,27 +205,27 @@ def chapter(i, depth) } system "#{wortsammler} -pbi '#{mdfile}' -o '#{tempdir}' -f pdf:latex" - $?.success?.should==true + $?.success?.should == true - Dir["#{tempdir}/chapternesting*"].map { |f| File.basename(f) }.sort.should== ["chapternesting.md", - "chapternesting.pdf", - "chapternesting.latex", - "chapternesting.log", - "chapternesting.md.bak" + Dir["#{tempdir}/chapternesting*"].map { |f| File.basename(f) }.sort.should == ["chapternesting.md", + "chapternesting.pdf", + "chapternesting.latex", + "chapternesting.log", + "chapternesting.md.bak" ].sort end it "handles lists up to 9 levels", exp: false do - tempdir="#{specdir}/../testoutput" - mdfile="#{tempdir}/listnesting.md" - mdtext="#this is headline\n\n lorem ipsum\n\nbla fasel" + tempdir = "#{specdir}/../testoutput" + mdfile = "#{tempdir}/listnesting.md" + mdtext = "#this is headline\n\n lorem ipsum\n\nbla fasel" def lorem(j) (1.upto 100).map { |i| "text_#{j} lorem ipsum #{i} dolor " }.join(" ") end def chapter(i, depth) - ["\n\n", "##########"[1..depth], " this is example on level #{i} .. #{depth}\n\n", + ["\n\n", "##########"[1 .. depth], " this is example on level #{i} .. #{depth}\n\n", lorem(i), ].join("") end @@ -236,79 +237,85 @@ def chapter(i, depth) f.puts "" 0.upto 8 do |i| - f.puts [" "*i, "- this is list level #{i}"].join + f.puts [" " * i, "- this is list level #{i}"].join end } system "#{wortsammler} -pbi '#{mdfile}' -o '#{tempdir}' -f pdf:latex" - $?.success?.should==true + $?.success?.should == true - Dir["#{tempdir}/listnesting*"].map { |f| File.basename(f) }.sort.should== ["listnesting.md", - "listnesting.pdf", - "listnesting.latex", - "listnesting.log", - "listnesting.md.bak" + Dir["#{tempdir}/listnesting*"].map { |f| File.basename(f) }.sort.should == ["listnesting.md", + "listnesting.pdf", + "listnesting.latex", + "listnesting.log", + "listnesting.md.bak" ].sort end it "converts all files within a folder to output format" do - tempdir=Dir.mktmpdir - mdtext="# Header\n\n lorem ipsum\n" + tempdir = Dir.mktmpdir + mdtext = "# Header\n\n lorem ipsum\n" basefiles = ["f1", "f2", "f3"] - outfiles = basefiles.map { |f| ["#{f}.md", "#{f}.latex"] }.flatten.sort + outfiles = basefiles.map { |f| ["#{f}.md", "#{f}.latex"] }.flatten.sort basefiles.each { |f| File.open("#{tempdir}/#{f}.md", "w") { |fo| fo.puts mdtext } } system "#{wortsammler} -pi #{tempdir} -o #{tempdir} -f latex" - $?.success?.should==true + $?.success?.should == true - Dir["#{tempdir}/*"].map { |f| File.basename(f) }.sort.should== outfiles + Dir["#{tempdir}/*"].map { |f| File.basename(f) }.sort.should == outfiles end it "processes a manifest" do FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") { |d| - manifest="../ZSUPP_Manifests/sample_the-sample-document.yaml" - cmd= "#{wortsammler} -pm #{manifest}" + manifest = "../ZSUPP_Manifests/sample_the-sample-document.yaml" + cmd = "#{wortsammler} -pm #{manifest}" system cmd } - $?.success?.should==true + $?.success?.should == true end it "investigates the existence of a manifest" do - manifest="testproject/30_Sources/ZSUPP_Manifests/xxthis-path-does-not-exist.yaml" + manifest = "testproject/30_Sources/ZSUPP_Manifests/xxthis-path-does-not-exist.yaml" system "#{wortsammler} -m #{manifest}" - $?.success?.should==false + $?.success?.should == false end it "extracts the traceables according to a manifest", :exp => false do - manifest="testproject/30_Sources/ZSUPP_Manifests/sample_the-sample-document.yaml" + manifest = "testproject/30_Sources/ZSUPP_Manifests/sample_the-sample-document.yaml" + tracefile = "testproject/30_Sources/ZGEN_RequirementsTracing/RS_Main.traces.md" + FileUtils.rm(tracefile) if File.exists?(tracefile) + system "#{wortsammler} -cm #{manifest}" - $?.success?.should==true + result = File.read("testproject/30_Sources/ZGEN_RequirementsTracing/RS_Main.traces.md") + + expect(result).to include("\\[RS\\_Comp\\_001\\] **Flexibler Dokumentumfang** { }()") + $?.success?.should == true end it "extracts plantuml according to a manifest", :exp => false do - manifest="testproject/30_Sources/ZSUPP_Manifests/sample_the-sample-document.yaml" + manifest = "testproject/30_Sources/ZSUPP_Manifests/sample_the-sample-document.yaml" system "#{wortsammler} -um #{manifest}" - $?.success?.should==true + $?.success?.should == true end it "extracts plantuml from a single file", :exp => false do - outfile="#{testoutput}/authentification.png" + outfile = "#{testoutput}/authentification.png" FileUtils.rm(outfile) if File.exists?(outfile) system "#{wortsammler} -ui \"#{specdir}/TC_EXP_002.md\"" - $?.success?.should==true - File.exist?(outfile).should==true + $?.success?.should == true + File.exist?(outfile).should == true end it "extracts plantuml from a folder", :exp => false do - outfile="#{testoutput}/authentification.png" + outfile = "#{testoutput}/authentification.png" FileUtils.rm(outfile) if File.exists?(outfile) system "#{wortsammler} -ui \"#{specdir}\"" - $?.success?.should==true - File.exist?(outfile).should==true + $?.success?.should == true + File.exist?(outfile).should == true end @@ -321,55 +328,80 @@ def chapter(i, depth) end - it "runs the rake file in the sample document" do + it "runs the rake file in the sample document", exp: false do FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") { |d| - path=ENV['PATH'] - ENV['PATH']="#{wortsammlerbin}:#{path}" + path = ENV['PATH'] + ENV['PATH'] = "#{wortsammlerbin}:#{path}" puts ENV['PATH'] #system 'wortsammler -h' - cmd= "rake sample" + cmd = "rake sample" system cmd } - $?.success?.should==true + Dir["testproject/30_Sources/ZGEN_Documents/*.*"].count.should == 15 + $?.success?.should == true end - it "compiles all documents" do + it "compiles all documents", exp: false do FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") { |d| - path=ENV['PATH'] - ENV['PATH']="#{wortsammlerbin}:#{path}" + path = ENV['PATH'] + ENV['PATH'] = "#{wortsammlerbin}:#{path}" puts ENV['PATH'] #system 'wortsammler -h' - cmd= "rake all" + cmd = "rake all" #system cmd } end end +describe "Wortsammler output formats" do + + + it "generates dzslides", exp: false do + mdfile = %Q{'#{specdir}/test_slides.md'} + FileUtils.cd("spec") do + system %Q{#{wortsammler} -pi #{mdfile} -o '#{testoutput}' -f slidy} + end + end + + + it "generates beamer files", exp: false do + mdfile = %Q{'#{specdir}/test_slides.md'} + FileUtils.cd("spec") do + system %Q{#{wortsammler} -pi #{mdfile} -o '#{testoutput}' -f beamer} + end + end + + + it "generates markdown", exp: true do + + end +end + describe "Wortsammler syntax extensions", :exp => false do it "[RS_Comp_012] supports embedded images" do - tempdir ="#{specdir}/../testoutput" - imagefile ="floating-image.pdf" + tempdir = "#{specdir}/../testoutput" + imagefile = "floating-image.pdf" FileUtils.cd(tempdir) { |c| FileUtils.cp("#{specdir}/#{imagefile}", ".") - mdfile="embedded-image.md" - - mdtext=["#this is headline", - (5..100).to_a.map { |oi| - ["\n\n", - "this is image\n\n~~EMBED \"#{imagefile}\" o 40mm 60mm~~", - (1..20).to_a.map { |ii| - "#{oi} und #{ii} lorem ipsum und blafasel" - }.join(" "), - "\n\n", - (5..15+oi).to_a.map { |ii| - "#{oi} und #{ii} lorem ipsum und blafasel" - }.join(" "), - "\n\n"] - } + mdfile = "embedded-image.md" + + mdtext = ["#this is headline", + (5 .. 100).to_a.map { |oi| + ["\n\n", + "this is image\n\n~~EMBED \"#{imagefile}\" o 40mm 60mm~~", + (1 .. 20).to_a.map { |ii| + "#{oi} und #{ii} lorem ipsum und blafasel" + }.join(" "), + "\n\n", + (5 .. 15 + oi).to_a.map { |ii| + "#{oi} und #{ii} lorem ipsum und blafasel" + }.join(" "), + "\n\n"] + } ].flatten.join("\n") File.open(mdfile, "w") { |f| f.puts mdtext } @@ -377,54 +409,54 @@ def chapter(i, depth) system "#{wortsammler} -pi '#{mdfile}' -o '.' -f pdf:latex:html:docx" FileUtils.rm imagefile } - $?.success?.should==true + $?.success?.should == true end it "TC_EXP_001 expands expected results from testcases", exp: false do - proc=ReferenceTweaker.new("pdf") - outfile="#{specdir}/../testoutput/TC_EXP_001.output.md" + proc = ReferenceTweaker.new("pdf") + outfile = "#{specdir}/../testoutput/TC_EXP_001.output.md" File.unlink(outfile) if File.exists?(outfile) proc.prepareFile("#{specdir}/TC_EXP_001.md", outfile) - a=File.open(outfile, "r").readlines.join + a = File.open(outfile, "r").readlines.join a.should include("TC-DES-003-01") end it "TC_EXP_002 removes plantuml sources", exp: false do - proc=ReferenceTweaker.new("pdf") - outfile="#{specdir}/../testoutput/TC_EXP_002.output.md" + proc = ReferenceTweaker.new("pdf") + outfile = "#{specdir}/../testoutput/TC_EXP_002.output.md" File.unlink(outfile) if File.exists?(outfile) proc.prepareFile("#{specdir}/TC_EXP_002.md", outfile) - a=File.open(outfile, "r").readlines.join - a.include?(".plantuml").should==false + a = File.open(outfile, "r").readlines.join + a.include?(".plantuml").should == false end - it "TC_EXP_003 handles Markdown inlays", exp: false do - tempdir ="#{specdir}/../testoutput" - mdinlayfile ="TC_EXP_003_1.md" - mdinlayfile_1 ="TC_EXP_003_2.md" - mdfile="tc_exp_003" + it "TC_EXP_003x handles Markdown inlays", exp: true do + tempdir = "#{specdir}/../testoutput" + mdinlayfile = "TC_EXP_003_1.md" + mdinlayfile_1 = "TC_EXP_003_2.md" + mdfile = "tc_exp_003" FileUtils.cd(tempdir) { |c| FileUtils.cp("#{specdir}/#{mdinlayfile}", ".") FileUtils.cp("#{specdir}/#{mdinlayfile_1}", ".") - mdtext=["#this is headline", - "", - "~~~~", - "", "now verbatim by indent inclucde #{mdinlayfile}", "", - " ~~MD \"#{mdinlayfile}\"~~", - "~~~~", - "", - "", "now full format inclucde #{mdinlayfile}", "", - "~~MD \"#{mdinlayfile}\"~~", - "", - "", "now full format inclucde #{mdinlayfile_1}", "", - "~~MD \"#{mdinlayfile_1}\"~~", + mdtext = ["#this is headline", + "", + "~~~~", + "", "now verbatim by indent inclucde #{mdinlayfile}", "", + " ~~MD \"#{mdinlayfile.gsub('_', '\_')}\"~~", + "~~~~", + "", + "", "now full format inclucde #{mdinlayfile}", "", + "~~MD \"#{mdinlayfile}\"~~", + "", + "", "now full format inclucde #{mdinlayfile_1}", "", + "~~MD \"#{mdinlayfile_1}\"~~", ].flatten.join("\n") File.open("#{mdfile}.md", "w") { |f| f.puts mdtext } @@ -434,24 +466,28 @@ def chapter(i, depth) FileUtils.rm mdinlayfile_1 } - ref = File.open("#{specdir}/tc_exp_003_reference.txt").read + ref = File.open("#{specdir}/tc_exp_003_reference.txt").read result = File.open("#{tempdir}/#{mdfile}.txt").read - ref.should==result + + expect(result).to eq ref end it "generates an index", exp: false do system "wortsammler -pi \"#{specdir}/test_mkindex.md\" -f pdf:latex -o \"#{testoutput}\"" system "pdftotext \"#{testoutput}/test_mkindex.pdf\"" - ref = File.open("#{specdir}/test_mkindex_reference.txt").read - result = File.open("#{testoutput}/test_mkindex.txt").read - ref.should==result + the_time = Time.now.strftime("%B %-d, %Y") + ref = File.open("#{specdir}/test_mkindex_reference.txt", encoding: "ISO-8859-1").read + result = File.open("#{testoutput}/test_mkindex.txt", encoding: "ISO-8859-1").read + result = result.gsub(the_time, "January 5, 2019") # adapt this if you update the reference + expect(result).to eq ref end it "reports TeX messages", exp: false do - system "wortsammler -pi \"#{specdir}/test_mkindex.md\" -f pdf:latex >> \"#{specdir}/test_mkindex.lst\"" - system "pdftotext \"#{specdir}/test_mkindex.pdf\"" - result = File.open("#{specdir}/test_mkindex.lst").read - result.include?("[WARN]").should==true + system %Q{wortsammler -pi '#{specdir}/test_mkindex.md' -f pdf:latex -o '#{testoutput}' >> '#{testoutput}/test_mkindex.lst'} + system "pdftotext \"#{testoutput}/test_mkindex.pdf\"" + result = File.open("#{testoutput }/test_mkindex.lst").read + result.include?("[WARN]").should == true end + end \ No newline at end of file diff --git a/testproject.xx/30_Sources/001_Main/main.md b/testproject.xx/30_Sources/001_Main/main.md new file mode 100644 index 0000000..2c7f89f --- /dev/null +++ b/testproject.xx/30_Sources/001_Main/main.md @@ -0,0 +1,273 @@ +--- +author: +- Bernhard Weichel +- and others +date: '2013/05' +title: Wortsammler sample document +... + +# Introduction + +This is a sample document for Wortsammler + +# Anforderung an Dokumentenaufbereiter + +- [RS_Comp_003] **Steuerung Dokumentenzusammenstellung** + {Dokumentenzusammenstellungen soll über ein + manifest ->[RS_Comp_007] gesteuert werden. + + - Die Manifeste sollen als Laufzeitparameter übergeben werden + - Das Manifest enthält auch die Ausgabedatei + + }(RS_DM_014, RS_DM_010, RS_DM_005) + +- [RS_Comp_004] **Prozessierung Einzeldokument** {Soll Dokumente + verschiedenen Umfangs erzeugen können: + + - einzelnes Files + - zu Prüfzwecken + + Steuerung soll über Konfiguration (Manifest) + erfolgen ->[RS_Comp_007]. + + }() + +- [RS_Comp_005] **Erstellung Loseblattsammlung** {Soll Dokumente + verschiedenen Umfangs erzeugen können: + + - kann aus dem Manifest errechnet werden ->[RS_Comp_007] + + }() + +- [RS_Comp_006] **Inkrementelle Verarbeitung** {Soll nur auf + geänderte Dokumente reagieren können: + + - ähnlich wie make/rake + + }() + +- [RS_Comp_007] **Anforderungen an Manifest** {Folgende + Anforderungen gelten für das Manifest + - einfach bearbeiten - nur liste der Files + - Markdown-lite + - Yaml + + Inhalte im Manifest sind + + - Name der Konfiguration + - Ausgabeverzeichnis + - Ausgabeformat + - Name des generierten Dokumentes + - Formate in denen das Dokument generiert wird. Werte hierfür + ergeben sich aus den Anforderungen an die Aufbereitet + - zu verarbeitende Eingabedateien. Diese werden in der Reihenfolge + verarbeitet wie sie aufgeführt sind. + - Optionen für die jeweiligen Formate. + - zu bearbeitende Zielgruppen ->[RS_Comp_008] + + + Beispiel für ein manifest + + - + :name: komplett + :outdir: ../ZGEN_Documents + :outname: RS_Requirements-Ngopm + :format: + - pdf + - html + - rtf + - docx + - latex + + :lang: german + + :vars: + :lang: german + + :editions: + :intern: + :title: Interne Ausgabe + :filepart: _intern + :extern: + :title: Externe Ausgabe + :filepart: _extern + :mieter: + :title: Ausgabe für Mieter + :filepart: _mieter + :ea: + :title: Ausgabe für ehrenamtliche Mitarbeiter + :filepart: _ma-ehrenamtlich + :ha: + :title: Ausgabe für hauptamtliche Mitarbeiter + :filepart: _ma-hauptamtlich + :1: + :title: Ausgabe für erste hauptamtliche Mitarbeiter + :filepart: _ma-hauptamtlich-1 + + :input: + - ../RS_Process/RS_Process.md + - ../RS_Tooling/RS_Tooling.md + - ../RS_Tooling/RS_MarkdownCleaner.md + - ../RS_Tooling/RS_MarkdownEditor.md + - ../RS_Tooling/RS_DocumentComposer.md + - ../TPL_DirectoryStructure/TPL_DirectoryStructure.md + - ../TR_Installation/TR_Installation.md + - ../TR_Installation/TR_Proo-Handbuch.md + - ../ZGEN_RequirementsTracing/ZGEN_Reqtrace.md + + :snippets: + - ../TS_Markdown/TS_Snippets.yaml + - ../TS_Markdown/TS_MoreSnippets.yaml + + }(RS_Comp_003) + +## Zielgruppenspezifische Ausgaben + +Dieser Abschnitt behandelt speziell die Anforderungen an flexible +Dokumentenausgabe + +- [RS_Comp_001] **Flexibler Dokumentumfang** {Soll Dokumente + verschiedenen Umfangs erzeugen können: + + - einzelnes Files + - Zusammengestelltes Dokument + + }(RS_Comp_003) + +- [RS_Comp_002] **Flexible Dokumentendarstellung** {Sollte Dokumente + in verschiedener Darstellung erzeugen können: + - Seitenlayout + - Detaillierungsgrad (z.B. RequirementsMarken ausblenden) } + (RS_Comp_003) +- [RS_Comp_008] **Zielgruppenspezifische Ausgaben (Editionen)** { Es + soll möglich sein Zielgruppenspezifische Ausgaben zu erstellen. + + - Dabei wird die Zielgruppe durch eine spezifische Zeichenkette + umgeschaltet (Durchstreichung), die auch in standard Markdown + Programmen eine sinnvolle Ausgabe liefert: + + `~~ED intern extern~~` ab hier gilt: Text erscheint in Ausgabe + `intern` als auch in `extern` + + Es handelt sich also um ein durchgestrichenes Muster als + regulärer Ausdruck + + ~~ED((\s* \S+)*)~~ + + - Die Umschaltung wirkt ab einschliesslich der Zeile, die die + Umschaltung enthält, bis zum Aufruf einer neuen Umschaltung. + + - Die möglichen Zielgruppen werden im Manifest + festgelegt ->[RS_Comp_007] daselbst Eintrag `:editions:` + + - Eine vorgegebene Zielgruppe `all` erzeugt keine spezifische + Ausgabe. Sie kennzeichnet vielmehr Inhalte, die in **allen** + Ausgaben gleichermassen enthalten sind. + + - Bei einer Aufteilung auf mehrere Dateien wird empfohlen am Ende + einer jeden Datei auf `all` zu schalten. Dadurch wird das System + einfache wartbar. + + }(RS_Comp_003) + + Alternativen für die Umschaltung sind: + + \marginpar{intern} + + - ~~ED intern extern~~ und so geht es weiter + + - ^ZG intern extern^ und nun kommt der text der nur extern ist + + \marginpar{extern} + + - ~ZG intern extern~ und hier ist der text der nur intern ist + + - + und nun geht es weiter + + \marginpar{intern} + + - und nun geht es intern weiter Gelaber und weiter +- [RS_Comp_009] **Gesamtausgabe mit allen Texten zur Prüfung** + {Sollte Dokumente Eine Gesamtausgabe mit allen Texten zur + Überprüfung soll erstellt werden. In diesem Fall werden die Ausgaben + am Rand notiert. }(RS_Comp_003) + +- [RS_Comp_010] **Erstellung aller Ausgaben mit einem Befehl** {Es + sollen immer alle Ausgaben gleichermassen generiert werden. Dabei + gilt: + + - Der Dateiname für die generierten Dokumente bildet sich nach + + `{:outname:}_{:edition:.:filepart:}.{format}` + + - In der Kopfzeile des Dokumentes wird `:edition:.:title:` + eingefügt, so dass die Ausgabe auf jeder Seite identifiziert + werden kann. + + Ohne Angabe einer Zielgruppe bzw. mit der Angabe `all` soll + wortsammler alle Ausgaben erstellen. + + Die Angabe einer einzelnen Zielgruppe erstellt dann auch nur die + gewählte Ausgabe. + + }(RS_Comp_003) + +## Processing TODO - open issues + +Paragraphs like starting with + + TODO: #13 do something are used to manage the open issues + +## Processing the traceables + +## Including Files + +- [RS_Comp_011] **including Plain pdf-Pages**{ PDF pages can be + included by + + `~~PDF "lib/01234_particularPdf.pdf" "Das ist der Eintrag im Inhaltsverzeichnis" 1 2-4~~` + + It is done in a markdown verbatim section. By this, Pandoc does not + add linebreaks in the command such that it can be processed with + regular expressions. + + }(RS_Comp_003) + +- [RS_Comp_014] **Including markdown files** { + + `~~MD "lib/01234/xxxx/yyyy.md"~~` + + will be replaced by the content of the argument. It should even work + inline. + + }(RS_Comp_003) + +## Handling Text Snippets + +- [RS_Comp_012] **Including text Snippets**{ Text Snippts can be + included by + + `~~SN {symbol}~~` + + The snippets are taken from one of the snippet databases declared in + the manifest ->[RS_Comp_007] according to the format + in ->[RS_Comp_013]. }() + +- [RS_Conp_013] **Defining text Snippets** { + + Text snippets are defined as a yaml file in the following format: + + :Snippet1: Das ist Snippet 1 + + :Snippet2: |- Das ist snippet 2. Es enthält sogar eine Liste + + * Das ist item 1 in Snippet 2 + + * Das ist item 2 in Snippet 2 + + }(RS_Comp_003) + +### this should not show up in toc + +This chapter should not show up in the toc diff --git a/testproject.xx/30_Sources/900_snippets/snippets.xlsx b/testproject.xx/30_Sources/900_snippets/snippets.xlsx new file mode 100644 index 0000000..e69de29 diff --git a/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_compact.docx b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_compact.docx new file mode 100644 index 0000000..e69de29 diff --git a/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_compact.html b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_compact.html new file mode 100644 index 0000000..23988f7 --- /dev/null +++ b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_compact.html @@ -0,0 +1,145 @@ + + + + + + + + + Wortsammler sample document + + + + + +

1 Introduction

+

This is a sample document for Wortsammler

+

2 Anforderung an Dokumentenaufbereiter

+
    +
  • [RS_Comp_003] Steuerung Dokumentenzusammenstellung {Dokumentenzusammenstellungen soll über ein manifest [RS_Comp_007] gesteuert werden.

    +
      +
    • Die Manifeste sollen als Laufzeitparameter übergeben werden
    • +
    • Das Manifest enthält auch die Ausgabedatei
    • +
    +

    }(RS_DM_014, RS_DM_010, RS_DM_005)

  • +
  • [RS_Comp_004] Prozessierung Einzeldokument {Soll Dokumente verschiedenen Umfangs erzeugen können:

    +
      +
    • einzelnes Files
    • +
    • zu Prüfzwecken
    • +
    +

    Steuerung soll über Konfiguration (Manifest) erfolgen [RS_Comp_007].

    +

    }()

  • +
  • [RS_Comp_005] Erstellung Loseblattsammlung {Soll Dokumente verschiedenen Umfangs erzeugen können:

    +
      +
    • kann aus dem Manifest errechnet werden [RS_Comp_007]
    • +
    +

    }()

  • +
  • [RS_Comp_006] Inkrementelle Verarbeitung {Soll nur auf geänderte Dokumente reagieren können:

    +
      +
    • ähnlich wie make/rake
    • +
    +

    }()

  • +
  • [RS_Comp_007] Anforderungen an Manifest {Folgende Anforderungen gelten für das Manifest +
      +
    • einfach bearbeiten - nur liste der Files
    • +
    • Markdown-lite
    • +
    • Yaml
    • +
    +

    Inhalte im Manifest sind

    +
      +
    • Name der Konfiguration
    • +
    • Ausgabeverzeichnis
    • +
    • Ausgabeformat
    • +
    • Name des generierten Dokumentes
    • +
    • Formate in denen das Dokument generiert wird. Werte hierfür ergeben sich aus den Anforderungen an die Aufbereitet
    • +
    • zu verarbeitende Eingabedateien. Diese werden in der Reihenfolge verarbeitet wie sie aufgeführt sind.
    • +
    • Optionen für die jeweiligen Formate.
    • +
    • zu bearbeitende Zielgruppen [RS_Comp_008]
    • +
    + +

    Beispiel für ein manifest

    +
     -
    +   :name:  komplett
    +   :outdir: ../ZGEN_Documents
    +   :outname: RS_Requirements-Ngopm
    +   :format:
    +     - pdf
    +     - html
    +     - rtf
    +     - docx
    +     - latex
    +
    +   :lang: german  
    +
    +   :vars:
    +       :lang: german
    +
    +   :editions:
    +     :intern: 
    +         :title: Interne Ausgabe
    +         :filepart: _intern 
    +     :extern: 
    +         :title: Externe Ausgabe
    +         :filepart: _extern
    +     :mieter: 
    +         :title: Ausgabe für Mieter
    +         :filepart: _mieter
    +     :ea: 
    +         :title: Ausgabe für ehrenamtliche Mitarbeiter
    +         :filepart: _ma-ehrenamtlich
    +     :ha: 
    +         :title: Ausgabe für hauptamtliche Mitarbeiter
    +         :filepart: _ma-hauptamtlich
    +     :1: 
    +         :title: Ausgabe für erste hauptamtliche Mitarbeiter
    +         :filepart: _ma-hauptamtlich-1
    +
    +   :input: 
    +     - ../RS_Process/RS_Process.md 
    +     - ../RS_Tooling/RS_Tooling.md 
    +     - ../RS_Tooling/RS_MarkdownCleaner.md 
    +     - ../RS_Tooling/RS_MarkdownEditor.md 
    +     - ../RS_Tooling/RS_DocumentComposer.md  
    +     - ../TPL_DirectoryStructure/TPL_DirectoryStructure.md
    +     - ../TR_Installation/TR_Installation.md
    +     - ../TR_Installation/TR_Proo-Handbuch.md
    +     - ../ZGEN_RequirementsTracing/ZGEN_Reqtrace.md
    +
    +   :snippets:
    +     - ../TS_Markdown/TS_Snippets.yaml
    +     - ../TS_Markdown/TS_MoreSnippets.yaml
    +

    }(RS_Comp_003)

  • +
+

2.1 Zielgruppenspezifische Ausgaben

+

Dieser Abschnitt behandelt speziell die Anforderungen an flexible Dokumentenausgabe

+
    +
  • [RS_Comp_001] Flexibler Dokumentumfang {Soll Dokumente verschiedenen Umfangs erzeugen können:

    +
      +
    • einzelnes Files
    • +
    • Zusammengestelltes Dokument
    • +
    +

    }(RS_Comp_003)

  • +
  • [RS_Comp_002] Flexible Dokumentendarstellung {Sollte Dokumente in verschiedener Darstellung erzeugen können: +
      +
    • Seitenlayout
    • +
    • Detaillierungsgrad (z.B. RequirementsMarken ausblenden) } (RS_Comp_003)
    • +
  • +
  • [RS_Comp_008] Zielgruppenspezifische Ausgaben (Editionen) { Es soll möglich sein Zielgruppenspezifische Ausgaben zu erstellen.

    +
      +
    • Dabei wird die Zielgruppe durch eine spezifische Zeichenkette umgeschaltet (Durchstreichung), die auch in standard Markdown Programmen eine sinnvolle Ausgabe liefert:
    • +
  • +
+ + diff --git a/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_compact.latex b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_compact.latex new file mode 100644 index 0000000..34277c2 --- /dev/null +++ b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_compact.latex @@ -0,0 +1,416 @@ +\documentclass[twoside,a4paper,12pt,german,]{article} +\usepackage[T1]{fontenc} +\usepackage{lmodern} +\usepackage{amssymb,amsmath} +\usepackage{ifxetex,ifluatex} +\usepackage{fixltx2e} % provides \textsubscript +% use microtype if available +\IfFileExists{microtype.sty}{\usepackage{microtype}}{} +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \usepackage[utf8]{inputenc} +\else % if luatex or xelatex + \usepackage{fontspec} + \ifxetex + \usepackage{xltxtra,xunicode} + \fi + \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} + \newcommand{\euro}{€} + \setmainfont{Calibri} + \setsansfont{Calibri} +\fi +\usepackage[a4paper]{geometry} +\usepackage{longtable} +\usepackage{float} % provides the H option for float placement +\usepackage{graphicx} +% We will generate all images so they have a width \maxwidth. This means +% that they will get their normal width if they fit onto the page, but +% are scaled down if they would overflow the margins. +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth +\else\Gin@nat@width\fi} +\makeatother +\let\Oldincludegraphics\includegraphics +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth +\else\Gin@nat@width\fi} +\makeatother +\let\Oldincludegraphics\includegraphics +%\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}} +% Determine if the image is too wide for the page. +% +{% + \catcode`\@=11\relax% + \gdef\includegraphics{\@ifnextchar[{\Oldincludegraphics}{\Oldincludegraphics[width=\maxwidth]}}% +}% +% + +\ifxetex + \usepackage[setpagesize=false, % page size defined by xetex + unicode=false, % unicode breaks when used with xetex + bookmarksdepth=3, % + xetex]{hyperref} +\else + \usepackage[unicode=true]{hyperref} +\fi +\hypersetup{breaklinks=true, + bookmarks=true, + pdfauthor={Bernhard Weichel; and others}, + pdftitle={Wortsammler sample document}, + colorlinks=true, + urlcolor=blue, + linkcolor=magenta, + pdfborder={0 0 0}} +\urlstyle{same} % don't use monospace font for urls +\setlength{\parindent}{0pt} +\setlength{\parskip}{6pt plus 2pt minus 1pt} +\setlength{\emergencystretch}{3em} % prevent overfull lines +\setcounter{secnumdepth}{5} +\ifxetex + \usepackage{polyglossia} + \setmainlanguage{german} +\else + \usepackage[german]{babel} +\fi + +\title{Main requirements (compact)} +\author{Bernhard Weichel \and and others} +\date{2013/05} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Wortsammler specific settings +% +%list environment by reinhard Jahraus +{\catcode`\@=11\relax% +\gdef\itemize{% + \ifnum \@itemdepth >\thr@@\@toodeep\else + \advance\@itemdepth\@ne + \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% + \expandafter + \list + \csname\@itemitem\endcsname + {\def\makelabel##1{\hss\llap{##1}}% + \addtolength{\leftmargin}{-10pt}% 29.37pt + \addtolength{\rightmargin}{0.0pt}% 0.0pt + \addtolength{\labelsep}{0pt}% 23.50pt + \addtolength{\itemsep}{-3.0pt}% 5.0pt + \addtolength{\parsep}{-1pt}% 5.0pt + \addtolength{\topsep}{-5pt}% 10.0pt + \addtolength{\partopsep}{0pt}% 3.0pt + }% + \fi} +}% + +% +% improve nesting of lists +% %http://stackoverflow.com/questions/1935952/maximum-nesting-level-of-lists-in-latex +% +\usepackage{enumitem} +\setlistdepth{9} +\setlist[itemize,1]{label=$\bullet$} +\setlist[itemize,2]{label=$\bullet$} +\setlist[itemize,3]{label=$\bullet$} +\setlist[itemize,4]{label=$\bullet$} +\setlist[itemize,5]{label=$\bullet$} +\setlist[itemize,6]{label=$\bullet$} +\setlist[itemize,7]{label=$\bullet$} +\setlist[itemize,8]{label=$\bullet$} +\setlist[itemize,9]{label=$\bullet$} +\renewlist{itemize}{itemize}{9} +% +% multicol +% +\usepackage{multicol} +\newcommand{\wsbegintwocol}{\begin{multicols}{2}} +\newcommand{\wsendtwocol}{\end{multicols}} + +% +% embed an image in the text +% +% usage: \wsembedimage{file}{r|l}{width}{height} +\usepackage{wrapfig} +\usepackage{needspace} +\newcommand{\wsembedimage}[4]{\needspace{#4}\begin{wrapfigure}{#2}{#3}\centering% +\vspace{-5mm}\includegraphics{#1}\vspace{-1cm}\end{wrapfigure}} +% +% adjust page layout +% +\setlength{\oddsidemargin}{-0.5cm} +\setlength{\evensidemargin}{-0.5cm} +\setlength{\textwidth}{17cm} +\setlength{\topmargin}{-2.0cm} +\setlength{\headheight}{1cm} +\setlength{\headsep}{1.5cm} +\setlength{\textheight}{25cm} +\setlength{\footskip}{1cm} + +% adjust the toc layout +\makeatletter +% \renewcommand*\l@section{\@dottedtocline{2}{1.8em}{4em}} + \renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{4em}} + \renewcommand*\l@subsubsection{\@dottedtocline{2}{5.5em}{4em}} +\makeatother + +\usepackage{pdfpages} +\usepackage{bookmark} +\usepackage{fancyhdr} +\pagestyle{fancy} +\chead{\begin{center}\textbf{Main requirements (compact)} \end{center}} +\lhead{\includegraphics{../ZSUPP_Styles/logo.jpg}} +\rhead{\leftmark} +\lfoot{Bernhard Weichel} +\rfoot{\today~2013/05} +\renewcommand{\footrulewidth}{0.4pt} +% +\renewcommand{\familydefault}{\sfdefault} +% +% Marginpars shall always be right +\makeatletter + \def\marginparright{\@mparswitchfalse} + \def\marginparoutside{\@mparswitchtrue} +\makeatother +\marginparright +% +% +\raggedbottom +% + + +\usepackage{makeidx} +\makeindex + +% +%\renewcommand{Befehl der Gliederungsebene z.B. \chapter}{\@startsection{Name z.B. chapter}{Ebene z.B. 0}{Einrückung z.B. 0pt}{Abstand zum vorigen Text z.B. 3.5ex plus 1ex minus 0pt\relax}{Abstand zum nachfolgenden Text z.B. 2.5ex plus 0.5ex minus 0pt\relax}{Schrift z.B. \normalfont\Large\bfseries}} +% +% \makeatletter% +% \renewcommand{\chapter}{\@startsection{chapter}{0}{0pt}{3.5ex plus 1ex minus 0pt\relax}{2.5ex plus 0.5ex minus 0pt\relax}{\normalfont\Large\bfseries}}% +% \makeatother% +% +% +% Wortsammler extensions end here +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{document} +\maketitle + +\clearpage + +{ +\hypersetup{linkcolor=black} +\setcounter{tocdepth}{1} +\tableofcontents +\newpage +} + +\section{Introduction}\label{introduction} + +This is a sample document for Wortsammler + +\section{Anforderung an +Dokumentenaufbereiter}\label{anforderung-an-dokumentenaufbereiter} + +\begin{itemize} +\item + {[}RS\_Comp\_003{]} \textbf{\hypertarget{RS-Comp-003}{}Steuerung + Dokumentenzusammenstellung} \{Dokumentenzusammenstellungen soll über + ein manifest {[}\hyperlink{RS-Comp-007}{RS\_Comp\_007}{]} gesteuert + werden. + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + Die Manifeste sollen als Laufzeitparameter übergeben werden + \item + Das Manifest enthält auch die Ausgabedatei + \end{itemize} + + \}(\hyperlink{RS-DM-014}{RS\_DM\_014}, + \hyperlink{RS-DM-010}{RS\_DM\_010}, + \hyperlink{RS-DM-005}{RS\_DM\_005}) +\item + {[}RS\_Comp\_004{]} \textbf{\hypertarget{RS-Comp-004}{}Prozessierung + Einzeldokument} \{Soll Dokumente verschiedenen Umfangs erzeugen + können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + einzelnes Files + \item + zu Prüfzwecken + \end{itemize} + + Steuerung soll über Konfiguration (Manifest) erfolgen + {[}\hyperlink{RS-Comp-007}{RS\_Comp\_007}{]}. + + \}() +\item + {[}RS\_Comp\_005{]} \textbf{\hypertarget{RS-Comp-005}{}Erstellung + Loseblattsammlung} \{Soll Dokumente verschiedenen Umfangs erzeugen + können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + kann aus dem Manifest errechnet werden + {[}\hyperlink{RS-Comp-007}{RS\_Comp\_007}{]} + \end{itemize} + + \}() +\item + {[}RS\_Comp\_006{]} \textbf{\hypertarget{RS-Comp-006}{}Inkrementelle + Verarbeitung} \{Soll nur auf geänderte Dokumente reagieren können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + ähnlich wie make/rake + \end{itemize} + + \}() +\item + {[}RS\_Comp\_007{]} \textbf{\hypertarget{RS-Comp-007}{}Anforderungen + an Manifest} \{Folgende Anforderungen gelten für das Manifest + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + einfach bearbeiten - nur liste der Files + \item + Markdown-lite + \item + Yaml + \end{itemize} + + Inhalte im Manifest sind + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + Name der Konfiguration + \item + Ausgabeverzeichnis + \item + Ausgabeformat + \item + Name des generierten Dokumentes + \item + Formate in denen das Dokument generiert wird. Werte hierfür ergeben + sich aus den Anforderungen an die Aufbereitet + \item + zu verarbeitende Eingabedateien. Diese werden in der Reihenfolge + verarbeitet wie sie aufgeführt sind. + \item + Optionen für die jeweiligen Formate. + \item + zu bearbeitende Zielgruppen + {[}\hyperlink{RS-Comp-008}{RS\_Comp\_008}{]} + \end{itemize} + + Beispiel für ein manifest + +\begin{verbatim} + - + :name: komplett + :outdir: ../ZGEN_Documents + :outname: RS_Requirements-Ngopm + :format: + - pdf + - html + - rtf + - docx + - latex + + :lang: german + + :vars: + :lang: german + + :editions: + :intern: + :title: Interne Ausgabe + :filepart: _intern + :extern: + :title: Externe Ausgabe + :filepart: _extern + :mieter: + :title: Ausgabe für Mieter + :filepart: _mieter + :ea: + :title: Ausgabe für ehrenamtliche Mitarbeiter + :filepart: _ma-ehrenamtlich + :ha: + :title: Ausgabe für hauptamtliche Mitarbeiter + :filepart: _ma-hauptamtlich + :1: + :title: Ausgabe für erste hauptamtliche Mitarbeiter + :filepart: _ma-hauptamtlich-1 + + :input: + - ../RS_Process/RS_Process.md + - ../RS_Tooling/RS_Tooling.md + - ../RS_Tooling/RS_MarkdownCleaner.md + - ../RS_Tooling/RS_MarkdownEditor.md + - ../RS_Tooling/RS_DocumentComposer.md + - ../TPL_DirectoryStructure/TPL_DirectoryStructure.md + - ../TR_Installation/TR_Installation.md + - ../TR_Installation/TR_Proo-Handbuch.md + - ../ZGEN_RequirementsTracing/ZGEN_Reqtrace.md + + :snippets: + - ../TS_Markdown/TS_Snippets.yaml + - ../TS_Markdown/TS_MoreSnippets.yaml +\end{verbatim} + + \}(\hyperlink{RS-Comp-003}{RS\_Comp\_003}) +\end{itemize} + +\subsection{Zielgruppenspezifische +Ausgaben}\label{zielgruppenspezifische-ausgaben} + +Dieser Abschnitt behandelt speziell die Anforderungen an flexible +Dokumentenausgabe + +\begin{itemize} +\item + {[}RS\_Comp\_001{]} \textbf{\hypertarget{RS-Comp-001}{}Flexibler + Dokumentumfang} \{Soll Dokumente verschiedenen Umfangs erzeugen + können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + einzelnes Files + \item + Zusammengestelltes Dokument + \end{itemize} + + \}(\hyperlink{RS-Comp-003}{RS\_Comp\_003}) +\item + {[}RS\_Comp\_002{]} \textbf{\hypertarget{RS-Comp-002}{}Flexible + Dokumentendarstellung} \{Sollte Dokumente in verschiedener Darstellung + erzeugen können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + Seitenlayout + \item + Detaillierungsgrad (z.B. RequirementsMarken ausblenden) \} + (RS\_Comp\_003) + \end{itemize} +\item + {[}RS\_Comp\_008{]} + \textbf{\hypertarget{RS-Comp-008}{}Zielgruppenspezifische Ausgaben + (Editionen)} \{ Es soll möglich sein Zielgruppenspezifische Ausgaben + zu erstellen. + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + Dabei wird die Zielgruppe durch eine spezifische Zeichenkette + umgeschaltet (Durchstreichung), die auch in standard Markdown + Programmen eine sinnvolle Ausgabe liefert: + \end{itemize} +\end{itemize} + +\end{document} diff --git a/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_compact.pdf b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_compact.pdf new file mode 100644 index 0000000..e69de29 diff --git a/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_folien.beamer.pdf b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_folien.beamer.pdf new file mode 100644 index 0000000..e69de29 diff --git a/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_folien.docx b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_folien.docx new file mode 100644 index 0000000..e69de29 diff --git a/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_folien.html b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_folien.html new file mode 100644 index 0000000..40e876f --- /dev/null +++ b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_folien.html @@ -0,0 +1,145 @@ + + + + + + + + + Wortsammler sample document + + + + + +

1 Introduction

+

This is a sample document for Wortsammler

+

2 Anforderung an Dokumentenaufbereiter

+
    +
  • [RS_Comp_003] Steuerung Dokumentenzusammenstellung {Dokumentenzusammenstellungen soll über ein manifest [RS_Comp_007] gesteuert werden.

    +
      +
    • Die Manifeste sollen als Laufzeitparameter übergeben werden
    • +
    • Das Manifest enthält auch die Ausgabedatei
    • +
    +

    }(RS_DM_014, RS_DM_010, RS_DM_005)

  • +
  • [RS_Comp_004] Prozessierung Einzeldokument {Soll Dokumente verschiedenen Umfangs erzeugen können:

    +
      +
    • einzelnes Files
    • +
    • zu Prüfzwecken
    • +
    +

    Steuerung soll über Konfiguration (Manifest) erfolgen [RS_Comp_007].

    +

    }()

  • +
  • [RS_Comp_005] Erstellung Loseblattsammlung {Soll Dokumente verschiedenen Umfangs erzeugen können:

    +
      +
    • kann aus dem Manifest errechnet werden [RS_Comp_007]
    • +
    +

    }()

  • +
  • [RS_Comp_006] Inkrementelle Verarbeitung {Soll nur auf geänderte Dokumente reagieren können:

    +
      +
    • ähnlich wie make/rake
    • +
    +

    }()

  • +
  • [RS_Comp_007] Anforderungen an Manifest {Folgende Anforderungen gelten für das Manifest +
      +
    • einfach bearbeiten - nur liste der Files
    • +
    • Markdown-lite
    • +
    • Yaml
    • +
    +

    Inhalte im Manifest sind

    +
      +
    • Name der Konfiguration
    • +
    • Ausgabeverzeichnis
    • +
    • Ausgabeformat
    • +
    • Name des generierten Dokumentes
    • +
    • Formate in denen das Dokument generiert wird. Werte hierfür ergeben sich aus den Anforderungen an die Aufbereitet
    • +
    • zu verarbeitende Eingabedateien. Diese werden in der Reihenfolge verarbeitet wie sie aufgeführt sind.
    • +
    • Optionen für die jeweiligen Formate.
    • +
    • zu bearbeitende Zielgruppen [RS_Comp_008]
    • +
    + +

    Beispiel für ein manifest

    +
     -
    +   :name:  komplett
    +   :outdir: ../ZGEN_Documents
    +   :outname: RS_Requirements-Ngopm
    +   :format:
    +     - pdf
    +     - html
    +     - rtf
    +     - docx
    +     - latex
    +
    +   :lang: german  
    +
    +   :vars:
    +       :lang: german
    +
    +   :editions:
    +     :intern: 
    +         :title: Interne Ausgabe
    +         :filepart: _intern 
    +     :extern: 
    +         :title: Externe Ausgabe
    +         :filepart: _extern
    +     :mieter: 
    +         :title: Ausgabe für Mieter
    +         :filepart: _mieter
    +     :ea: 
    +         :title: Ausgabe für ehrenamtliche Mitarbeiter
    +         :filepart: _ma-ehrenamtlich
    +     :ha: 
    +         :title: Ausgabe für hauptamtliche Mitarbeiter
    +         :filepart: _ma-hauptamtlich
    +     :1: 
    +         :title: Ausgabe für erste hauptamtliche Mitarbeiter
    +         :filepart: _ma-hauptamtlich-1
    +
    +   :input: 
    +     - ../RS_Process/RS_Process.md 
    +     - ../RS_Tooling/RS_Tooling.md 
    +     - ../RS_Tooling/RS_MarkdownCleaner.md 
    +     - ../RS_Tooling/RS_MarkdownEditor.md 
    +     - ../RS_Tooling/RS_DocumentComposer.md  
    +     - ../TPL_DirectoryStructure/TPL_DirectoryStructure.md
    +     - ../TR_Installation/TR_Installation.md
    +     - ../TR_Installation/TR_Proo-Handbuch.md
    +     - ../ZGEN_RequirementsTracing/ZGEN_Reqtrace.md
    +
    +   :snippets:
    +     - ../TS_Markdown/TS_Snippets.yaml
    +     - ../TS_Markdown/TS_MoreSnippets.yaml
    +

    }(RS_Comp_003)

  • +
+

2.1 Zielgruppenspezifische Ausgaben

+

Dieser Abschnitt behandelt speziell die Anforderungen an flexible Dokumentenausgabe

+
    +
  • [RS_Comp_001] Flexibler Dokumentumfang {Soll Dokumente verschiedenen Umfangs erzeugen können:

    +
      +
    • einzelnes Files
    • +
    • Zusammengestelltes Dokument
    • +
    +

    }(RS_Comp_003)

  • +
  • [RS_Comp_002] Flexible Dokumentendarstellung {Sollte Dokumente in verschiedener Darstellung erzeugen können: +
      +
    • Seitenlayout
    • +
    • Detaillierungsgrad (z.B. RequirementsMarken ausblenden) } (RS_Comp_003)
    • +
  • +
  • [RS_Comp_008] Zielgruppenspezifische Ausgaben (Editionen) { Es soll möglich sein Zielgruppenspezifische Ausgaben zu erstellen.

    +
      +
    • Dabei wird die Zielgruppe durch eine spezifische Zeichenkette umgeschaltet (Durchstreichung), die auch in standard Markdown Programmen eine sinnvolle Ausgabe liefert:
    • +
  • +
+ + diff --git a/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_folien.latex b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_folien.latex new file mode 100644 index 0000000..97f1a2f --- /dev/null +++ b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_folien.latex @@ -0,0 +1,416 @@ +\documentclass[twoside,a4paper,12pt,german,]{article} +\usepackage[T1]{fontenc} +\usepackage{lmodern} +\usepackage{amssymb,amsmath} +\usepackage{ifxetex,ifluatex} +\usepackage{fixltx2e} % provides \textsubscript +% use microtype if available +\IfFileExists{microtype.sty}{\usepackage{microtype}}{} +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \usepackage[utf8]{inputenc} +\else % if luatex or xelatex + \usepackage{fontspec} + \ifxetex + \usepackage{xltxtra,xunicode} + \fi + \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} + \newcommand{\euro}{€} + \setmainfont{Calibri} + \setsansfont{Calibri} +\fi +\usepackage[a4paper]{geometry} +\usepackage{longtable} +\usepackage{float} % provides the H option for float placement +\usepackage{graphicx} +% We will generate all images so they have a width \maxwidth. This means +% that they will get their normal width if they fit onto the page, but +% are scaled down if they would overflow the margins. +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth +\else\Gin@nat@width\fi} +\makeatother +\let\Oldincludegraphics\includegraphics +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth +\else\Gin@nat@width\fi} +\makeatother +\let\Oldincludegraphics\includegraphics +%\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}} +% Determine if the image is too wide for the page. +% +{% + \catcode`\@=11\relax% + \gdef\includegraphics{\@ifnextchar[{\Oldincludegraphics}{\Oldincludegraphics[width=\maxwidth]}}% +}% +% + +\ifxetex + \usepackage[setpagesize=false, % page size defined by xetex + unicode=false, % unicode breaks when used with xetex + bookmarksdepth=3, % + xetex]{hyperref} +\else + \usepackage[unicode=true]{hyperref} +\fi +\hypersetup{breaklinks=true, + bookmarks=true, + pdfauthor={Bernhard Weichel; and others}, + pdftitle={Wortsammler sample document}, + colorlinks=true, + urlcolor=blue, + linkcolor=magenta, + pdfborder={0 0 0}} +\urlstyle{same} % don't use monospace font for urls +\setlength{\parindent}{0pt} +\setlength{\parskip}{6pt plus 2pt minus 1pt} +\setlength{\emergencystretch}{3em} % prevent overfull lines +\setcounter{secnumdepth}{5} +\ifxetex + \usepackage{polyglossia} + \setmainlanguage{german} +\else + \usepackage[german]{babel} +\fi + +\title{Beamer} +\author{Bernhard Weichel \and and others} +\date{2013/05} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Wortsammler specific settings +% +%list environment by reinhard Jahraus +{\catcode`\@=11\relax% +\gdef\itemize{% + \ifnum \@itemdepth >\thr@@\@toodeep\else + \advance\@itemdepth\@ne + \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% + \expandafter + \list + \csname\@itemitem\endcsname + {\def\makelabel##1{\hss\llap{##1}}% + \addtolength{\leftmargin}{-10pt}% 29.37pt + \addtolength{\rightmargin}{0.0pt}% 0.0pt + \addtolength{\labelsep}{0pt}% 23.50pt + \addtolength{\itemsep}{-3.0pt}% 5.0pt + \addtolength{\parsep}{-1pt}% 5.0pt + \addtolength{\topsep}{-5pt}% 10.0pt + \addtolength{\partopsep}{0pt}% 3.0pt + }% + \fi} +}% + +% +% improve nesting of lists +% %http://stackoverflow.com/questions/1935952/maximum-nesting-level-of-lists-in-latex +% +\usepackage{enumitem} +\setlistdepth{9} +\setlist[itemize,1]{label=$\bullet$} +\setlist[itemize,2]{label=$\bullet$} +\setlist[itemize,3]{label=$\bullet$} +\setlist[itemize,4]{label=$\bullet$} +\setlist[itemize,5]{label=$\bullet$} +\setlist[itemize,6]{label=$\bullet$} +\setlist[itemize,7]{label=$\bullet$} +\setlist[itemize,8]{label=$\bullet$} +\setlist[itemize,9]{label=$\bullet$} +\renewlist{itemize}{itemize}{9} +% +% multicol +% +\usepackage{multicol} +\newcommand{\wsbegintwocol}{\begin{multicols}{2}} +\newcommand{\wsendtwocol}{\end{multicols}} + +% +% embed an image in the text +% +% usage: \wsembedimage{file}{r|l}{width}{height} +\usepackage{wrapfig} +\usepackage{needspace} +\newcommand{\wsembedimage}[4]{\needspace{#4}\begin{wrapfigure}{#2}{#3}\centering% +\vspace{-5mm}\includegraphics{#1}\vspace{-1cm}\end{wrapfigure}} +% +% adjust page layout +% +\setlength{\oddsidemargin}{-0.5cm} +\setlength{\evensidemargin}{-0.5cm} +\setlength{\textwidth}{17cm} +\setlength{\topmargin}{-2.0cm} +\setlength{\headheight}{1cm} +\setlength{\headsep}{1.5cm} +\setlength{\textheight}{25cm} +\setlength{\footskip}{1cm} + +% adjust the toc layout +\makeatletter +% \renewcommand*\l@section{\@dottedtocline{2}{1.8em}{4em}} + \renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{4em}} + \renewcommand*\l@subsubsection{\@dottedtocline{2}{5.5em}{4em}} +\makeatother + +\usepackage{pdfpages} +\usepackage{bookmark} +\usepackage{fancyhdr} +\pagestyle{fancy} +\chead{\begin{center}\textbf{Beamer} \end{center}} +\lhead{\includegraphics{../ZSUPP_Styles/logo.jpg}} +\rhead{\leftmark} +\lfoot{Bernhard Weichel} +\rfoot{\today~2013/05} +\renewcommand{\footrulewidth}{0.4pt} +% +\renewcommand{\familydefault}{\sfdefault} +% +% Marginpars shall always be right +\makeatletter + \def\marginparright{\@mparswitchfalse} + \def\marginparoutside{\@mparswitchtrue} +\makeatother +\marginparright +% +% +\raggedbottom +% + + +\usepackage{makeidx} +\makeindex + +% +%\renewcommand{Befehl der Gliederungsebene z.B. \chapter}{\@startsection{Name z.B. chapter}{Ebene z.B. 0}{Einrückung z.B. 0pt}{Abstand zum vorigen Text z.B. 3.5ex plus 1ex minus 0pt\relax}{Abstand zum nachfolgenden Text z.B. 2.5ex plus 0.5ex minus 0pt\relax}{Schrift z.B. \normalfont\Large\bfseries}} +% +% \makeatletter% +% \renewcommand{\chapter}{\@startsection{chapter}{0}{0pt}{3.5ex plus 1ex minus 0pt\relax}{2.5ex plus 0.5ex minus 0pt\relax}{\normalfont\Large\bfseries}}% +% \makeatother% +% +% +% Wortsammler extensions end here +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{document} +\maketitle + +\clearpage + +{ +\hypersetup{linkcolor=black} +\setcounter{tocdepth}{1} +\tableofcontents +\newpage +} + +\section{Introduction}\label{introduction} + +This is a sample document for Wortsammler + +\section{Anforderung an +Dokumentenaufbereiter}\label{anforderung-an-dokumentenaufbereiter} + +\begin{itemize} +\item + {[}RS\_Comp\_003{]} \textbf{\hypertarget{RS-Comp-003}{}Steuerung + Dokumentenzusammenstellung} \{Dokumentenzusammenstellungen soll über + ein manifest {[}\hyperlink{RS-Comp-007}{RS\_Comp\_007}{]} gesteuert + werden. + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + Die Manifeste sollen als Laufzeitparameter übergeben werden + \item + Das Manifest enthält auch die Ausgabedatei + \end{itemize} + + \}(\hyperlink{RS-DM-014}{RS\_DM\_014}, + \hyperlink{RS-DM-010}{RS\_DM\_010}, + \hyperlink{RS-DM-005}{RS\_DM\_005}) +\item + {[}RS\_Comp\_004{]} \textbf{\hypertarget{RS-Comp-004}{}Prozessierung + Einzeldokument} \{Soll Dokumente verschiedenen Umfangs erzeugen + können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + einzelnes Files + \item + zu Prüfzwecken + \end{itemize} + + Steuerung soll über Konfiguration (Manifest) erfolgen + {[}\hyperlink{RS-Comp-007}{RS\_Comp\_007}{]}. + + \}() +\item + {[}RS\_Comp\_005{]} \textbf{\hypertarget{RS-Comp-005}{}Erstellung + Loseblattsammlung} \{Soll Dokumente verschiedenen Umfangs erzeugen + können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + kann aus dem Manifest errechnet werden + {[}\hyperlink{RS-Comp-007}{RS\_Comp\_007}{]} + \end{itemize} + + \}() +\item + {[}RS\_Comp\_006{]} \textbf{\hypertarget{RS-Comp-006}{}Inkrementelle + Verarbeitung} \{Soll nur auf geänderte Dokumente reagieren können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + ähnlich wie make/rake + \end{itemize} + + \}() +\item + {[}RS\_Comp\_007{]} \textbf{\hypertarget{RS-Comp-007}{}Anforderungen + an Manifest} \{Folgende Anforderungen gelten für das Manifest + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + einfach bearbeiten - nur liste der Files + \item + Markdown-lite + \item + Yaml + \end{itemize} + + Inhalte im Manifest sind + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + Name der Konfiguration + \item + Ausgabeverzeichnis + \item + Ausgabeformat + \item + Name des generierten Dokumentes + \item + Formate in denen das Dokument generiert wird. Werte hierfür ergeben + sich aus den Anforderungen an die Aufbereitet + \item + zu verarbeitende Eingabedateien. Diese werden in der Reihenfolge + verarbeitet wie sie aufgeführt sind. + \item + Optionen für die jeweiligen Formate. + \item + zu bearbeitende Zielgruppen + {[}\hyperlink{RS-Comp-008}{RS\_Comp\_008}{]} + \end{itemize} + + Beispiel für ein manifest + +\begin{verbatim} + - + :name: komplett + :outdir: ../ZGEN_Documents + :outname: RS_Requirements-Ngopm + :format: + - pdf + - html + - rtf + - docx + - latex + + :lang: german + + :vars: + :lang: german + + :editions: + :intern: + :title: Interne Ausgabe + :filepart: _intern + :extern: + :title: Externe Ausgabe + :filepart: _extern + :mieter: + :title: Ausgabe für Mieter + :filepart: _mieter + :ea: + :title: Ausgabe für ehrenamtliche Mitarbeiter + :filepart: _ma-ehrenamtlich + :ha: + :title: Ausgabe für hauptamtliche Mitarbeiter + :filepart: _ma-hauptamtlich + :1: + :title: Ausgabe für erste hauptamtliche Mitarbeiter + :filepart: _ma-hauptamtlich-1 + + :input: + - ../RS_Process/RS_Process.md + - ../RS_Tooling/RS_Tooling.md + - ../RS_Tooling/RS_MarkdownCleaner.md + - ../RS_Tooling/RS_MarkdownEditor.md + - ../RS_Tooling/RS_DocumentComposer.md + - ../TPL_DirectoryStructure/TPL_DirectoryStructure.md + - ../TR_Installation/TR_Installation.md + - ../TR_Installation/TR_Proo-Handbuch.md + - ../ZGEN_RequirementsTracing/ZGEN_Reqtrace.md + + :snippets: + - ../TS_Markdown/TS_Snippets.yaml + - ../TS_Markdown/TS_MoreSnippets.yaml +\end{verbatim} + + \}(\hyperlink{RS-Comp-003}{RS\_Comp\_003}) +\end{itemize} + +\subsection{Zielgruppenspezifische +Ausgaben}\label{zielgruppenspezifische-ausgaben} + +Dieser Abschnitt behandelt speziell die Anforderungen an flexible +Dokumentenausgabe + +\begin{itemize} +\item + {[}RS\_Comp\_001{]} \textbf{\hypertarget{RS-Comp-001}{}Flexibler + Dokumentumfang} \{Soll Dokumente verschiedenen Umfangs erzeugen + können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + einzelnes Files + \item + Zusammengestelltes Dokument + \end{itemize} + + \}(\hyperlink{RS-Comp-003}{RS\_Comp\_003}) +\item + {[}RS\_Comp\_002{]} \textbf{\hypertarget{RS-Comp-002}{}Flexible + Dokumentendarstellung} \{Sollte Dokumente in verschiedener Darstellung + erzeugen können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + Seitenlayout + \item + Detaillierungsgrad (z.B. RequirementsMarken ausblenden) \} + (RS\_Comp\_003) + \end{itemize} +\item + {[}RS\_Comp\_008{]} + \textbf{\hypertarget{RS-Comp-008}{}Zielgruppenspezifische Ausgaben + (Editionen)} \{ Es soll möglich sein Zielgruppenspezifische Ausgaben + zu erstellen. + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + Dabei wird die Zielgruppe durch eine spezifische Zeichenkette + umgeschaltet (Durchstreichung), die auch in standard Markdown + Programmen eine sinnvolle Ausgabe liefert: + \end{itemize} +\end{itemize} + +\end{document} diff --git a/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_folien.pdf b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_folien.pdf new file mode 100644 index 0000000..e69de29 diff --git a/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_mieter.docx b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_mieter.docx new file mode 100644 index 0000000..e69de29 diff --git a/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_mieter.html b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_mieter.html new file mode 100644 index 0000000..f6d7581 --- /dev/null +++ b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_mieter.html @@ -0,0 +1,145 @@ + + + + + + + + + Wortsammler sample document + + + + + +

1 Introduction

+

This is a sample document for Wortsammler

+

2 Anforderung an Dokumentenaufbereiter

+
    +
  • [RS_Comp_003] Steuerung Dokumentenzusammenstellung {Dokumentenzusammenstellungen soll über ein manifest [RS_Comp_007] gesteuert werden.

    +
      +
    • Die Manifeste sollen als Laufzeitparameter übergeben werden
    • +
    • Das Manifest enthält auch die Ausgabedatei
    • +
    +

    }(RS_DM_014, RS_DM_010, RS_DM_005)

  • +
  • [RS_Comp_004] Prozessierung Einzeldokument {Soll Dokumente verschiedenen Umfangs erzeugen können:

    +
      +
    • einzelnes Files
    • +
    • zu Prüfzwecken
    • +
    +

    Steuerung soll über Konfiguration (Manifest) erfolgen [RS_Comp_007].

    +

    }()

  • +
  • [RS_Comp_005] Erstellung Loseblattsammlung {Soll Dokumente verschiedenen Umfangs erzeugen können:

    +
      +
    • kann aus dem Manifest errechnet werden [RS_Comp_007]
    • +
    +

    }()

  • +
  • [RS_Comp_006] Inkrementelle Verarbeitung {Soll nur auf geänderte Dokumente reagieren können:

    +
      +
    • ähnlich wie make/rake
    • +
    +

    }()

  • +
  • [RS_Comp_007] Anforderungen an Manifest {Folgende Anforderungen gelten für das Manifest +
      +
    • einfach bearbeiten - nur liste der Files
    • +
    • Markdown-lite
    • +
    • Yaml
    • +
    +

    Inhalte im Manifest sind

    +
      +
    • Name der Konfiguration
    • +
    • Ausgabeverzeichnis
    • +
    • Ausgabeformat
    • +
    • Name des generierten Dokumentes
    • +
    • Formate in denen das Dokument generiert wird. Werte hierfür ergeben sich aus den Anforderungen an die Aufbereitet
    • +
    • zu verarbeitende Eingabedateien. Diese werden in der Reihenfolge verarbeitet wie sie aufgeführt sind.
    • +
    • Optionen für die jeweiligen Formate.
    • +
    • zu bearbeitende Zielgruppen [RS_Comp_008]
    • +
    + +

    Beispiel für ein manifest

    +
     -
    +   :name:  komplett
    +   :outdir: ../ZGEN_Documents
    +   :outname: RS_Requirements-Ngopm
    +   :format:
    +     - pdf
    +     - html
    +     - rtf
    +     - docx
    +     - latex
    +
    +   :lang: german  
    +
    +   :vars:
    +       :lang: german
    +
    +   :editions:
    +     :intern: 
    +         :title: Interne Ausgabe
    +         :filepart: _intern 
    +     :extern: 
    +         :title: Externe Ausgabe
    +         :filepart: _extern
    +     :mieter: 
    +         :title: Ausgabe für Mieter
    +         :filepart: _mieter
    +     :ea: 
    +         :title: Ausgabe für ehrenamtliche Mitarbeiter
    +         :filepart: _ma-ehrenamtlich
    +     :ha: 
    +         :title: Ausgabe für hauptamtliche Mitarbeiter
    +         :filepart: _ma-hauptamtlich
    +     :1: 
    +         :title: Ausgabe für erste hauptamtliche Mitarbeiter
    +         :filepart: _ma-hauptamtlich-1
    +
    +   :input: 
    +     - ../RS_Process/RS_Process.md 
    +     - ../RS_Tooling/RS_Tooling.md 
    +     - ../RS_Tooling/RS_MarkdownCleaner.md 
    +     - ../RS_Tooling/RS_MarkdownEditor.md 
    +     - ../RS_Tooling/RS_DocumentComposer.md  
    +     - ../TPL_DirectoryStructure/TPL_DirectoryStructure.md
    +     - ../TR_Installation/TR_Installation.md
    +     - ../TR_Installation/TR_Proo-Handbuch.md
    +     - ../ZGEN_RequirementsTracing/ZGEN_Reqtrace.md
    +
    +   :snippets:
    +     - ../TS_Markdown/TS_Snippets.yaml
    +     - ../TS_Markdown/TS_MoreSnippets.yaml
    +

    }(RS_Comp_003)

  • +
+

2.1 Zielgruppenspezifische Ausgaben

+

Dieser Abschnitt behandelt speziell die Anforderungen an flexible Dokumentenausgabe

+
    +
  • [RS_Comp_001] Flexibler Dokumentumfang {Soll Dokumente verschiedenen Umfangs erzeugen können:

    +
      +
    • einzelnes Files
    • +
    • Zusammengestelltes Dokument
    • +
    +

    }(RS_Comp_003)

  • +
  • [RS_Comp_002] Flexible Dokumentendarstellung {Sollte Dokumente in verschiedener Darstellung erzeugen können: +
      +
    • Seitenlayout
    • +
    • Detaillierungsgrad (z.B. RequirementsMarken ausblenden) } (RS_Comp_003)
    • +
  • +
  • [RS_Comp_008] Zielgruppenspezifische Ausgaben (Editionen) { Es soll möglich sein Zielgruppenspezifische Ausgaben zu erstellen.

    +
      +
    • Dabei wird die Zielgruppe durch eine spezifische Zeichenkette umgeschaltet (Durchstreichung), die auch in standard Markdown Programmen eine sinnvolle Ausgabe liefert:
    • +
  • +
+ + diff --git a/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_mieter.latex b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_mieter.latex new file mode 100644 index 0000000..cd04b3d --- /dev/null +++ b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_mieter.latex @@ -0,0 +1,416 @@ +\documentclass[twoside,a4paper,12pt,german,]{article} +\usepackage[T1]{fontenc} +\usepackage{lmodern} +\usepackage{amssymb,amsmath} +\usepackage{ifxetex,ifluatex} +\usepackage{fixltx2e} % provides \textsubscript +% use microtype if available +\IfFileExists{microtype.sty}{\usepackage{microtype}}{} +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \usepackage[utf8]{inputenc} +\else % if luatex or xelatex + \usepackage{fontspec} + \ifxetex + \usepackage{xltxtra,xunicode} + \fi + \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} + \newcommand{\euro}{€} + \setmainfont{Calibri} + \setsansfont{Calibri} +\fi +\usepackage[a4paper]{geometry} +\usepackage{longtable} +\usepackage{float} % provides the H option for float placement +\usepackage{graphicx} +% We will generate all images so they have a width \maxwidth. This means +% that they will get their normal width if they fit onto the page, but +% are scaled down if they would overflow the margins. +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth +\else\Gin@nat@width\fi} +\makeatother +\let\Oldincludegraphics\includegraphics +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth +\else\Gin@nat@width\fi} +\makeatother +\let\Oldincludegraphics\includegraphics +%\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}} +% Determine if the image is too wide for the page. +% +{% + \catcode`\@=11\relax% + \gdef\includegraphics{\@ifnextchar[{\Oldincludegraphics}{\Oldincludegraphics[width=\maxwidth]}}% +}% +% + +\ifxetex + \usepackage[setpagesize=false, % page size defined by xetex + unicode=false, % unicode breaks when used with xetex + bookmarksdepth=3, % + xetex]{hyperref} +\else + \usepackage[unicode=true]{hyperref} +\fi +\hypersetup{breaklinks=true, + bookmarks=true, + pdfauthor={Bernhard Weichel; and others}, + pdftitle={Wortsammler sample document}, + colorlinks=true, + urlcolor=blue, + linkcolor=magenta, + pdfborder={0 0 0}} +\urlstyle{same} % don't use monospace font for urls +\setlength{\parindent}{0pt} +\setlength{\parskip}{6pt plus 2pt minus 1pt} +\setlength{\emergencystretch}{3em} % prevent overfull lines +\setcounter{secnumdepth}{5} +\ifxetex + \usepackage{polyglossia} + \setmainlanguage{german} +\else + \usepackage[german]{babel} +\fi + +\title{Main requirements (extended)} +\author{Bernhard Weichel \and and others} +\date{2013/05} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Wortsammler specific settings +% +%list environment by reinhard Jahraus +{\catcode`\@=11\relax% +\gdef\itemize{% + \ifnum \@itemdepth >\thr@@\@toodeep\else + \advance\@itemdepth\@ne + \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% + \expandafter + \list + \csname\@itemitem\endcsname + {\def\makelabel##1{\hss\llap{##1}}% + \addtolength{\leftmargin}{-10pt}% 29.37pt + \addtolength{\rightmargin}{0.0pt}% 0.0pt + \addtolength{\labelsep}{0pt}% 23.50pt + \addtolength{\itemsep}{-3.0pt}% 5.0pt + \addtolength{\parsep}{-1pt}% 5.0pt + \addtolength{\topsep}{-5pt}% 10.0pt + \addtolength{\partopsep}{0pt}% 3.0pt + }% + \fi} +}% + +% +% improve nesting of lists +% %http://stackoverflow.com/questions/1935952/maximum-nesting-level-of-lists-in-latex +% +\usepackage{enumitem} +\setlistdepth{9} +\setlist[itemize,1]{label=$\bullet$} +\setlist[itemize,2]{label=$\bullet$} +\setlist[itemize,3]{label=$\bullet$} +\setlist[itemize,4]{label=$\bullet$} +\setlist[itemize,5]{label=$\bullet$} +\setlist[itemize,6]{label=$\bullet$} +\setlist[itemize,7]{label=$\bullet$} +\setlist[itemize,8]{label=$\bullet$} +\setlist[itemize,9]{label=$\bullet$} +\renewlist{itemize}{itemize}{9} +% +% multicol +% +\usepackage{multicol} +\newcommand{\wsbegintwocol}{\begin{multicols}{2}} +\newcommand{\wsendtwocol}{\end{multicols}} + +% +% embed an image in the text +% +% usage: \wsembedimage{file}{r|l}{width}{height} +\usepackage{wrapfig} +\usepackage{needspace} +\newcommand{\wsembedimage}[4]{\needspace{#4}\begin{wrapfigure}{#2}{#3}\centering% +\vspace{-5mm}\includegraphics{#1}\vspace{-1cm}\end{wrapfigure}} +% +% adjust page layout +% +\setlength{\oddsidemargin}{-0.5cm} +\setlength{\evensidemargin}{-0.5cm} +\setlength{\textwidth}{17cm} +\setlength{\topmargin}{-2.0cm} +\setlength{\headheight}{1cm} +\setlength{\headsep}{1.5cm} +\setlength{\textheight}{25cm} +\setlength{\footskip}{1cm} + +% adjust the toc layout +\makeatletter +% \renewcommand*\l@section{\@dottedtocline{2}{1.8em}{4em}} + \renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{4em}} + \renewcommand*\l@subsubsection{\@dottedtocline{2}{5.5em}{4em}} +\makeatother + +\usepackage{pdfpages} +\usepackage{bookmark} +\usepackage{fancyhdr} +\pagestyle{fancy} +\chead{\begin{center}\textbf{Main requirements (extended)} \end{center}} +\lhead{\includegraphics{../ZSUPP_Styles/logo.jpg}} +\rhead{\leftmark} +\lfoot{Bernhard Weichel} +\rfoot{\today~2013/05} +\renewcommand{\footrulewidth}{0.4pt} +% +\renewcommand{\familydefault}{\sfdefault} +% +% Marginpars shall always be right +\makeatletter + \def\marginparright{\@mparswitchfalse} + \def\marginparoutside{\@mparswitchtrue} +\makeatother +\marginparright +% +% +\raggedbottom +% + + +\usepackage{makeidx} +\makeindex + +% +%\renewcommand{Befehl der Gliederungsebene z.B. \chapter}{\@startsection{Name z.B. chapter}{Ebene z.B. 0}{Einrückung z.B. 0pt}{Abstand zum vorigen Text z.B. 3.5ex plus 1ex minus 0pt\relax}{Abstand zum nachfolgenden Text z.B. 2.5ex plus 0.5ex minus 0pt\relax}{Schrift z.B. \normalfont\Large\bfseries}} +% +% \makeatletter% +% \renewcommand{\chapter}{\@startsection{chapter}{0}{0pt}{3.5ex plus 1ex minus 0pt\relax}{2.5ex plus 0.5ex minus 0pt\relax}{\normalfont\Large\bfseries}}% +% \makeatother% +% +% +% Wortsammler extensions end here +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{document} +\maketitle + +\clearpage + +{ +\hypersetup{linkcolor=black} +\setcounter{tocdepth}{1} +\tableofcontents +\newpage +} + +\section{Introduction}\label{introduction} + +This is a sample document for Wortsammler + +\section{Anforderung an +Dokumentenaufbereiter}\label{anforderung-an-dokumentenaufbereiter} + +\begin{itemize} +\item + {[}RS\_Comp\_003{]} \textbf{\hypertarget{RS-Comp-003}{}Steuerung + Dokumentenzusammenstellung} \{Dokumentenzusammenstellungen soll über + ein manifest {[}\hyperlink{RS-Comp-007}{RS\_Comp\_007}{]} gesteuert + werden. + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + Die Manifeste sollen als Laufzeitparameter übergeben werden + \item + Das Manifest enthält auch die Ausgabedatei + \end{itemize} + + \}(\hyperlink{RS-DM-014}{RS\_DM\_014}, + \hyperlink{RS-DM-010}{RS\_DM\_010}, + \hyperlink{RS-DM-005}{RS\_DM\_005}) +\item + {[}RS\_Comp\_004{]} \textbf{\hypertarget{RS-Comp-004}{}Prozessierung + Einzeldokument} \{Soll Dokumente verschiedenen Umfangs erzeugen + können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + einzelnes Files + \item + zu Prüfzwecken + \end{itemize} + + Steuerung soll über Konfiguration (Manifest) erfolgen + {[}\hyperlink{RS-Comp-007}{RS\_Comp\_007}{]}. + + \}() +\item + {[}RS\_Comp\_005{]} \textbf{\hypertarget{RS-Comp-005}{}Erstellung + Loseblattsammlung} \{Soll Dokumente verschiedenen Umfangs erzeugen + können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + kann aus dem Manifest errechnet werden + {[}\hyperlink{RS-Comp-007}{RS\_Comp\_007}{]} + \end{itemize} + + \}() +\item + {[}RS\_Comp\_006{]} \textbf{\hypertarget{RS-Comp-006}{}Inkrementelle + Verarbeitung} \{Soll nur auf geänderte Dokumente reagieren können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + ähnlich wie make/rake + \end{itemize} + + \}() +\item + {[}RS\_Comp\_007{]} \textbf{\hypertarget{RS-Comp-007}{}Anforderungen + an Manifest} \{Folgende Anforderungen gelten für das Manifest + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + einfach bearbeiten - nur liste der Files + \item + Markdown-lite + \item + Yaml + \end{itemize} + + Inhalte im Manifest sind + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + Name der Konfiguration + \item + Ausgabeverzeichnis + \item + Ausgabeformat + \item + Name des generierten Dokumentes + \item + Formate in denen das Dokument generiert wird. Werte hierfür ergeben + sich aus den Anforderungen an die Aufbereitet + \item + zu verarbeitende Eingabedateien. Diese werden in der Reihenfolge + verarbeitet wie sie aufgeführt sind. + \item + Optionen für die jeweiligen Formate. + \item + zu bearbeitende Zielgruppen + {[}\hyperlink{RS-Comp-008}{RS\_Comp\_008}{]} + \end{itemize} + + Beispiel für ein manifest + +\begin{verbatim} + - + :name: komplett + :outdir: ../ZGEN_Documents + :outname: RS_Requirements-Ngopm + :format: + - pdf + - html + - rtf + - docx + - latex + + :lang: german + + :vars: + :lang: german + + :editions: + :intern: + :title: Interne Ausgabe + :filepart: _intern + :extern: + :title: Externe Ausgabe + :filepart: _extern + :mieter: + :title: Ausgabe für Mieter + :filepart: _mieter + :ea: + :title: Ausgabe für ehrenamtliche Mitarbeiter + :filepart: _ma-ehrenamtlich + :ha: + :title: Ausgabe für hauptamtliche Mitarbeiter + :filepart: _ma-hauptamtlich + :1: + :title: Ausgabe für erste hauptamtliche Mitarbeiter + :filepart: _ma-hauptamtlich-1 + + :input: + - ../RS_Process/RS_Process.md + - ../RS_Tooling/RS_Tooling.md + - ../RS_Tooling/RS_MarkdownCleaner.md + - ../RS_Tooling/RS_MarkdownEditor.md + - ../RS_Tooling/RS_DocumentComposer.md + - ../TPL_DirectoryStructure/TPL_DirectoryStructure.md + - ../TR_Installation/TR_Installation.md + - ../TR_Installation/TR_Proo-Handbuch.md + - ../ZGEN_RequirementsTracing/ZGEN_Reqtrace.md + + :snippets: + - ../TS_Markdown/TS_Snippets.yaml + - ../TS_Markdown/TS_MoreSnippets.yaml +\end{verbatim} + + \}(\hyperlink{RS-Comp-003}{RS\_Comp\_003}) +\end{itemize} + +\subsection{Zielgruppenspezifische +Ausgaben}\label{zielgruppenspezifische-ausgaben} + +Dieser Abschnitt behandelt speziell die Anforderungen an flexible +Dokumentenausgabe + +\begin{itemize} +\item + {[}RS\_Comp\_001{]} \textbf{\hypertarget{RS-Comp-001}{}Flexibler + Dokumentumfang} \{Soll Dokumente verschiedenen Umfangs erzeugen + können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + einzelnes Files + \item + Zusammengestelltes Dokument + \end{itemize} + + \}(\hyperlink{RS-Comp-003}{RS\_Comp\_003}) +\item + {[}RS\_Comp\_002{]} \textbf{\hypertarget{RS-Comp-002}{}Flexible + Dokumentendarstellung} \{Sollte Dokumente in verschiedener Darstellung + erzeugen können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + Seitenlayout + \item + Detaillierungsgrad (z.B. RequirementsMarken ausblenden) \} + (RS\_Comp\_003) + \end{itemize} +\item + {[}RS\_Comp\_008{]} + \textbf{\hypertarget{RS-Comp-008}{}Zielgruppenspezifische Ausgaben + (Editionen)} \{ Es soll möglich sein Zielgruppenspezifische Ausgaben + zu erstellen. + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + Dabei wird die Zielgruppe durch eine spezifische Zeichenkette + umgeschaltet (Durchstreichung), die auch in standard Markdown + Programmen eine sinnvolle Ausgabe liefert: + \end{itemize} +\end{itemize} + +\end{document} diff --git a/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_mieter.pdf b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_mieter.pdf new file mode 100644 index 0000000..e69de29 diff --git a/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_review.latex b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_review.latex new file mode 100644 index 0000000..bf55488 --- /dev/null +++ b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_review.latex @@ -0,0 +1,582 @@ +\documentclass[twoside,a4paper,12pt,german,]{article} +\usepackage[T1]{fontenc} +\usepackage{lmodern} +\usepackage{amssymb,amsmath} +\usepackage{ifxetex,ifluatex} +\usepackage{fixltx2e} % provides \textsubscript +% use microtype if available +\IfFileExists{microtype.sty}{\usepackage{microtype}}{} +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \usepackage[utf8]{inputenc} +\else % if luatex or xelatex + \usepackage{fontspec} + \ifxetex + \usepackage{xltxtra,xunicode} + \fi + \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} + \newcommand{\euro}{€} + \setmainfont{Calibri} + \setsansfont{Calibri} +\fi +\usepackage[a4paper]{geometry} +\usepackage{longtable} +\usepackage{float} % provides the H option for float placement +\usepackage{graphicx} +% We will generate all images so they have a width \maxwidth. This means +% that they will get their normal width if they fit onto the page, but +% are scaled down if they would overflow the margins. +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth +\else\Gin@nat@width\fi} +\makeatother +\let\Oldincludegraphics\includegraphics +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth +\else\Gin@nat@width\fi} +\makeatother +\let\Oldincludegraphics\includegraphics +%\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}} +% Determine if the image is too wide for the page. +% +{% + \catcode`\@=11\relax% + \gdef\includegraphics{\@ifnextchar[{\Oldincludegraphics}{\Oldincludegraphics[width=\maxwidth]}}% +}% +% + +\ifxetex + \usepackage[setpagesize=false, % page size defined by xetex + unicode=false, % unicode breaks when used with xetex + bookmarksdepth=3, % + xetex]{hyperref} +\else + \usepackage[unicode=true]{hyperref} +\fi +\hypersetup{breaklinks=true, + bookmarks=true, + pdfauthor={Bernhard Weichel; and others}, + pdftitle={Wortsammler sample document}, + colorlinks=true, + urlcolor=blue, + linkcolor=magenta, + pdfborder={0 0 0}} +\urlstyle{same} % don't use monospace font for urls +\setlength{\parindent}{0pt} +\setlength{\parskip}{6pt plus 2pt minus 1pt} +\setlength{\emergencystretch}{3em} % prevent overfull lines +\setcounter{secnumdepth}{5} +\ifxetex + \usepackage{polyglossia} + \setmainlanguage{german} +\else + \usepackage[german]{babel} +\fi + +\title{Main requirements (review)} +\author{Bernhard Weichel \and and others} +\date{2013/05} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Wortsammler specific settings +% +%list environment by reinhard Jahraus +{\catcode`\@=11\relax% +\gdef\itemize{% + \ifnum \@itemdepth >\thr@@\@toodeep\else + \advance\@itemdepth\@ne + \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% + \expandafter + \list + \csname\@itemitem\endcsname + {\def\makelabel##1{\hss\llap{##1}}% + \addtolength{\leftmargin}{-10pt}% 29.37pt + \addtolength{\rightmargin}{0.0pt}% 0.0pt + \addtolength{\labelsep}{0pt}% 23.50pt + \addtolength{\itemsep}{-3.0pt}% 5.0pt + \addtolength{\parsep}{-1pt}% 5.0pt + \addtolength{\topsep}{-5pt}% 10.0pt + \addtolength{\partopsep}{0pt}% 3.0pt + }% + \fi} +}% + +% +% improve nesting of lists +% %http://stackoverflow.com/questions/1935952/maximum-nesting-level-of-lists-in-latex +% +\usepackage{enumitem} +\setlistdepth{9} +\setlist[itemize,1]{label=$\bullet$} +\setlist[itemize,2]{label=$\bullet$} +\setlist[itemize,3]{label=$\bullet$} +\setlist[itemize,4]{label=$\bullet$} +\setlist[itemize,5]{label=$\bullet$} +\setlist[itemize,6]{label=$\bullet$} +\setlist[itemize,7]{label=$\bullet$} +\setlist[itemize,8]{label=$\bullet$} +\setlist[itemize,9]{label=$\bullet$} +\renewlist{itemize}{itemize}{9} +% +% multicol +% +\usepackage{multicol} +\newcommand{\wsbegintwocol}{} +\newcommand{\wsendtwocol}{} + +% +% embed an image in the text +% +% usage: \wsembedimage{file}{r|l}{width}{height} +\usepackage{wrapfig} +\usepackage{needspace} +\newcommand{\wsembedimage}[4]{\needspace{#4}\begin{wrapfigure}{#2}{#3}\centering% +\vspace{-5mm}\includegraphics{#1}\vspace{-1cm}\end{wrapfigure}} +% +% adjust page layout +% +\setlength{\oddsidemargin}{-0.5cm} +\setlength{\evensidemargin}{-0.5cm} +\setlength{\textwidth}{17cm} +\setlength{\topmargin}{-2.0cm} +\setlength{\headheight}{1cm} +\setlength{\headsep}{1.5cm} +\setlength{\textheight}{25cm} +\setlength{\footskip}{1cm} + +% adjust the toc layout +\makeatletter +% \renewcommand*\l@section{\@dottedtocline{2}{1.8em}{4em}} + \renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{4em}} + \renewcommand*\l@subsubsection{\@dottedtocline{2}{5.5em}{4em}} +\makeatother + +\usepackage{pdfpages} +\usepackage{bookmark} +\usepackage{fancyhdr} +\pagestyle{fancy} +\chead{\begin{center}\textbf{Main requirements (review)} \end{center}} +\lhead{\includegraphics{../ZSUPP_Styles/logo.jpg}} +\rhead{\leftmark} +\lfoot{Bernhard Weichel} +\rfoot{\today~2013/05} +\renewcommand{\footrulewidth}{0.4pt} +% +\renewcommand{\familydefault}{\sfdefault} +% +% Marginpars shall always be right +\makeatletter + \def\marginparright{\@mparswitchfalse} + \def\marginparoutside{\@mparswitchtrue} +\makeatother +\marginparright +% +% +\raggedbottom +% + +\usepackage[pagewise]{lineno} +\setlength\linenumbersep{1mm} +\modulolinenumbers[5] + +\usepackage{makeidx} +\makeindex + +% +%\renewcommand{Befehl der Gliederungsebene z.B. \chapter}{\@startsection{Name z.B. chapter}{Ebene z.B. 0}{Einrückung z.B. 0pt}{Abstand zum vorigen Text z.B. 3.5ex plus 1ex minus 0pt\relax}{Abstand zum nachfolgenden Text z.B. 2.5ex plus 0.5ex minus 0pt\relax}{Schrift z.B. \normalfont\Large\bfseries}} +% +% \makeatletter% +% \renewcommand{\chapter}{\@startsection{chapter}{0}{0pt}{3.5ex plus 1ex minus 0pt\relax}{2.5ex plus 0.5ex minus 0pt\relax}{\normalfont\Large\bfseries}}% +% \makeatother% +% +% +% Wortsammler extensions end here +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{document} +\maketitle + +\clearpage + +{ +\hypersetup{linkcolor=black} +\setcounter{tocdepth}{1} +\tableofcontents +\newpage +} +\linenumbers + +\section{Introduction}\label{introduction} + +This is a sample document for Wortsammler + +\section{Anforderung an +Dokumentenaufbereiter}\label{anforderung-an-dokumentenaufbereiter} + +\begin{itemize} +\item + {[}RS\_Comp\_003{]} \textbf{\hypertarget{RS-Comp-003}{}Steuerung + Dokumentenzusammenstellung} \{Dokumentenzusammenstellungen soll über + ein manifest {[}\hyperlink{RS-Comp-007}{RS\_Comp\_007}{]} gesteuert + werden. + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + Die Manifeste sollen als Laufzeitparameter übergeben werden + \item + Das Manifest enthält auch die Ausgabedatei + \end{itemize} + + \}(\hyperlink{RS-DM-014}{RS\_DM\_014}, + \hyperlink{RS-DM-010}{RS\_DM\_010}, + \hyperlink{RS-DM-005}{RS\_DM\_005}) +\item + {[}RS\_Comp\_004{]} \textbf{\hypertarget{RS-Comp-004}{}Prozessierung + Einzeldokument} \{Soll Dokumente verschiedenen Umfangs erzeugen + können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + einzelnes Files + \item + zu Prüfzwecken + \end{itemize} + + Steuerung soll über Konfiguration (Manifest) erfolgen + {[}\hyperlink{RS-Comp-007}{RS\_Comp\_007}{]}. + + \}() +\item + {[}RS\_Comp\_005{]} \textbf{\hypertarget{RS-Comp-005}{}Erstellung + Loseblattsammlung} \{Soll Dokumente verschiedenen Umfangs erzeugen + können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + kann aus dem Manifest errechnet werden + {[}\hyperlink{RS-Comp-007}{RS\_Comp\_007}{]} + \end{itemize} + + \}() +\item + {[}RS\_Comp\_006{]} \textbf{\hypertarget{RS-Comp-006}{}Inkrementelle + Verarbeitung} \{Soll nur auf geänderte Dokumente reagieren können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + ähnlich wie make/rake + \end{itemize} + + \}() +\item + {[}RS\_Comp\_007{]} \textbf{\hypertarget{RS-Comp-007}{}Anforderungen + an Manifest} \{Folgende Anforderungen gelten für das Manifest + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + einfach bearbeiten - nur liste der Files + \item + Markdown-lite + \item + Yaml + \end{itemize} + + Inhalte im Manifest sind + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + Name der Konfiguration + \item + Ausgabeverzeichnis + \item + Ausgabeformat + \item + Name des generierten Dokumentes + \item + Formate in denen das Dokument generiert wird. Werte hierfür ergeben + sich aus den Anforderungen an die Aufbereitet + \item + zu verarbeitende Eingabedateien. Diese werden in der Reihenfolge + verarbeitet wie sie aufgeführt sind. + \item + Optionen für die jeweiligen Formate. + \item + zu bearbeitende Zielgruppen + {[}\hyperlink{RS-Comp-008}{RS\_Comp\_008}{]} + \end{itemize} + + Beispiel für ein manifest + +\begin{verbatim} + - + :name: komplett + :outdir: ../ZGEN_Documents + :outname: RS_Requirements-Ngopm + :format: + - pdf + - html + - rtf + - docx + - latex + + :lang: german + + :vars: + :lang: german + + :editions: + :intern: + :title: Interne Ausgabe + :filepart: _intern + :extern: + :title: Externe Ausgabe + :filepart: _extern + :mieter: + :title: Ausgabe für Mieter + :filepart: _mieter + :ea: + :title: Ausgabe für ehrenamtliche Mitarbeiter + :filepart: _ma-ehrenamtlich + :ha: + :title: Ausgabe für hauptamtliche Mitarbeiter + :filepart: _ma-hauptamtlich + :1: + :title: Ausgabe für erste hauptamtliche Mitarbeiter + :filepart: _ma-hauptamtlich-1 + + :input: + - ../RS_Process/RS_Process.md + - ../RS_Tooling/RS_Tooling.md + - ../RS_Tooling/RS_MarkdownCleaner.md + - ../RS_Tooling/RS_MarkdownEditor.md + - ../RS_Tooling/RS_DocumentComposer.md + - ../TPL_DirectoryStructure/TPL_DirectoryStructure.md + - ../TR_Installation/TR_Installation.md + - ../TR_Installation/TR_Proo-Handbuch.md + - ../ZGEN_RequirementsTracing/ZGEN_Reqtrace.md + + :snippets: + - ../TS_Markdown/TS_Snippets.yaml + - ../TS_Markdown/TS_MoreSnippets.yaml +\end{verbatim} + + \}(\hyperlink{RS-Comp-003}{RS\_Comp\_003}) +\end{itemize} + +\subsection{Zielgruppenspezifische +Ausgaben}\label{zielgruppenspezifische-ausgaben} + +Dieser Abschnitt behandelt speziell die Anforderungen an flexible +Dokumentenausgabe + +\begin{itemize} +\item + {[}RS\_Comp\_001{]} \textbf{\hypertarget{RS-Comp-001}{}Flexibler + Dokumentumfang} \{Soll Dokumente verschiedenen Umfangs erzeugen + können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + einzelnes Files + \item + Zusammengestelltes Dokument + \end{itemize} + + \}(\hyperlink{RS-Comp-003}{RS\_Comp\_003}) +\item + {[}RS\_Comp\_002{]} \textbf{\hypertarget{RS-Comp-002}{}Flexible + Dokumentendarstellung} \{Sollte Dokumente in verschiedener Darstellung + erzeugen können: + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + Seitenlayout + \item + Detaillierungsgrad (z.B. RequirementsMarken ausblenden) \} + (RS\_Comp\_003) + \end{itemize} +\item + {[}RS\_Comp\_008{]} + \textbf{\hypertarget{RS-Comp-008}{}Zielgruppenspezifische Ausgaben + (Editionen)} \{ Es soll möglich sein Zielgruppenspezifische Ausgaben + zu erstellen. + + \begin{itemize} + \item + Dabei wird die Zielgruppe durch eine spezifische Zeichenkette + umgeschaltet (Durchstreichung), die auch in standard Markdown + Programmen eine sinnvolle Ausgabe liefert: + + \texttt{\textbackslash{}color\{red\}\textbackslash{}rule\{2cm\}\{0.5mm\}\textbackslash{}newline\textbackslash{}marginpar\{intern\ extern\}} + ab hier gilt: Text erscheint in Ausgabe \texttt{intern} als auch in + \texttt{extern} + + Es handelt sich also um ein durchgestrichenes Muster als regulärer + Ausdruck + +\begin{verbatim} +~~ED((\s* \S+)*)~~ +\end{verbatim} + \item + Die Umschaltung wirkt ab einschliesslich der Zeile, die die + Umschaltung enthält, bis zum Aufruf einer neuen Umschaltung. + \item + Die möglichen Zielgruppen werden im Manifest festgelegt + {[}\hyperlink{RS-Comp-007}{RS\_Comp\_007}{]} daselbst Eintrag + \texttt{:editions:} + \item + Eine vorgegebene Zielgruppe \texttt{all} erzeugt keine spezifische + Ausgabe. Sie kennzeichnet vielmehr Inhalte, die in \textbf{allen} + Ausgaben gleichermassen enthalten sind. + \item + Bei einer Aufteilung auf mehrere Dateien wird empfohlen am Ende + einer jeden Datei auf \texttt{all} zu schalten. Dadurch wird das + System einfache wartbar. + \end{itemize} + + \}(\hyperlink{RS-Comp-003}{RS\_Comp\_003}) + + Alternativen für die Umschaltung sind: + + \marginpar{intern} + + \begin{itemize} + \item + \color{red}\rule{2cm}{0.5mm}\newline\marginpar{intern extern} und so + geht es weiter + \item + \textsuperscript{ZG~intern~extern} und nun kommt der text der nur + extern ist + \end{itemize} + + \marginpar{extern} + + \begin{itemize} + \item + \textsubscript{ZG~intern~extern} und hier ist der text der nur + intern ist + \item + und nun geht es weiter + \end{itemize} + + \marginpar{intern} + + \begin{itemize} + \itemsep1pt\parskip0pt\parsep0pt + \item + und nun geht es intern weiter Gelaber und weiter + \end{itemize} +\item + {[}RS\_Comp\_009{]} \textbf{\hypertarget{RS-Comp-009}{}Gesamtausgabe + mit allen Texten zur Prüfung} \{Sollte Dokumente Eine Gesamtausgabe + mit allen Texten zur Überprüfung soll erstellt werden. In diesem Fall + werden die Ausgaben am Rand notiert. + \}(\hyperlink{RS-Comp-003}{RS\_Comp\_003}) +\item + {[}RS\_Comp\_010{]} \textbf{\hypertarget{RS-Comp-010}{}Erstellung + aller Ausgaben mit einem Befehl} \{Es sollen immer alle Ausgaben + gleichermassen generiert werden. Dabei gilt: + + \begin{itemize} + \item + Der Dateiname für die generierten Dokumente bildet sich nach + + \texttt{\{:outname:\}\_\{:edition:.:filepart:\}.\{format\}} + \item + In der Kopfzeile des Dokumentes wird \texttt{:edition:.:title:} + eingefügt, so dass die Ausgabe auf jeder Seite identifiziert werden + kann. + \end{itemize} + + Ohne Angabe einer Zielgruppe bzw. mit der Angabe \texttt{all} soll + wortsammler alle Ausgaben erstellen. + + Die Angabe einer einzelnen Zielgruppe erstellt dann auch nur die + gewählte Ausgabe. + + \}(\hyperlink{RS-Comp-003}{RS\_Comp\_003}) +\end{itemize} + +\subsection{Processing TODO - open +issues}\label{processing-todo---open-issues} + +Paragraphs like starting with + +\begin{verbatim} +TODO:\marginpar{TODO} #13 do something are used to manage the open issues +\end{verbatim} + +\subsection{Processing the traceables}\label{processing-the-traceables} + +\subsection{Including Files}\label{including-files} + +\begin{itemize} +\item + {[}RS\_Comp\_011{]} \textbf{\hypertarget{RS-Comp-011}{}including Plain + pdf-Pages}\{ PDF pages can be included by + + \texttt{\textasciitilde{}\textasciitilde{}PDF\ "lib/01234\_particularPdf.pdf"\ "Das\ ist\ der\ Eintrag\ im\ Inhaltsverzeichnis"\ 1\ 2-4\textasciitilde{}\textasciitilde{}} + + It is done in a markdown verbatim section. By this, Pandoc does not + add linebreaks in the command such that it can be processed with + regular expressions. + + \}(\hyperlink{RS-Comp-003}{RS\_Comp\_003}) +\item + {[}RS\_Comp\_014{]} \textbf{\hypertarget{RS-Comp-014}{}Including + markdown files} \{ + + `` + + will be replaced by the content of the argument. It should even work + inline. + + \}(\hyperlink{RS-Comp-003}{RS\_Comp\_003}) +\end{itemize} + +\subsection{Handling Text Snippets}\label{handling-text-snippets} + +\begin{itemize} +\item + {[}RS\_Comp\_012{]} \textbf{\hypertarget{RS-Comp-012}{}Including text + Snippets}\{ Text Snippts can be included by + +\begin{verbatim} +`~~SN {symbol}~~` +\end{verbatim} + + The snippets are taken from one of the snippet databases declared in + the manifest {[}\hyperlink{RS-Comp-007}{RS\_Comp\_007}{]} according to + the format in {[}\hyperlink{RS-Comp-013}{RS\_Comp\_013}{]}. \}() +\item + {[}RS\_Conp\_013{]} \textbf{\hypertarget{RS-Conp-013}{}Defining text + Snippets} \{ + + Text snippets are defined as a yaml file in the following format: + +\begin{verbatim} +:Snippet1: Das ist Snippet 1 + +:Snippet2: |- Das ist snippet 2. Es enthält sogar eine Liste + + * Das ist item 1 in Snippet 2 + + * Das ist item 2 in Snippet 2 +\end{verbatim} + + \}(\hyperlink{RS-Comp-003}{RS\_Comp\_003}) +\end{itemize} + +\subsubsection{this should not show up in +toc}\label{this-should-not-show-up-in-toc} + +This chapter should not show up in the toc + +\end{document} diff --git a/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_review.pdf b/testproject.xx/30_Sources/ZGEN_Documents/RS_Main_review.pdf new file mode 100644 index 0000000..e69de29 diff --git a/testproject.xx/30_Sources/ZGEN_RequirementsTracing/RS_Main.traces.md b/testproject.xx/30_Sources/ZGEN_RequirementsTracing/RS_Main.traces.md new file mode 100644 index 0000000..62d7b8d --- /dev/null +++ b/testproject.xx/30_Sources/ZGEN_RequirementsTracing/RS_Main.traces.md @@ -0,0 +1,56 @@ + +\clearpage + +# Upstream Requirements + + + +[RS_Comp_001] **Flexibler Dokumentumfang** { }() + + + +[RS_Comp_003] **Steuerung Dokumentenzusammenstellung** { }() + + + +[RS_Comp_004] **Prozessierung Einzeldokument** { }() + + + +[RS_Comp_005] **Erstellung Loseblattsammlung** { }() + + + +[RS_Comp_006] **Inkrementelle Verarbeitung** { }() + + + +[RS_Comp_007] **Anforderungen an Manifest** { }() + + + +[RS_Comp_008] **Zielgruppenspezifische Ausgaben (Editionen)** { }() + + + +[RS_Comp_009] **Gesamtausgabe mit allen Texten zur Prüfung** { }() + + + +[RS_Comp_010] **Erstellung aller Ausgaben mit einem Befehl** { }() + + + +[RS_Comp_011] **including Plain pdf-Pages** { }() + + + +[RS_Comp_012] **Including text Snippets** { }() + + + +[RS_Comp_014] **Including markdown files** { }() + + + +[RS_Conp_013] **Defining text Snippets** { }() diff --git a/testproject.xx/30_Sources/ZGEN_RequirementsTracing/ZGEN_Reqtrace.graphml b/testproject.xx/30_Sources/ZGEN_RequirementsTracing/ZGEN_Reqtrace.graphml new file mode 100644 index 0000000..786b281 --- /dev/null +++ b/testproject.xx/30_Sources/ZGEN_RequirementsTracing/ZGEN_Reqtrace.graphml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + [RS_Comp_001] Flexibler Dokumentumfang + + + + + + + + [RS_Comp_003] Steuerung Dokumentenzusammenstellung + + + + + + + + + + [RS_Comp_004] Prozessierung Einzeldokument + + + + + + + [RS_Comp_005] Erstellung Loseblattsammlung + + + + + + + [RS_Comp_006] Inkrementelle Verarbeitung + + + + + + + [RS_Comp_007] Anforderungen an Manifest + + + + + + + + [RS_Comp_008] Zielgruppenspezifische Ausgaben (Editionen) + + + + + + + + [RS_Comp_009] Gesamtausgabe mit allen Texten zur Prüfung + + + + + + + + [RS_Comp_010] Erstellung aller Ausgaben mit einem Befehl + + + + + + + + [RS_Comp_011] including Plain pdf-Pages + + + + + + + + [RS_Comp_012] Including text Snippets + + + + + + + [RS_Comp_014] Including markdown files + + + + + + + + [RS_Conp_013] Defining text Snippets + + + + + + diff --git a/testproject.xx/30_Sources/ZGEN_RequirementsTracing/ZGEN_Reqtrace.md b/testproject.xx/30_Sources/ZGEN_RequirementsTracing/ZGEN_Reqtrace.md new file mode 100644 index 0000000..882a8ef --- /dev/null +++ b/testproject.xx/30_Sources/ZGEN_RequirementsTracing/ZGEN_Reqtrace.md @@ -0,0 +1,50 @@ + +\clearpage + +# Requirements Tracing + +- ->[RS_Comp_001] **Flexibler Dokumentumfang** ([RS_Comp_003]) + + +- ->[RS_Comp_003] **Steuerung Dokumentenzusammenstellung** ([RS_DM_014], [RS_DM_010], [RS_DM_005]) + + - [RS_Comp_001] Flexibler Dokumentumfang + - [RS_Comp_007] Anforderungen an Manifest + - [RS_Comp_008] Zielgruppenspezifische Ausgaben (Editionen) + - [RS_Comp_009] Gesamtausgabe mit allen Texten zur Prüfung + - [RS_Comp_010] Erstellung aller Ausgaben mit einem Befehl + - [RS_Comp_011] including Plain pdf-Pages + - [RS_Comp_014] Including markdown files + - [RS_Conp_013] Defining text Snippets + +- ->[RS_Comp_004] **Prozessierung Einzeldokument** () + + +- ->[RS_Comp_005] **Erstellung Loseblattsammlung** () + + +- ->[RS_Comp_006] **Inkrementelle Verarbeitung** () + + +- ->[RS_Comp_007] **Anforderungen an Manifest** ([RS_Comp_003]) + + +- ->[RS_Comp_008] **Zielgruppenspezifische Ausgaben (Editionen)** ([RS_Comp_003]) + + +- ->[RS_Comp_009] **Gesamtausgabe mit allen Texten zur Prüfung** ([RS_Comp_003]) + + +- ->[RS_Comp_010] **Erstellung aller Ausgaben mit einem Befehl** ([RS_Comp_003]) + + +- ->[RS_Comp_011] **including Plain pdf-Pages** ([RS_Comp_003]) + + +- ->[RS_Comp_012] **Including text Snippets** () + + +- ->[RS_Comp_014] **Including markdown files** ([RS_Comp_003]) + + +- ->[RS_Conp_013] **Defining text Snippets** ([RS_Comp_003]) diff --git a/testproject.xx/30_Sources/ZGEN_RequirementsTracing/ZGEN_ReqtraceCompare.txt b/testproject.xx/30_Sources/ZGEN_RequirementsTracing/ZGEN_ReqtraceCompare.txt new file mode 100644 index 0000000..6d8d162 --- /dev/null +++ b/testproject.xx/30_Sources/ZGEN_RequirementsTracing/ZGEN_ReqtraceCompare.txt @@ -0,0 +1,52 @@ + + +[RS_Comp_001] +[RS_Comp_001] **Flexibler Dokumentumfang** {Soll Dokumente verschiedenen Umfangs erzeugen können: - einzelnes Files - Zusammengestelltes Dokument }(RS_Comp_003) + + +[RS_Comp_003] +[RS_Comp_003] **Steuerung Dokumentenzusammenstellung** {Dokumentenzusammenstellungen soll über ein manifest ->[RS_Comp_007] gesteuert werden. - Die Manifeste sollen als Laufzeitparameter übergeben werden - Das Manifest enthält auch die Ausgabedatei }(RS_DM_014, RS_DM_010, RS_DM_005) + + +[RS_Comp_004] +[RS_Comp_004] **Prozessierung Einzeldokument** {Soll Dokumente verschiedenen Umfangs erzeugen können: - einzelnes Files - zu Prüfzwecken Steuerung soll über Konfiguration (Manifest) erfolgen ->[RS_Comp_007]. }() + + +[RS_Comp_005] +[RS_Comp_005] **Erstellung Loseblattsammlung** {Soll Dokumente verschiedenen Umfangs erzeugen können: - kann aus dem Manifest errechnet werden ->[RS_Comp_007] }() + + +[RS_Comp_006] +[RS_Comp_006] **Inkrementelle Verarbeitung** {Soll nur auf geänderte Dokumente reagieren können: - ähnlich wie make/rake }() + + +[RS_Comp_007] +[RS_Comp_007] **Anforderungen an Manifest** {Folgende Anforderungen gelten für das Manifest - einfach bearbeiten - nur liste der Files - Markdown-lite - Yaml Inhalte im Manifest sind - Name der Konfiguration - Ausgabeverzeichnis - Ausgabeformat - Name des generierten Dokumentes - Formate in denen das Dokument generiert wird. Werte hierfür ergeben sich aus den Anforderungen an die Aufbereitet - zu verarbeitende Eingabedateien. Diese werden in der Reihenfolge verarbeitet wie sie aufgeführt sind. - Optionen für die jeweiligen Formate. - zu bearbeitende Zielgruppen ->[RS_Comp_008] Beispiel für ein manifest - :name: komplett :outdir: ../ZGEN_Documents :outname: RS_Requirements-Ngopm :format: - pdf - html - rtf - docx - latex :lang: german :vars: :lang: german :editions: :intern: :title: Interne Ausgabe :filepart: _intern :extern: :title: Externe Ausgabe :filepart: _extern :mieter: :title: Ausgabe für Mieter :filepart: _mieter :ea: :title: Ausgabe für ehrenamtliche Mitarbeiter :filepart: _ma-ehrenamtlich :ha: :title: Ausgabe für hauptamtliche Mitarbeiter :filepart: _ma-hauptamtlich :1: :title: Ausgabe für erste hauptamtliche Mitarbeiter :filepart: _ma-hauptamtlich-1 :input: - ../RS_Process/RS_Process.md - ../RS_Tooling/RS_Tooling.md - ../RS_Tooling/RS_MarkdownCleaner.md - ../RS_Tooling/RS_MarkdownEditor.md - ../RS_Tooling/RS_DocumentComposer.md - ../TPL_DirectoryStructure/TPL_DirectoryStructure.md - ../TR_Installation/TR_Installation.md - ../TR_Installation/TR_Proo-Handbuch.md - ../ZGEN_RequirementsTracing/ZGEN_Reqtrace.md :snippets: - ../TS_Markdown/TS_Snippets.yaml - ../TS_Markdown/TS_MoreSnippets.yaml }(RS_Comp_003) + + +[RS_Comp_008] +[RS_Comp_008] **Zielgruppenspezifische Ausgaben (Editionen)** { Es soll möglich sein Zielgruppenspezifische Ausgaben zu erstellen. - Dabei wird die Zielgruppe durch eine spezifische Zeichenkette umgeschaltet (Durchstreichung), die auch in standard Markdown Programmen eine sinnvolle Ausgabe liefert: `~~ED intern extern~~` ab hier gilt: Text erscheint in Ausgabe `intern` als auch in `extern` Es handelt sich also um ein durchgestrichenes Muster als regulärer Ausdruck ~~ED((\s* \S+)*)~~ - Die Umschaltung wirkt ab einschliesslich der Zeile, die die Umschaltung enthält, bis zum Aufruf einer neuen Umschaltung. - Die möglichen Zielgruppen werden im Manifest festgelegt ->[RS_Comp_007] daselbst Eintrag `:editions:` - Eine vorgegebene Zielgruppe `all` erzeugt keine spezifische Ausgabe. Sie kennzeichnet vielmehr Inhalte, die in **allen** Ausgaben gleichermassen enthalten sind. - Bei einer Aufteilung auf mehrere Dateien wird empfohlen am Ende einer jeden Datei auf `all` zu schalten. Dadurch wird das System einfache wartbar. }(RS_Comp_003) + + +[RS_Comp_009] +[RS_Comp_009] **Gesamtausgabe mit allen Texten zur Prüfung** {Sollte Dokumente Eine Gesamtausgabe mit allen Texten zur Überprüfung soll erstellt werden. In diesem Fall werden die Ausgaben am Rand notiert. }(RS_Comp_003) + + +[RS_Comp_010] +[RS_Comp_010] **Erstellung aller Ausgaben mit einem Befehl** {Es sollen immer alle Ausgaben gleichermassen generiert werden. Dabei gilt: - Der Dateiname für die generierten Dokumente bildet sich nach `{:outname:}_{:edition:.:filepart:}.{format}` - In der Kopfzeile des Dokumentes wird `:edition:.:title:` eingefügt, so dass die Ausgabe auf jeder Seite identifiziert werden kann. Ohne Angabe einer Zielgruppe bzw. mit der Angabe `all` soll wortsammler alle Ausgaben erstellen. Die Angabe einer einzelnen Zielgruppe erstellt dann auch nur die gewählte Ausgabe. }(RS_Comp_003) + + +[RS_Comp_011] +[RS_Comp_011] **including Plain pdf-Pages**{ PDF pages can be included by `~~PDF "lib/01234_particularPdf.pdf" "Das ist der Eintrag im Inhaltsverzeichnis" 1 2-4~~` It is done in a markdown verbatim section. By this, Pandoc does not add linebreaks in the command such that it can be processed with regular expressions. }(RS_Comp_003) + + +[RS_Comp_012] +[RS_Comp_012] **Including text Snippets**{ Text Snippts can be included by `~~SN {symbol}~~` The snippets are taken from one of the snippet databases declared in the manifest ->[RS_Comp_007] according to the format in ->[RS_Comp_013]. }() + + +[RS_Comp_014] +[RS_Comp_014] **Including markdown files** { `~~MD "lib/01234/xxxx/yyyy.md"~~` will be replaced by the content of the argument. It should even work inline. }(RS_Comp_003) + + +[RS_Conp_013] +[RS_Conp_013] **Defining text Snippets** { Text snippets are defined as a yaml file in the following format: :Snippet1: Das ist Snippet 1 :Snippet2: |- Das ist snippet 2. Es enthält sogar eine Liste * Das ist item 1 in Snippet 2 * Das ist item 2 in Snippet 2 }(RS_Comp_003) diff --git a/testproject.xx/30_Sources/ZSUPP_Manifests/sample_the-sample-document.yaml b/testproject.xx/30_Sources/ZSUPP_Manifests/sample_the-sample-document.yaml new file mode 100644 index 0000000..b10e881 --- /dev/null +++ b/testproject.xx/30_Sources/ZSUPP_Manifests/sample_the-sample-document.yaml @@ -0,0 +1,79 @@ +- + :name: komplett + :outdir: ../ZGEN_Documents + :outname: RS_Main + :format: + - latex + - docx + - html + - pdf + - beamer + - slidy + + :vars: + :lang: german + :fontsize: 12pt + :mainfont: Calibri + :sansfont: Calibri + :geometry: a4paper + :logofile: ../ZSUPP_Styles/logo.jpg + + :stylefiles: + :latex: ../ZSUPP_Styles/default.wortsammler.latex + :docx: ../ZSUPP_Styles/default.wortsammler.docx + :html: ../ZSUPP_Styles/default.wortsammler.css + + :input: + - ../001_main/main.md + + :downstream_tracefile: ../ZGEN_RequirementsTracing/RS_Main.traces.md + + :reqtracefile_base: ../ZGEN_RequirementsTracing/ZGEN_Reqtrace + + :traceSortOrder: + - RS_MG + - RS_TEC + + + :editions: + + :review: + :title: Main requirements (review) + :filepart: review + :debug: true + :format: + - latex + - docx + - html + - pdf + + :compact: + :title: Main requirements (compact) + :filepart: compact + :format: + - latex + - docx + - html + - pdf + + + :extended: + :title: Main requirements (extended) + :filepart: mieter + :format: + - latex + - docx + - html + - pdf + + + :folien: + :title: Beamer + :filepart: folien + :format: + - beamer + - slidy + + :snippets: + - ../900_snippets/snippets.xlsx + diff --git a/testproject.xx/30_Sources/ZSUPP_Styles/default.wortsammler.latex b/testproject.xx/30_Sources/ZSUPP_Styles/default.wortsammler.latex new file mode 100644 index 0000000..58f17c1 --- /dev/null +++ b/testproject.xx/30_Sources/ZSUPP_Styles/default.wortsammler.latex @@ -0,0 +1,321 @@ +\documentclass[twoside,a4paper,$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$]{$documentclass$} +\usepackage[T1]{fontenc} +\usepackage{lmodern} +\usepackage{amssymb,amsmath} +\usepackage{ifxetex,ifluatex} +\usepackage{fixltx2e} % provides \textsubscript +% use microtype if available +\IfFileExists{microtype.sty}{\usepackage{microtype}}{} +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \usepackage[utf8]{inputenc} +$if(euro)$ + \usepackage{eurosym} +$endif$ +\else % if luatex or xelatex + \usepackage{fontspec} + \ifxetex + \usepackage{xltxtra,xunicode} + \fi + \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} + \newcommand{\euro}{€} +$if(mainfont)$ + \setmainfont{$mainfont$} +$endif$ +$if(sansfont)$ + \setsansfont{$sansfont$} +$endif$ +$if(monofont)$ + \setmonofont{$monofont$} +$endif$ +$if(mathfont)$ + \setmathfont{$mathfont$} +$endif$ +\fi +$if(geometry)$ +\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} +$endif$ +$if(natbib)$ +\usepackage{natbib} +\bibliographystyle{plainnat} +$endif$ +$if(biblatex)$ +\usepackage{biblatex} +$if(biblio-files)$ +\bibliography{$biblio-files$} +$endif$ +$endif$ +$if(listings)$ +\usepackage{listings} +$endif$ +$if(lhs)$ +\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} +$endif$ +$if(highlighting-macros)$ +$highlighting-macros$ +$endif$ +$if(verbatim-in-note)$ +\usepackage{fancyvrb} +$endif$ +$if(fancy-enums)$ +% Redefine labelwidth for lists; otherwise, the enumerate package will cause +% markers to extend beyond the left margin. +\makeatletter\AtBeginDocument{% + \renewcommand{\@listi} + {\setlength{\labelwidth}{4em}} +}\makeatother +\usepackage{enumerate} +$endif$ +\usepackage{longtable} +\usepackage{float} % provides the H option for float placement +\usepackage{graphicx} +% We will generate all images so they have a width \maxwidth. This means +% that they will get their normal width if they fit onto the page, but +% are scaled down if they would overflow the margins. +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth +\else\Gin@nat@width\fi} +\makeatother +\let\Oldincludegraphics\includegraphics +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth +\else\Gin@nat@width\fi} +\makeatother +\let\Oldincludegraphics\includegraphics +%\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}} +% Determine if the image is too wide for the page. +% +{% + \catcode`\@=11\relax% + \gdef\includegraphics{\@ifnextchar[{\Oldincludegraphics}{\Oldincludegraphics[width=\maxwidth]}}% +}% +% + +\ifxetex + \usepackage[setpagesize=false, % page size defined by xetex + unicode=false, % unicode breaks when used with xetex + bookmarksdepth=3, % + xetex]{hyperref} +\else + \usepackage[unicode=true]{hyperref} +\fi +\hypersetup{breaklinks=true, + bookmarks=true, + pdfauthor={$author-meta$}, + pdftitle={$title-meta$}, + colorlinks=true, + urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$, + linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$, + pdfborder={0 0 0}} +\urlstyle{same} % don't use monospace font for urls +$if(links-as-notes)$ +% Make links footnotes instead of hotlinks: +\renewcommand{\href}[2]{#2\footnote{\url{#1}}} +$endif$ +$if(strikeout)$ +\usepackage[normalem]{ulem} +% avoid problems with \sout in headers with hyperref: +\pdfstringdefDisableCommands{\renewcommand{\sout}{}} +$endif$ +\setlength{\parindent}{0pt} +\setlength{\parskip}{6pt plus 2pt minus 1pt} +\setlength{\emergencystretch}{3em} % prevent overfull lines +$if(numbersections)$ +\setcounter{secnumdepth}{5} +$else$ +\setcounter{secnumdepth}{0} +$endif$ +$if(verbatim-in-note)$ +\VerbatimFootnotes % allows verbatim text in footnotes +$endif$ +$if(lang)$ +\ifxetex + \usepackage{polyglossia} + \setmainlanguage{$mainlang$} +\else + \usepackage[$lang$]{babel} +\fi +$endif$ +$for(header-includes)$ +$header-includes$ +$endfor$ + +$if(title)$ +\title{$title$} +$endif$ +\author{$for(author)$$author$$sep$ \and $endfor$} +\date{$date$} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Wortsammler specific settings +% +%list environment by reinhard Jahraus +{\catcode`\@=11\relax% +\gdef\itemize{% + \ifnum \@itemdepth >\thr@@\@toodeep\else + \advance\@itemdepth\@ne + \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% + \expandafter + \list + \csname\@itemitem\endcsname + {\def\makelabel##1{\hss\llap{##1}}% + \addtolength{\leftmargin}{-10pt}% 29.37pt + \addtolength{\rightmargin}{0.0pt}% 0.0pt + \addtolength{\labelsep}{0pt}% 23.50pt + \addtolength{\itemsep}{-3.0pt}% 5.0pt + \addtolength{\parsep}{-1pt}% 5.0pt + \addtolength{\topsep}{-5pt}% 10.0pt + \addtolength{\partopsep}{0pt}% 3.0pt + }% + \fi} +}% + +% +% improve nesting of lists +% %http://stackoverflow.com/questions/1935952/maximum-nesting-level-of-lists-in-latex +% +\usepackage{enumitem} +\setlistdepth{9} +\setlist[itemize,1]{label=$$\bullet$$} +\setlist[itemize,2]{label=$$\bullet$$} +\setlist[itemize,3]{label=$$\bullet$$} +\setlist[itemize,4]{label=$$\bullet$$} +\setlist[itemize,5]{label=$$\bullet$$} +\setlist[itemize,6]{label=$$\bullet$$} +\setlist[itemize,7]{label=$$\bullet$$} +\setlist[itemize,8]{label=$$\bullet$$} +\setlist[itemize,9]{label=$$\bullet$$} +\renewlist{itemize}{itemize}{9} +% +% multicol +% +\usepackage{multicol} +$if(linenumbers)$ +\newcommand{\wsbegintwocol}{} +\newcommand{\wsendtwocol}{} +$else$ +\newcommand{\wsbegintwocol}{\begin{multicols}{2}} +\newcommand{\wsendtwocol}{\end{multicols}} +$endif$ + +% +% embed an image in the text +% +% usage: \wsembedimage{file}{r|l}{width}{height} +\usepackage{wrapfig} +\usepackage{needspace} +\newcommand{\wsembedimage}[4]{\needspace{#4}\begin{wrapfigure}{#2}{#3}\centering% +\vspace{-5mm}\includegraphics{#1}\vspace{-1cm}\end{wrapfigure}} +% +% adjust page layout +% +\setlength{\oddsidemargin}{-0.5cm} +\setlength{\evensidemargin}{-0.5cm} +\setlength{\textwidth}{17cm} +\setlength{\topmargin}{-2.0cm} +\setlength{\headheight}{1cm} +\setlength{\headsep}{1.5cm} +\setlength{\textheight}{25cm} +\setlength{\footskip}{1cm} + +% adjust the toc layout +\makeatletter +% \renewcommand*\l@section{\@dottedtocline{2}{1.8em}{4em}} + \renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{4em}} + \renewcommand*\l@subsubsection{\@dottedtocline{2}{5.5em}{4em}} +\makeatother + +\usepackage{pdfpages} +\usepackage{bookmark} +\usepackage{fancyhdr} +\pagestyle{fancy} +\chead{\begin{center}\textbf{$title$} $edition$\end{center}} +$if(logofile)$ +\lhead{\includegraphics{$logofile$}} +$endif$ +\rhead{\leftmark} +\lfoot{$author$} +\rfoot{\today~$date$} +\renewcommand{\footrulewidth}{0.4pt} +% +\renewcommand{\familydefault}{\sfdefault} +% +% Marginpars shall always be right +\makeatletter + \def\marginparright{\@mparswitchfalse} + \def\marginparoutside{\@mparswitchtrue} +\makeatother +\marginparright +% +% +\raggedbottom +% + +$if(linenumbers)$ +\usepackage[pagewise]{lineno} +\setlength\linenumbersep{1mm} +\modulolinenumbers[5] +$endif$ + +\usepackage{makeidx} +\makeindex + +% +%\renewcommand{Befehl der Gliederungsebene z.B. \chapter}{\@startsection{Name z.B. chapter}{Ebene z.B. 0}{Einrückung z.B. 0pt}{Abstand zum vorigen Text z.B. 3.5ex plus 1ex minus 0pt\relax}{Abstand zum nachfolgenden Text z.B. 2.5ex plus 0.5ex minus 0pt\relax}{Schrift z.B. \normalfont\Large\bfseries}} +% +% \makeatletter% +% \renewcommand{\chapter}{\@startsection{chapter}{0}{0pt}{3.5ex plus 1ex minus 0pt\relax}{2.5ex plus 0.5ex minus 0pt\relax}{\normalfont\Large\bfseries}}% +% \makeatother% +% +% +% Wortsammler extensions end here +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{document} +$if(title)$ +\maketitle +$endif$ + +$for(include-before)$ +$include-before$ + +$endfor$ +$if(title)$ +\clearpage +$endif$ + +$if(toc)$ +{ +\hypersetup{linkcolor=black} +\setcounter{tocdepth}{1} +\tableofcontents +\newpage +} +$endif$ +$if(linenumbers)$ +\linenumbers +$endif$ + +$body$ + +$if(natbib)$ +$if(biblio-files)$ +$if(biblio-title)$ +$if(book-class)$ +\renewcommand\bibname{$biblio-title$} +$else$ +\renewcommand\refname{$biblio-title$} +$endif$ +$endif$ +\bibliography{$biblio-files$} + +$endif$ +$endif$ +$if(biblatex)$ +\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$ + +$endif$ +$for(include-after)$ +$include-after$ + +$endfor$ +\end{document} diff --git a/testproject.xx/30_Sources/ZSUPP_Styles/logo.jpg b/testproject.xx/30_Sources/ZSUPP_Styles/logo.jpg new file mode 100644 index 0000000..85b8706 Binary files /dev/null and b/testproject.xx/30_Sources/ZSUPP_Styles/logo.jpg differ diff --git a/testproject.xx/30_Sources/ZSUPP_Tools/rakefile.rb b/testproject.xx/30_Sources/ZSUPP_Tools/rakefile.rb new file mode 100644 index 0000000..8bc4382 --- /dev/null +++ b/testproject.xx/30_Sources/ZSUPP_Tools/rakefile.rb @@ -0,0 +1,5 @@ + +require 'wortsammler/rake_helper' + + + diff --git a/testresults/wortsammler_testresults.html b/testresults/wortsammler_testresults.html index 699cb23..74661bc 100644 --- a/testresults/wortsammler_testresults.html +++ b/testresults/wortsammler_testresults.html @@ -284,337 +284,47 @@

RSpec Code Examples

-
PandocBeautifier
- -
checks the availability of the right pandoc version0.05058s
-
-
-
-
-
pdf utilities:
- -
adjusts the bounding box of a pdf file34.33317s
- -
converts an excel sheet to pdf2.93657s
- -
converts a powerpoint to pdf2.80529s
- -
converts an excelsheet to cropped pdf3.80671s
- -
converts a powerpoint to cropped pdf34.31829s
-
-
-
-
-
TraceableSet
- -
should return a blank instance0.00010s
- -
allows to add Traceables0.00011s
- -
delivers the first of the duplicates0.00010s
- -
advertises duplicates0.00015s
- -
adertises undefined traceables0.00018s
- -
advertises all traceables0.00007s
- -
advertises a hash of supporting traces0.00006s
- -
advertises traceable ids of a particular category0.00013s
- -
advertises ttraceables of a particular category0.00011s
- -
merges traceables0.00025s
- +
TraceableSet
+ +
should return a blank instance0.00061s
+ +
allows to add Traceables0.00012s
+ +
delivers the first of the duplicates0.00008s
+ +
advertises duplicates0.00018s
+ +
adertises undefined traceables0.00010s
+ +
advertises all traceables0.00006s
+ +
advertises a hash of supporting traces0.00008s
+ +
advertises traceable ids of a particular category0.00007s
+ +
advertises ttraceables of a particular category0.00006s
+ +
merges traceables0.00018s
+
exposes deleted Traceables0.00009s
- -
exposes added Traceables0.00008s
- -
exposes deleted Traceables of category0.00007s
- -
exposes added Traceables of category0.00030s
- -
exploses changed traceids as array of [Traceid, levensthein, diff_as_html]0.01226s
- -
exposes unchanged Traceables0.00629s
- -
can be marshalled to a file0.00310s
- -
can be dumped to a graphml file0.01537s
-
-
-
-
-
Traceable
- -
should == "id"0.00011s
- -
should == "origin"0.00006s
- -
should == "alternative_id"0.00012s
- -
should == "header_plain"0.00009s
- -
should == "\\textt{header_origin}"0.00008s
- -
should == "body_plain"0.00010s
- -
should == ["contributes_to"]0.00008s
- -
should == "trace_orig"0.00007s
- -
should == "origin"0.00007s
- -
should == "category"0.00007s
- -
should == "info"0.00006s
-
-
-
-
-
Wortsammler generic issues
- -
provides a help0.67812s
- -
runs silent0.67815s
- -
reports version numbers0.74364s
- -
turns on vervbose mode0.68216s
- -
can create a new project folder0.63888s
- -
does not initialize into an existing project folder0.60810s
- - - - -
controls the pandoc options by document class (PENDING: implement test to control pandoc options by document class)
-
-
-
-
-
Wortsammler options validator
- -
rejects no processing0.61870s
-
-
-
-
-
Wortsammler beautifier features
- -
beautifies all markdown files in a folder0.95783s
- -
beautifies a single file0.64528s
- -
recognizes if the specified manifest file is a directory0.60224s
- -
beautifies input files in a manifest0.77817s
- -
claims missing input0.61138s
- -
claims undefined document path0.63362s
- - - - -
- creates a semantically unchanged markdown file - 0.66532s -
-
expected: "% Test Markdown\n% Bernhard Weichel\n% 1.12.2014\n\n# Test headlines\n\n# Head Leel 2\n\n# test fenced code blocks\n\n~~~~ {#codeblock}\n\nthis\n\n    is\n\n         codedblock\n~~~~\n\n~~~~ {#backtick_codeblock}\n\nthis\n\n    is\n\n         codedblock\n~~~~\n"
-     got: "---\nauthor:\n- Bernhard Weichel\ndate: '1.12.2014'\ntitle: Test Markdown\n...\n\n# Test headlines\n\n# Head Leel 2\n\n# test fenced code blocks\n\n``` {#codeblock}\n\nthis\n\n    is\n\n         codedblock\n```\n\n``` {#backtick_codeblock}\n\nthis\n\n    is\n\n         codedblock\n```\n" (using ==)
-Diff:
-@@ -1,6 +1,9 @@
--% Test Markdown
--% Bernhard Weichel
--% 1.12.2014
-+---
-+author:
-+- Bernhard Weichel
-+date: '1.12.2014'
-+title: Test Markdown
-+...
- 
- # Test headlines
- 
-
-
-
-@@ -8,21 +11,21 @@
- 
- # test fenced code blocks
- 
--~~~~ {#codeblock}
-+``` {#codeblock}
- 
- this
- 
-     is
- 
-          codedblock
--~~~~
-+```
- 
--~~~~ {#backtick_codeblock}
-+``` {#backtick_codeblock}
- 
- this
- 
-     is
- 
-          codedblock
--~~~~
-+```
-
-
./spec/wortsammler_spec.rb:142:in `block (2 levels) in '
-
140    reference = File.open(referencefile).read
-141    result = File.open(outputfile).read
-142    result.should == reference
-143  end
-144
-145# gem install syntax to get syntax highlighting
-
-
-
-
-
-
-
Wortsammler conversion
- -
converts a single file to output format4.62011s
- -
converts a single file to default output format4.22926s
- -
handles chapters up to 6 levels8.37273s
- -
handles lists up to 9 levels4.30039s
- -
converts all files within a folder to output format0.70828s
- -
processes a manifest13.37381s
- -
investigates the existence of a manifest0.62861s
- -
extracts the traceables according to a manifest0.79036s
- -
extracts plantuml according to a manifest1.50095s
- -
extracts plantuml from a single file4.21807s
- -
extracts plantuml from a folder4.62391s
- - - -
processes snippets (PENDING: Test not yet implemented)
- - - -
handles undefined snippets (PENDING: Test not yet implemented)
- -
runs the rake file in the sample document14.01860s
- -
compiles all documents0.00020s
-
-
-
-
-
Wortsammler syntax extensions
- -
[RS_Comp_012] supports embedded images13.34941s
- -
TC_EXP_001 expands expected results from testcases0.00220s
- -
TC_EXP_002 removes plantuml sources0.00195s
- - - -
- TC_EXP_003 handles Markdown inlays - 0.70553s -
-
expected: "-   this is headline\n    -   this is TC\\_EXP\\_003\\_1\n    -   this is md TC\\_EXP\\_003\\_2\n    -   this is md TC\\_EXP\\_003\\_2\n\n\n\nTHIS IS HEADLINE\n\n\n\n    now verbatim by indent inclucde TC_EXP_003_1.md\n\n        ## this is TC_EXP_003_1\n        \n        we now include TC_EXP_003_2 from TC_EXP_003_1\n        \n        ## this is md TC_EXP_003_2\n        \n            - hugo\n        \n            - hugo2\n        \n        end of TC_EXP_003_2\n        \n        end of TC_EXP_003_1\n\nnow full format inclucde TC_EXP_003_1.md\n\n\nthis is TC_EXP_003_1\n\nwe now include TC_EXP_003_2 from TC_EXP_003_1\n\n\nthis is md TC_EXP_003_2\n\n    - hugo\n\n    - hugo2\n\nend of TC_EXP_003_2\n\nend of TC_EXP_003_1\n\nnow full format inclucde TC_EXP_003_2.md\n\n\nthis is md TC_EXP_003_2\n\n    - hugo\n\n    - hugo2\n\nend of TC_EXP_003_2\n"
-     got: "-   this is headline\n    -   this is TC\\_EXP\\_003\\_1\n    -   this is md TC\\_EXP\\_003\\_2\n    -   this is md TC\\_EXP\\_003\\_2\n\n\nthis is headline\n================\n\n\n    now verbatim by indent inclucde TC_EXP_003_1.md\n\n        ## this is TC_EXP_003_1\n        \n        we now include TC_EXP_003_2 from TC_EXP_003_1\n        \n        ## this is md TC_EXP_003_2\n        \n            - hugo\n        \n            - hugo2\n        \n        end of TC_EXP_003_2\n        \n        end of TC_EXP_003_1\n\nnow full format inclucde TC_EXP_003_1.md\n\nthis is TC_EXP_003_1\n--------------------\n\nwe now include TC_EXP_003_2 from TC_EXP_003_1\n\nthis is md TC_EXP_003_2\n-----------------------\n\n    - hugo\n\n    - hugo2\n\nend of TC_EXP_003_2\n\nend of TC_EXP_003_1\n\nnow full format inclucde TC_EXP_003_2.md\n\nthis is md TC_EXP_003_2\n-----------------------\n\n    - hugo\n\n    - hugo2\n\nend of TC_EXP_003_2\n" (using ==)
-Diff:
-
-
-@@ -4,11 +4,10 @@
-     -   this is md TC\_EXP\_003\_2
- 
- 
-+this is headline
-+================
- 
--THIS IS HEADLINE
- 
--
--
-     now verbatim by indent inclucde TC_EXP_003_1.md
- 
-         ## this is TC_EXP_003_1
-
-
-
-@@ -27,13 +26,13 @@
- 
- now full format inclucde TC_EXP_003_1.md
- 
--
- this is TC_EXP_003_1
-+--------------------
- 
- we now include TC_EXP_003_2 from TC_EXP_003_1
- 
--
- this is md TC_EXP_003_2
-+-----------------------
- 
-     - hugo
- 
-
-@@ -45,8 +44,8 @@
- 
- now full format inclucde TC_EXP_003_2.md
- 
--
- this is md TC_EXP_003_2
-+-----------------------
- 
-     - hugo
- 
-
-
./spec/wortsammler_spec.rb:439:in `block (2 levels) in '
-
437    ref = File.open("#{specdir}/tc_exp_003_reference.txt").read
-438    result = File.open("#{tempdir}/#{mdfile}.txt").read
-439    ref.should==result
-440  end
-441
-442# gem install syntax to get syntax highlighting
-
-
- -
- generates an index - 4.39002s -
-
invalid byte sequence in UTF-8
-
./spec/wortsammler_spec.rb:447:in `block (2 levels) in '
-
445    ref = File.open("#{specdir}/test_mkindex_reference.txt").read
-446    result = File.open("#{testoutput}/test_mkindex.txt").read
-447    ref.should==result
-448  end
-449
-450# gem install syntax to get syntax highlighting
-
-
+ +
exposes added Traceables0.00010s
+ +
exposes deleted Traceables of category0.00006s
+ +
exposes added Traceables of category0.00010s
+ +
exploses changed traceids as array of [Traceid, levensthein, diff_as_html]0.01738s
+ +
exposes unchanged Traceables0.00554s
+ +
can be marshalled to a file0.00182s
-
reports TeX messages4.29977s
+
can be dumped to a graphml file0.00216s
- - + +
diff --git a/testresults/wortsammler_testresults.log b/testresults/wortsammler_testresults.log deleted file mode 100644 index b79c47f..0000000 --- a/testresults/wortsammler_testresults.log +++ /dev/null @@ -1,219 +0,0 @@ -Run options: exclude {:exp=>true} - -PandocBeautifier - checks the availability of the right pandoc version - -pdf utilities: - adjusts the bounding box of a pdf file - converts an excel sheet to pdf - converts a powerpoint to pdf - converts an excelsheet to cropped pdf - converts a powerpoint to cropped pdf - -TraceableSet - should return a blank instance - allows to add Traceables - delivers the first of the duplicates - advertises duplicates - adertises undefined traceables - advertises all traceables - advertises a hash of supporting traces - advertises traceable ids of a particular category - advertises ttraceables of a particular category - merges traceables - exposes deleted Traceables - exposes added Traceables - exposes deleted Traceables of category - exposes added Traceables of category - exploses changed traceids as array of [Traceid, levensthein, diff_as_html] - exposes unchanged Traceables - can be marshalled to a file - can be dumped to a graphml file - -Traceable - should == "id" - should == "origin" - should == "alternative_id" - should == "header_plain" - should == "\\textt{header_origin}" - should == "body_plain" - should == ["contributes_to"] - should == "trace_orig" - should == "origin" - should == "category" - should == "info" - -Wortsammler generic issues - provides a help - runs silent - reports version numbers - turns on vervbose mode - can create a new project folder - does not initialize into an existing project folder - controls the pandoc options by document class (PENDING: implement test to control pandoc options by document class) - -Wortsammler options validator - rejects no processing - -Wortsammler beautifier features - beautifies all markdown files in a folder - beautifies a single file - recognizes if the specified manifest file is a directory - beautifies input files in a manifest - claims missing input - claims undefined document path - creates a semantically unchanged markdown file (FAILED - 1) - -Wortsammler conversion - converts a single file to output format - converts a single file to default output format - handles chapters up to 6 levels - handles lists up to 9 levels - converts all files within a folder to output format - processes a manifest - investigates the existence of a manifest - extracts the traceables according to a manifest - extracts plantuml according to a manifest - extracts plantuml from a single file - extracts plantuml from a folder - processes snippets (PENDING: Test not yet implemented) - handles undefined snippets (PENDING: Test not yet implemented) - runs the rake file in the sample document - compiles all documents - -Wortsammler syntax extensions - [RS_Comp_012] supports embedded images - TC_EXP_001 expands expected results from testcases - TC_EXP_002 removes plantuml sources - TC_EXP_003 handles Markdown inlays (FAILED - 2) - generates an index (FAILED - 3) - reports TeX messages - -Pending: - Wortsammler generic issues controls the pandoc options by document class - # implement test to control pandoc options by document class - # ./spec/wortsammler_spec.rb:52 - Wortsammler conversion processes snippets - # Test not yet implemented - # ./spec/wortsammler_spec.rb:315 - Wortsammler conversion handles undefined snippets - # Test not yet implemented - # ./spec/wortsammler_spec.rb:319 - -Failures: - - 1) Wortsammler beautifier features creates a semantically unchanged markdown file - Failure/Error: result.should == reference - expected: "% Test Markdown\n% Bernhard Weichel\n% 1.12.2014\n\n# Test headlines\n\n# Head Leel 2\n\n# test fenced code blocks\n\n~~~~ {#codeblock}\n\nthis\n\n is\n\n codedblock\n~~~~\n\n~~~~ {#backtick_codeblock}\n\nthis\n\n is\n\n codedblock\n~~~~\n" - got: "---\nauthor:\n- Bernhard Weichel\ndate: '1.12.2014'\ntitle: Test Markdown\n...\n\n# Test headlines\n\n# Head Leel 2\n\n# test fenced code blocks\n\n``` {#codeblock}\n\nthis\n\n is\n\n codedblock\n```\n\n``` {#backtick_codeblock}\n\nthis\n\n is\n\n codedblock\n```\n" (using ==) - Diff: - @@ -1,6 +1,9 @@ - -% Test Markdown - -% Bernhard Weichel - -% 1.12.2014 - +--- - +author: - +- Bernhard Weichel - +date: '1.12.2014' - +title: Test Markdown - +... - - # Test headlines - - - - - @@ -8,21 +11,21 @@ - - # test fenced code blocks - - -~~~~ {#codeblock} - +``` {#codeblock} - - this - - is - - codedblock - -~~~~ - +``` - - -~~~~ {#backtick_codeblock} - +``` {#backtick_codeblock} - - this - - is - - codedblock - -~~~~ - +``` - # ./spec/wortsammler_spec.rb:142:in `block (2 levels) in ' - - 2) Wortsammler syntax extensions TC_EXP_003 handles Markdown inlays - Failure/Error: ref.should==result - expected: "- this is headline\n - this is TC\\_EXP\\_003\\_1\n - this is md TC\\_EXP\\_003\\_2\n - this is md TC\\_EXP\\_003\\_2\n\n\n\nTHIS IS HEADLINE\n\n\n\n now verbatim by indent inclucde TC_EXP_003_1.md\n\n ## this is TC_EXP_003_1\n \n we now include TC_EXP_003_2 from TC_EXP_003_1\n \n ## this is md TC_EXP_003_2\n \n - hugo\n \n - hugo2\n \n end of TC_EXP_003_2\n \n end of TC_EXP_003_1\n\nnow full format inclucde TC_EXP_003_1.md\n\n\nthis is TC_EXP_003_1\n\nwe now include TC_EXP_003_2 from TC_EXP_003_1\n\n\nthis is md TC_EXP_003_2\n\n - hugo\n\n - hugo2\n\nend of TC_EXP_003_2\n\nend of TC_EXP_003_1\n\nnow full format inclucde TC_EXP_003_2.md\n\n\nthis is md TC_EXP_003_2\n\n - hugo\n\n - hugo2\n\nend of TC_EXP_003_2\n" - got: "- this is headline\n - this is TC\\_EXP\\_003\\_1\n - this is md TC\\_EXP\\_003\\_2\n - this is md TC\\_EXP\\_003\\_2\n\n\nthis is headline\n================\n\n\n now verbatim by indent inclucde TC_EXP_003_1.md\n\n ## this is TC_EXP_003_1\n \n we now include TC_EXP_003_2 from TC_EXP_003_1\n \n ## this is md TC_EXP_003_2\n \n - hugo\n \n - hugo2\n \n end of TC_EXP_003_2\n \n end of TC_EXP_003_1\n\nnow full format inclucde TC_EXP_003_1.md\n\nthis is TC_EXP_003_1\n--------------------\n\nwe now include TC_EXP_003_2 from TC_EXP_003_1\n\nthis is md TC_EXP_003_2\n-----------------------\n\n - hugo\n\n - hugo2\n\nend of TC_EXP_003_2\n\nend of TC_EXP_003_1\n\nnow full format inclucde TC_EXP_003_2.md\n\nthis is md TC_EXP_003_2\n-----------------------\n\n - hugo\n\n - hugo2\n\nend of TC_EXP_003_2\n" (using ==) - Diff: - - - @@ -4,11 +4,10 @@ - - this is md TC\_EXP\_003\_2 - - - +this is headline - +================ - - -THIS IS HEADLINE - - - - - - now verbatim by indent inclucde TC_EXP_003_1.md - - ## this is TC_EXP_003_1 - - - - @@ -27,13 +26,13 @@ - - now full format inclucde TC_EXP_003_1.md - - - - this is TC_EXP_003_1 - +-------------------- - - we now include TC_EXP_003_2 from TC_EXP_003_1 - - - - this is md TC_EXP_003_2 - +----------------------- - - - hugo - - - @@ -45,8 +44,8 @@ - - now full format inclucde TC_EXP_003_2.md - - - - this is md TC_EXP_003_2 - +----------------------- - - - hugo - - # ./spec/wortsammler_spec.rb:439:in `block (2 levels) in ' - - 3) Wortsammler syntax extensions generates an index - Failure/Error: ref.should==result - ArgumentError: - invalid byte sequence in UTF-8 - # ./spec/wortsammler_spec.rb:447:in `block (2 levels) in ' - -Finished in 2 minutes 51.99 seconds -71 examples, 3 failures, 3 pending - -Failed examples: - -rspec ./spec/wortsammler_spec.rb:130 # Wortsammler beautifier features creates a semantically unchanged markdown file -rspec ./spec/wortsammler_spec.rb:405 # Wortsammler syntax extensions TC_EXP_003 handles Markdown inlays -rspec ./spec/wortsammler_spec.rb:442 # Wortsammler syntax extensions generates an index diff --git a/uninstall-pandoc.pl b/uninstall-pandoc.pl new file mode 100644 index 0000000..a5194d9 --- /dev/null +++ b/uninstall-pandoc.pl @@ -0,0 +1,79 @@ +#!/usr/bin/perl + +# Script to remove all files installed by the OSX pandoc installer +# and unregister the package. Modified from a script contributed +# by Daniel T. Staal. + +use warnings; +use strict; + +use File::Spec; + +# The main info: this is the list of files to remove and the pkg_id. +my $pkg_id = 'net.johnmacfarlane.pandoc'; + +# Find which, if any, volume Pandoc is installed on. +my $volume; + +# First check /, then other volumes on the box. +my $cur_test = `pkgutil --pkgs=$pkg_id`; +if ( $cur_test =~ m/$pkg_id/ ) { + $volume = '/'; +} else { + opendir( my $dh, '/Volumes' ) or die "Can't list Volumes: $!\n"; + foreach my $dir ( readdir($dh) ) { + next if $dir =~ m/^\./; # Skip dotfiles. + + my $path = File::Spec->rel2abs( $dir, '/Volumes' ); + next if !( -d $path ); # Skip anything that isn't a directory. + + my $cur_test = `pkgutil --pkgs=$pkg_id --volume '$path'`; + if ( $cur_test =~ m/$pkg_id/ ) { + $volume = $path; + last; + } + } +} + +die "Pandoc not installed.\n" if !( defined($volume) ); + +# Get the list of files to remove. +my @pkg_files = `pkgutil --volume '$volume' --only-files --files '$pkg_id'`; +@pkg_files = map { chomp; File::Spec->rel2abs($_, $volume) } @pkg_files; + +# Confirm uninistall with the user. +print "The following files will be deleted:\n\n"; +print join("\n", @pkg_files); +print "\n\n"; +print "Do you want to proceed and uninstall pandoc (Y/N)?"; +my $input = ; + +if ($input =~ m/^[Yy]/) { + + # Actually remove the files. + foreach my $file (@pkg_files) { + if ( -e $file ) { + if ( system( 'sudo', 'rm', $file ) == 0 ) { + warn "Deleted $file\n"; + } else { + warn "Unable to delete $file: $?\n"; + die "Aborting Uninstall.\n"; + } + } else { + warn "File $file does not exist. Skipping.\n"; + } + } + + # Clean up the install. + if (system('sudo', 'pkgutil', '--forget', $pkg_id, '--volume', $volume) != 0) { + die "Unable to clean up install: $?\n"; + } + +} else { + + print "OK, aborting uninstall.\n"; + exit; +} + +print "Pandoc has been successfully uninstalled.\n"; +exit; diff --git a/wortsammler.gemspec b/wortsammler.gemspec index 8bc649b..b090e6c 100644 --- a/wortsammler.gemspec +++ b/wortsammler.gemspec @@ -26,13 +26,14 @@ Gem::Specification.new do |spec| wortsammler is based on ruby, pandoc, latex END_DOC - spec.required_ruby_version = '>= 1.9.3' + spec.required_ruby_version = '>= 2.4' spec.add_runtime_dependency 'logger' - spec.add_runtime_dependency 'nokogiri', '=1.5.10 ' + spec.add_runtime_dependency 'nokogiri', '=1.8.2' spec.add_runtime_dependency 'rubyXL' spec.add_runtime_dependency 'diffy', "~> 2.1.3" spec.add_runtime_dependency 'rubyzip' spec.add_runtime_dependency 'treetop' + spec.add_runtime_dependency 'rspec' spec.summary = %q{an environment to manage documentation} spec.homepage = "" @@ -43,11 +44,13 @@ END_DOC spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_development_dependency "bundler", "~> 1.3" + spec.add_development_dependency "bundler", "~> 2.0" spec.add_development_dependency "rake", "~> 10.0.4" - spec.add_development_dependency "rspec", "~> 2.13.0" - spec.add_development_dependency 'pry', "~> 0.9.12" - spec.add_development_dependency 'yard', "~> 0.8.5.2" + spec.add_development_dependency "rspec" + spec.add_development_dependency 'pry', "~> 0.12.2" + spec.add_development_dependency 'pry-byebug', "~> 3.6" + + spec.add_development_dependency 'yard', "~> 0.9.11" spec.add_development_dependency 'redcarpet', "~> 2.2.2" spec.add_development_dependency 'graph', "~> 2.5.2"