dyndoc-ruby-core 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2792918d1c715f0334e1d70e055f02f3c783dbc
4
- data.tar.gz: 231fd6e4fd285f131767c2119a98d9766a2622f3
3
+ metadata.gz: d61c9814fbee12e7690e969be05be1508045df8a
4
+ data.tar.gz: 894618eac5de35bb862ae6156ade8203da680907
5
5
  SHA512:
6
- metadata.gz: c7cf94895b0b29291a59d0d9bb848c8bff238f2c589aa8af813f19f4af31d7f5d34969e981c352c04237780c1cc558b81c9032a18d7ba5f2af879e4b18e75cf5
7
- data.tar.gz: 8d8c4e90a564dc1e3803d08a1931fabd6d2f11e84e4af6db2fce0be0826f4278f8aa20fde75f688f952a3b7243e52125a7ad4731d2128ef2d3ce61d130fae49c
6
+ metadata.gz: 754c502ef583d5da3e567ba0b64824e4cd3fff6a3b84ecca326ed562405495755df4ea2482d1001993d0e66cf7cd6415c469bbd9879ff2fe35520207c23900d3
7
+ data.tar.gz: 6783f7f70b01b0ed79ac6e1e65fca16fb92ba0ac6f2cc08fdc6e135f891e77e42be7085b8f94a438c786af1757996a981d588095b96046f0f36a849d4b436c0f
@@ -1201,7 +1201,7 @@ p call
1201
1201
  i,*b2=next_block(blck,i)
1202
1202
  codename=parse(b2,filter).strip
1203
1203
  code[codename]=[:blck]
1204
- when :do,:<,:out,:>,:"r<",:"R<",:"rb<",:"r>",:"R>",:"rb>",:nl,:"\n",:>>,:"?",:tag,:"??",:"=",:"+",:<<,:"%",:"html>",:"tex>",:"txtl>",:"md>",:"adoc>" #NO :yield because of infinite loops
1204
+ when :do,:<,:out,:>,:"r<",:"R<",:"rb<",:"r>",:"R>",:"R>>",:"rb>",:nl,:"\n",:>>,:"?",:tag,:"??",:"=",:"+",:<<,:"%",:"html>",:"tex>",:"txtl>",:"md>",:"adoc>" #NO :yield because of infinite loops
1205
1205
  code[codename] << blck[i]
1206
1206
  i,*b2=next_block(blck,i)
1207
1207
  code[codename] += b2
@@ -1,40 +1,67 @@
1
- require 'tilt' #this allows the use of any other template
1
+ require 'tilt' #this allows the use of any other template
2
2
  require 'tilt/template' #for creating the dyndoc one
3
3
  require 'redcloth'
4
4
 
5
5
 
6
6
  module Tilt
7
-
7
+
8
8
  class DynDocTemplate < Template
9
9
 
10
10
  def DynDocTemplate.init(libs=nil)
11
- unless $curDyn
12
- require 'dyndoc/V3/init/dyn'
13
- CqlsDoc.init_dyn
14
- CqlsDoc.set_curDyn(:V3)
15
- $curDyn.init(false)
16
- $curDyn.tmpl_doc.init_doc
17
- if libs
18
- @@libs=libs
19
- $curDyn.tmpl_doc.require_dyndoc_libs(libs)
20
- end
21
- "options(bitmapType='cairo')".to_R
22
- $curDyn.tmpl.format_output="html"
23
- $curDyn.tmpl.dyndoc_mode=:web # No command line
24
- #p [$curDyn.tmpl.dyndocMode,$curDyn.tmpl.fmtOutput]
11
+ # unless $curDyn
12
+ # require 'dyndoc/V3/init/dyn'
13
+ # CqlsDoc.init_dyn
14
+ # CqlsDoc.set_curDyn(:V3)
15
+ # $curDyn.init(false)
16
+ # $curDyn.tmpl_doc.init_doc
17
+ # if libs
18
+ # @@libs=libs
19
+ # $curDyn.tmpl_doc.require_dyndoc_libs(libs)
20
+ # end
21
+ # "options(bitmapType='cairo')".to_R
22
+ # $curDyn.tmpl.format_output="html"
23
+ # $curDyn.tmpl.dyndoc_mode=:web # No command line
24
+ # #p [$curDyn.tmpl.dyndocMode,$curDyn.tmpl.fmtOutput]
25
+ # end
26
+
27
+ ## same as interactive-server
28
+ @tmpl_mngr=nil
29
+ @tmpl_filename=nil
30
+ init_dyndoc
31
+ end
32
+
33
+ def init_dyndoc
34
+ unless @tmpl_mngr
35
+ Dyndoc.cfg_dyn['dyndoc_session']=:interactive
36
+ @tmpl_mngr = Dyndoc::Ruby::TemplateManager.new({})
37
+ ##is it really well-suited for interactive mode???
38
+ end
39
+ reinit_dyndoc
40
+ end
41
+
42
+ def reinit_dyndoc
43
+ if @tmpl_mngr
44
+ @tmpl_mngr.init_doc({:format_output=> "html"})
45
+ @tmpl_mngr.require_dyndoc_libs("DyndocWebTools")
46
+ puts "InteractiveServer (re)initialized!\n"
47
+ @tmpl_mngr.as_default_tmpl_mngr! #=> Dyndoc.tmpl_mngr activated!
48
+ end
49
+ end
50
+
51
+ def process_dyndoc(content)
52
+ ##p [:process_dyndoc_content,content]
53
+ @content=@tmpl_mngr.parse(content)
54
+ ##Dyndoc.warn :content, @content
55
+ @tmpl_mngr.filterGlobal.envir["body.content"]=@content
56
+ if @tmpl_filename
57
+ @tmpl_mngr.filterGlobal.envir["_FILENAME_CURRENT_"]=@tmpl_filename.dup
58
+ @tmpl_mngr.filterGlobal.envir["_FILENAME_"]=@tmpl_filename.dup #register name of template!!!
59
+ @tmpl_mngr.filterGlobal.envir["_FILENAME_ORIG_"]=@tmpl_filename.dup #register name of template!!!
60
+ @tmpl_mngr.filterGlobal.envir["_PWD_"]=File.dirname(@tmpl_filename)
25
61
  end
62
+ return @content
26
63
  end
27
64
 
28
- # def init_dyndoc
29
- # unless @tmpl_mngr
30
- # Dyndoc.cfg_dyn['dyndoc_session']=:interactive
31
- # @tmpl_mngr = Dyndoc::Ruby::TemplateManager.new({})
32
- # ##is it really well-suited for interactive mode???
33
- # @tmpl_mngr.init_doc({:format_output=> "html"})
34
- # puts "InteractiveServer initialized!\n"
35
- # end
36
- # end
37
-
38
65
  def self.engine_initialized?
39
66
  defined? ::DynDoc
40
67
  end
@@ -47,11 +74,11 @@ module Tilt
47
74
 
48
75
 
49
76
  def prepare_output
50
- return $curDyn.tmpl_doc.make_content(data)
77
+ return process_dyndoc(data)
51
78
  end
52
-
79
+
53
80
  def evaluate(scope, locals, &block)
54
-
81
+
55
82
  #=begin
56
83
  #puts "locals";p locals
57
84
  ## first!!!!
@@ -104,9 +131,9 @@ module Tilt
104
131
  % Macro for http reference inclusion, per hypertex.
105
132
  \def\href#1#2{\special{html:<a href="#1">}#2\special{html:</a>}}
106
133
  \def\urlend#1{#1\endgroup}
107
- \def\url{\begingroup \tt
134
+ \def\url{\begingroup \tt
108
135
  \catcode`\_=13 % Don't know why this works.
109
- \catcode`\~=11 \catcode`\#=11 \catcode`\^=11
136
+ \catcode`\~=11 \catcode`\#=11 \catcode`\^=11
110
137
  \catcode`\$=11 \catcode`\&=11 \catcode`\%=11
111
138
  \urlend}% \url for plain \TeX.
112
139
  PREAMBLE
@@ -146,4 +173,4 @@ Tilt.register Tilt::DynTxtlTemplate, '_txtl.dyn'
146
173
  Tilt.register Tilt::DynTtmTemplate, '_ttm.dyn'
147
174
  Tilt.register Tilt::DynHtmlTemplate, '_html.dyn'
148
175
  Tilt.register Tilt::DynDocTemplate, '.dyn'
149
- #puts "dyn registered in tilt!"
176
+ #puts "dyn registered in tilt!"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dyndoc-ruby-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - CQLS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-07 00:00:00.000000000 Z
11
+ date: 2016-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: configliere