docgenerator 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +7 -0
  2. data/examples/creole_example.rb +0 -1
  3. data/examples/creole_example_new_plugin.rb +51 -0
  4. data/examples/creole_example_tabular.rb +3 -1
  5. data/examples/wiki2docgenerator_example.rb +2 -2
  6. data/lib/creole/creole2doc.rb +697 -680
  7. data/lib/creole/creole_characters.rb +90 -26
  8. data/lib/creole/creole_inclusion_and_plugins.rb +25 -43
  9. data/lib/creole/creole_inclusions.rb +87 -75
  10. data/lib/creole/creole_placeholder.rb +87 -89
  11. data/lib/creole/creole_plugins.rb +149 -117
  12. data/lib/creole/creole_tabular.rb +247 -141
  13. data/lib/creole/plugins/todonotes.rb +48 -48
  14. data/lib/docgenerator/characters.rb +106 -8
  15. data/lib/docgenerator/compatibility_v1.rb +7 -1
  16. data/lib/docgenerator/document.rb +34 -19
  17. data/lib/docgenerator/element.rb +1 -0
  18. data/lib/docgenerator/element_meta.rb +1 -1
  19. data/lib/docgenerator/elements.rb +594 -535
  20. data/lib/docgenerator/environments.rb +131 -99
  21. data/lib/docgenerator/index.rb +110 -0
  22. data/lib/docgenerator/lists.rb +2 -1
  23. data/lib/docgenerator/packages/caption.rb +32 -34
  24. data/lib/docgenerator/packages/hyperref.rb +1 -0
  25. data/lib/docgenerator/packages/multicol.rb +3 -2
  26. data/lib/docgenerator/packages/pdfpages.rb +71 -20
  27. data/lib/docgenerator/packages/scrpage2.rb +99 -142
  28. data/lib/docgenerator/packages/url.rb +75 -81
  29. data/lib/docgenerator/sections.rb +98 -98
  30. data/lib/docgenerator/standard.rb +8 -1
  31. data/lib/docgenerator/tabular.rb +44 -25
  32. data/lib/docgenerator/templates/docgenerator_template.yaml +28 -0
  33. data/lib/docgenerator/version.rb +146 -0
  34. data/lib/docgenerator.rb +20 -15
  35. data/meta_test_and_doc/build_doc.rb +39 -10
  36. data/meta_test_and_doc/build_test.rb +34 -12
  37. data/meta_test_and_doc/manpages/characters.rb +452 -20
  38. data/meta_test_and_doc/manpages/elementlist.rb +304 -0
  39. data/meta_test_and_doc/manpages/elements.rb +305 -42
  40. data/meta_test_and_doc/manpages/others.rb +403 -0
  41. data/meta_test_and_doc/manpages/pdfpages.rb +117 -18
  42. data/meta_test_and_doc/manpages/readme.rdoc +3 -1
  43. data/meta_test_and_doc/manpages/scrpage2.rb +0 -80
  44. data/meta_test_and_doc/manpages/tables.rb +6 -6
  45. data/readme.rdoc +11 -120
  46. data/unittest/expected/test_comment.html +1 -0
  47. data/unittest/expected/test_comment.latex +5 -0
  48. data/unittest/expected/test_comment_complex.html +3 -0
  49. data/unittest/expected/test_comment_complex.latex +15 -0
  50. data/unittest/expected_creole/test_creole_characters_all.html +6 -5
  51. data/unittest/expected_creole/test_creole_characters_all.latex +10 -8
  52. data/unittest/expected_creole/test_creole_creole1.0test.latex +5 -5
  53. data/unittest/expected_creole/test_creole_input.normsource +11 -9
  54. data/unittest/expected_creole/test_creole_list_ul.normsource +57 -51
  55. data/unittest/expected_creole/test_creole_list_ulul_without_ul.html +6 -0
  56. data/unittest/expected_creole/test_creole_list_ulul_without_ul.latex +12 -0
  57. data/unittest/expected_creole/test_creole_paragraphs.normsource +12 -10
  58. data/unittest/expected_creole/test_creole_pictures.latex +2 -2
  59. data/unittest/expected_creole/test_creole_pictures_css.latex +2 -2
  60. data/unittest/expected_creole/test_creole_pictures_imgclass.latex +2 -2
  61. data/unittest/expected_creole/test_creole_pictures_width.latex +1 -1
  62. data/unittest/expected_creole/test_creole_tabular.latex +3 -3
  63. data/unittest/expected_creole/test_creole_tabular_creole.latex +2 -2
  64. data/unittest/expected_creole/test_creole_tabular_css.latex +3 -3
  65. data/unittest/expected_creole/test_creole_tabular_row_parameters.latex +22 -0
  66. data/unittest/expected_templates/test_standalone.tex +34 -0
  67. data/unittest/expected_wikimedia/test_wiki_picture.latex +12 -12
  68. data/unittest/unittest_creole.rb +22 -3
  69. data/unittest/unittest_creole_tabular.rb +34 -1
  70. data/unittest/unittest_docgenerator.rb +46 -3
  71. data/unittest/unittest_docgenerator_characters.rb +527 -82
  72. data/unittest/unittest_templates.rb +1 -1
  73. metadata +149 -108
data/lib/docgenerator.rb CHANGED
@@ -1,7 +1,13 @@
1
+ #encoding: utf-8
1
2
  =begin rdoc
2
3
  = NAME
3
4
  Docgenerator
4
5
 
6
+ Version see Docgenerator::VERSION
7
+
8
+ * For change history, please refer version.rb[link:files/lib/docgenerator/version_rb.html]
9
+
10
+
5
11
  = SYNOPSIS
6
12
  Docgenerator provides a ruby interface to build documents.
7
13
 
@@ -10,8 +16,10 @@ The document generation is build via 'Elements',
10
16
  the target format is generic, actual supported are:
11
17
  -LaTeX
12
18
  -HTML
13
- Plain text and two Wiki-version exist also (Wikimedia and Creole),
19
+ -Creole
20
+ Plain text and two Wikimedia-format are defined,
14
21
  but they are not well maintained.
22
+
15
23
  A context-export is planned for the future
16
24
  (but it has a low level-importance for me).
17
25
 
@@ -66,23 +74,11 @@ HTML-Versions are not supported properly
66
74
  (main problem: End-Tag for br)
67
75
 
68
76
  More at http://ruby.lickert.net/docgenerator/index.html
69
- =end
70
-
71
- #
72
- #For quick test
73
- #
74
- if $0 == __FILE__ and RUBY_VERSION =~ /1.9/
75
- $:.unshift('.')
76
- end
77
-
78
-
79
77
 
80
- =begin rdoc
78
+ ==Module Docgenerator
81
79
  All classes of this gem are encapsulated in module Docgenerator.
82
80
  =end
83
81
  module Docgenerator
84
- #Define Version number
85
- VERSION = '2.1.0'
86
82
  class << self
87
83
  @trace = nil
88
84
  =begin rdoc
@@ -340,6 +336,14 @@ Instance-version of class method.
340
336
  end #module Docgenerator
341
337
 
342
338
 
339
+ #
340
+ #For quick syntax checks (and small tests)
341
+ #
342
+ if $0 == __FILE__ and RUBY_VERSION =~ /1.9/
343
+ $:.unshift('.')
344
+ end
345
+
346
+ require 'docgenerator/version'
343
347
  require 'docgenerator/standard'
344
348
  require 'docgenerator/element_meta' #Meta-class definitions
345
349
  require 'docgenerator/element' #includes definition of method 'element'
@@ -357,6 +361,7 @@ require 'docgenerator/lists' #define environment
357
361
  require 'docgenerator/sections'
358
362
  require 'docgenerator/tabular'
359
363
  require 'docgenerator/footnote'
364
+ require 'docgenerator/index' #makeindex, index, printindex...
360
365
  require 'docgenerator/characters' #special characters (spaces, euro-sign...)
361
366
  #~ require_relative 'docgenerator/characters' #special characters (spaces, euro-sign...)
362
367
 
@@ -370,6 +375,6 @@ if $0 == __FILE__
370
375
  doc.body << 'text'
371
376
  #~ p doc.to_doc(:html, {:log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER})
372
377
  #~ p doc.to_doc(:latex, {:log => Docgenerator::DOCGENERATOR_DEFAULT_LOGGER})
373
- doc.save('xx.html')
378
+ #~ doc.save('xx.html')
374
379
  end
375
380
  __END__
@@ -288,7 +288,6 @@ def mk_attr_overview(variant, attr, el)
288
288
 
289
289
  end #mk_attr_overview
290
290
 
291
-
292
291
  desc "Create all manpages"
293
292
  task :all_man_files
294
293
  #Build single file tasks
@@ -299,6 +298,35 @@ FILE_SEPARATION.each{|key, elementlist|
299
298
  task :all_man_files => filename #add file task as prerequisite to :all_man_files
300
299
  }
301
300
 
301
+ class Docgenerator::Element
302
+ #Helper to have access to all ids.
303
+ def self.ids; @@ids;end
304
+ end
305
+ file 'manpages/elementlist.rb' => :force do |tsk|
306
+ File.open(tsk.name, 'w:utf-8'){|f|
307
+ f << <<rdoc
308
+ #encoding: utf-8
309
+
310
+ =begin rdoc
311
+ The following elements and characters are defined and can be used with
312
+ element(key, { options}, content)
313
+
314
+ rdoc
315
+
316
+ Docgenerator::Element.ids.sort_by{|id, elclass|id.to_s}.each{|id, elclass|
317
+ f << "* <tt>%s</tt>: %s\n" % [id.inspect,elclass]
318
+ #~ f << "[<tt>%s</tt]: %s\n" % [id,elclass] #labeled list (rdoc4.0?)
319
+ }
320
+ f << <<rdoc
321
+ =end
322
+ def element
323
+ end #element
324
+ rdoc
325
+ }
326
+ end #file 'manpages/elementlist.rb'
327
+ task :all_man_files => 'manpages/elementlist.rb'
328
+
329
+
302
330
  task :force
303
331
  task :clean do
304
332
  Rake.application[:all_man_files].prerequisites.each{|f|
@@ -314,20 +342,21 @@ end
314
342
 
315
343
 
316
344
  #~ task 'manpages/environments.rb' => :force
317
- #~ task :default => 'manpages/environments.rb'
345
+ #~ task :local_default => 'manpages/environments.rb'
318
346
  #~ task 'manpages/sectioning.rb' => :force
319
- #~ task :default => 'manpages/sectioning.rb'
347
+ #~ task :local_default => 'manpages/sectioning.rb'
320
348
  #~ task 'manpages/elements.rb' => :force
321
- #~ task :default => 'manpages/elements.rb'
349
+ #~ task :local_default => 'manpages/elements.rb'
322
350
  #~ task 'manpages/characters.rb' => :force
323
- #~ task :default => 'manpages/characters.rb'
351
+ #~ task :local_default => 'manpages/characters.rb'
324
352
 
325
- #~ task :default => :test
326
- task :default => :clean
327
- task :default => :all_man_files
328
- #~ task :default => :rdoc_manpages
353
+ #~ task :local_default => 'manpages/elementlist.rb'
354
+ #~ task :local_default => :test
355
+ #~ task :local_default => :clean
356
+ #~ task :local_default => :all_man_files
357
+ task :local_default => :rdoc_manpages
329
358
 
330
359
  if $0 == __FILE__
331
360
  app = Rake.application
332
- app[:default].invoke
361
+ app[:local_default].invoke
333
362
  end
@@ -30,7 +30,8 @@ Test generated by #{__FILE__} #{Date.today}
30
30
 
31
31
  This is not a 'real' test unit.
32
32
  The tests are created with #{__FILE__}:
33
- 1) Each Element is taken and field.
33
+
34
+ 1) Each Docgenerator::Element is taken and a test is generated.
34
35
  =end
35
36
 
36
37
  gem 'test-unit'
@@ -206,23 +207,28 @@ end # mk_element_testcase(cl)
206
207
 
207
208
 
208
209
  desc "Create all test files"
209
- task :all_test_files
210
+ task :create_test_files
210
211
 
211
212
  #Create file tasks
212
213
  FILE_SEPARATION.each{|key, elementlist|
213
214
  filename = File.join('unittest', "unittest_#{key}")
214
- file filename do |tsk| mk_element_test(elementlist, tsk.name, FILE_SEPARATION_REQUIREMENTS[key] ); end #Create file task
215
- task :all_test_files => filename #add file task as prerequisite to :all_test_files
215
+ #~ puts "file '%s' => :force" % filename
216
+ desc "Create %s" % filename
217
+ file filename do |tsk| #Create file task
218
+ mk_element_test(elementlist, tsk.name, FILE_SEPARATION_REQUIREMENTS[key] )
219
+ end
220
+ task :create_test_files => filename #add file task as prerequisite to :create_test_files
216
221
  }
217
222
 
218
223
  task :force
219
224
  task :clean do
220
- Rake.application[:all_test_files].prerequisites.each{|f|
225
+ Rake.application[:create_test_files].prerequisites.each{|f|
221
226
  File.delete(f) if File.exist?(f)
222
227
  }
223
228
  end
224
229
 
225
- require 'knut_tools/rake/testtask.rb'
230
+ $:.unshift('c:/usr/script/knut/knut-testtask/lib') #get local dev. version
231
+ require 'knut-testtask.rb'
226
232
  Rake::TestTask.new(:run_tests) do |t|
227
233
  t.dir = 'unittest'
228
234
  t.libs << '../lib'
@@ -231,13 +237,31 @@ Rake::TestTask.new(:run_tests) do |t|
231
237
  t.verbose = true
232
238
  end
233
239
 
234
- task :default => :clean
235
- task :default => :all_test_files
236
- #~ task :default => :run_tests
240
+ #~ task :local_default => :clean
241
+ #~ file 'unittest/unittest_attachfile.rb' => :force
242
+ #~ file 'unittest/unittest_caption.rb' => :force
243
+ #~ file 'unittest/unittest_hyperref.rb' => :force
244
+ #~ file 'unittest/unittest_listings.rb' => :force
245
+ #~ file 'unittest/unittest_pdfpages.rb' => :force
246
+ #~ file 'unittest/unittest_scrlettr2.rb' => :force
247
+ #~ file 'unittest/unittest_scrpage2.rb' => :force
248
+ #~ file 'unittest/unittest_todonotes.rb' => :force
249
+ #~ file 'unittest/unittest_wiki2docgenerator.rb' => :force
250
+ #~ file 'unittest/unittest_characters.rb' => :force
251
+ #~ file 'unittest/unittest_environments.rb' => :force
252
+ #~ file 'unittest/unittest_lists.rb' => :force
253
+ #~ file 'unittest/unittest_footnote.rb' => :force
254
+ #~ file 'unittest/unittest_sectioning.rb' => :force
255
+ #~ file 'unittest/unittest_tables.rb' => :force
256
+ #~ file 'unittest/unittest_elements.rb' => :force
257
+ #~ file 'unittest/unittest_others.rb' => :force
258
+
259
+ task :local_default => :create_test_files
260
+ #~ task :local_default => :run_tests
237
261
 
238
262
  if $0 == __FILE__
239
263
  app = Rake.application
240
- app[:default].invoke
264
+ app[:local_default].invoke
241
265
  end
242
266
 
243
267
  #~ puts_elements
@@ -247,5 +271,3 @@ fixme:
247
271
  - tests mit #cr...
248
272
  - optionale attribute
249
273
  - testdaten in DB? (verschiedene Attributesausprägungen?)
250
-
251
-