docubot 0.6 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,7 @@ require 'docubot'
9
9
 
10
10
  USAGE = <<ENDUSAGE
11
11
  Usage:
12
- docubot [-h] [create [-s shell] [-f]] directory [-w writer] [-o output_file] [-n]
12
+ docubot [-h] [create [-s shell] [-f]] directory [-w writer] [-o output_file] [-n] [-l log_file]
13
13
  ENDUSAGE
14
14
 
15
15
  HELP = <<ENDHELP
@@ -25,6 +25,7 @@ HELP = <<ENDHELP
25
25
  -o, --output The file or folder (depending on the writer) to create.
26
26
  [Default value depends on the writer chosen.]
27
27
  -n, --nopreview Disable automatic preview of .chm.
28
+ -l, --logfile Specify the filename to log to.
28
29
 
29
30
  ENDHELP
30
31
 
@@ -47,6 +48,8 @@ ARGV.each{ |arg|
47
48
  next_arg = :output
48
49
  when '-n','--nopreview'
49
50
  ARGS[:nopreview] = true
51
+ when '-l','--logfile'
52
+ next_arg = :logfile
50
53
  else
51
54
  if next_arg
52
55
  ARGS[next_arg] = arg
@@ -62,6 +65,12 @@ if ARGS[:help] or !ARGS[:directory]
62
65
  exit
63
66
  end
64
67
 
68
+ if ARGS[:logfile]
69
+ $stdout.reopen( ARGS[:logfile], "w" )
70
+ $stdout.sync = true
71
+ $stderr.reopen( $stdout )
72
+ end
73
+
65
74
  if ARGS[:create]
66
75
  require 'fileutils'
67
76
 
@@ -0,0 +1 @@
1
+ @"ruby.exe" "%~dpn0" %*
@@ -20,7 +20,7 @@ module FileUtils
20
20
  end
21
21
 
22
22
  module DocuBot
23
- VERSION = '0.6'
23
+ VERSION = '0.6.1'
24
24
  DIR = File.expand_path( File.dirname( __FILE__ ) )
25
25
 
26
26
  TEMPLATE_DIR = DIR / 'docubot/templates'
@@ -72,7 +72,7 @@ class DocuBot::CHMWriter < DocuBot::HTMLWriter
72
72
  lap = Time.now
73
73
 
74
74
  # Clean out the intermediary files
75
- FileUtils.rm( [ @hhc, @hhp, @hhk ] )
75
+ FileUtils.rm( [ @hhc, @hhp, @hhk ] ) unless ARGS[:logfile]
76
76
  FileUtils.rm_r( @html_path )
77
77
  puts "...%.2fs to clean up temporary files" % (Time.now-lap)
78
78
  lap = Time.now
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docubot
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.6"
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Kistner
@@ -73,6 +73,7 @@ extra_rdoc_files: []
73
73
 
74
74
  files:
75
75
  - bin/docubot
76
+ - bin/docubot.bat
76
77
  - lib/docubot/bundle.rb
77
78
  - lib/docubot/converter.rb
78
79
  - lib/docubot/converters/haml.rb
@@ -109,25 +110,6 @@ files:
109
110
  - lib/docubot/shells/docubot-help/index.txt
110
111
  - lib/docubot/shells/docubot-help/_glossary/Template.md
111
112
  - lib/docubot/shells/docubot-help/_static/glider.png
112
- - lib/docubot/shells/nvphysx/0_License.md
113
- - lib/docubot/shells/nvphysx/1_Getting_Started.haml
114
- - lib/docubot/shells/nvphysx/Appendix/Glossary.md
115
- - lib/docubot/shells/nvphysx/index.txt
116
- - lib/docubot/shells/nvphysx/_glossary/APEX.md
117
- - lib/docubot/shells/nvphysx/_glossary/NVIDIA.md
118
- - lib/docubot/shells/nvphysx/_glossary/PhysX.textile
119
- - lib/docubot/shells/nvphysx/_static/NVBadge_3D.png
120
- - lib/docubot/shells/nvphysx/_static/PhysXbyNV_Black.png
121
- - lib/docubot/shells/nvphysx/_templates/section.haml
122
- - lib/docubot/shells/nvphysx/_templates/top.haml
123
- - lib/docubot/shells/nvphysx/_templates/_root/bg_green_bar_revised.gif
124
- - lib/docubot/shells/nvphysx/_templates/_root/close.png
125
- - lib/docubot/shells/nvphysx/_templates/_root/common.css
126
- - lib/docubot/shells/nvphysx/_templates/_root/glossary.css
127
- - lib/docubot/shells/nvphysx/_templates/_root/glossary.js
128
- - lib/docubot/shells/nvphysx/_templates/_root/nvdevtools.js
129
- - lib/docubot/shells/nvphysx/_templates/_root/nvidia-logo.gif
130
- - lib/docubot/shells/nvphysx/_templates/_root/right-sidebar.png
131
113
  - lib/docubot/snippet.rb
132
114
  - lib/docubot/snippets/glossary.rb
133
115
  - lib/docubot/snippets/index_entries.rb
@@ -1,3 +0,0 @@
1
- style: license nosidebar
2
- +++
3
- ![NVIDIA 3D Badge](_static/NVBadge_3D.png)
@@ -1,51 +0,0 @@
1
- keywords: Basics
2
- toc : welcome authoring glossary index
3
- +++
4
- %h2#welcome Welcome to DocuBot for NVIDIA PhysX
5
- %p.sidebar
6
- %img(width='150' src='_static/NVBadge_3D.png')
7
- NVIDIA 3D Badge
8
- %span#out
9
- :textile
10
- This template shows the standard page style, which has a 350px sidebar on the right for including
11
- images related to the text.
12
-
13
- To put images (with an optional description) in the sidebar, place them inside a paragraph with
14
- the CSS class @sidebar@. They will float to the right next to your content.
15
-
16
- Each header will--by default--wait to begin until all images on the right have finished.
17
-
18
- %h2#authoring Authoring Content
19
- <p class="sidebar"><img src="_static/PhysXbyNV_Black.png" width="180"></p>
20
- :markdown
21
- The headers on each page should start at `h2` (not `h1`); `h1` is used for the title at the top of the page.
22
-
23
- As shown in this template, if you apply HTML `id` attributes to the headers (or any other HTML element), and list those
24
- identifiers under a toc entry at the top of the page, the Table of Contents will include sub-links to the headings.
25
-
26
- %h2#glossary Glossary Entries
27
- %p
28
- To create a reference to a glossary term, surround it in double dollar signs.
29
- For example, $$NVIDIA$$ makes $$PhysX$$ and $$APEX Libraries:APEX$$.
30
- %p
31
- As shown in the APEX link above, you can have the glossary text be different from the term it links to
32
- by putting the words you want first, followed by a colon, followed by the actual glossary term to link to.
33
- %p
34
- This works in all markups. (The processing happens after the markup is converted to HTML.)
35
-
36
- %h2#index Managing the Index
37
- %p The index is automatically populated with the text from headings and defintions on the pages.
38
- %p To add additional terms, you can:
39
- %ul
40
- %li
41
- Use a <code>keywords</code> section at the top of the page with comma-delimited keywords or
42
- phrases that you want the index to associate with the current page.
43
- %li
44
- :markdown
45
- Put two `@` signs around any word or phrase in your text that you wanted added to the index.
46
-
47
- For example, imagine that this page talked about @@sexy code@@; the index now knows about that.
48
-
49
- Note that this syntax doesn't currently work with textile, because it uses single @ characters to
50
- denote code. This will be fixed in the future (by processing glossary and index snippets before markup).
51
-
@@ -1,7 +0,0 @@
1
- template: glossary
2
- +++
3
- This page uses the glossary template, which has the smarts to generate HTML
4
- from the glossary terms defined in the `_glossary` directory.
5
-
6
- The Glossary template doesn't actually use the `contents` of this page, so
7
- it doesn't matter what I put here.
@@ -1 +0,0 @@
1
- A multi-platform, scalable dynamics framework.
@@ -1 +0,0 @@
1
- NVIDIA (Nasdaq: NVDA) is the world leader in visual computing technologies and the inventor of the GPU, a high-performance processor which generates breathtaking, interactive graphics on workstations, personal computers, game consoles, and mobile devices.
@@ -1,3 +0,0 @@
1
- note: Due to a bug in the Markdown converter with unicode characters, textile must be used for pages with unicode.
2
- +++
3
- NVIDIA® PhysX® is a powerful physics engine enabling real-time physics in leading edge PC games. PhysX software is widely adopted by over 150 games and is used by more than 10,000 developers. PhysX is optimized for hardware acceleration by massively parallel processors. GeForce GPUs with PhysX provide an exponential increase in physics processing power taking gaming physics to the next level.
@@ -1,269 +0,0 @@
1
- html, body
2
- {
3
- margin:0;
4
- padding:0;
5
- font-family: Verdana, Arial, Helvetica, sans-serif;
6
- font-size: 1.1em;
7
- font-style: normal;
8
- font-weight: normal;
9
- color: black;
10
- }
11
- body{
12
- background:white url(right-sidebar.png) repeat-y top right;
13
- }
14
-
15
- body.nosidebar{
16
- background-image:none;
17
- }
18
-
19
- #breadcrumb
20
- {
21
- margin:0;
22
- background:black url(nvidia-logo.gif) no-repeat left center;
23
- padding-left:56px;
24
- font-family: 'Arial', sans-serif;
25
- font-size:14px; font-weight:bold;
26
- white-space:nowrap;
27
- height:40px; line-height:40px; color:white; overflow:hidden;
28
- color:#fff;
29
- }
30
-
31
- #breadcrumb a
32
- {
33
- color:#fff; text-decoration:none
34
- }
35
-
36
- #breadcrumb a:hover
37
- {
38
- color:#74b71b
39
- }
40
- #breadcrumb .sep
41
- {
42
- color:#999; font-weight:normal; padding:0 0.2em
43
- }
44
-
45
- div#mainbody
46
- {
47
- font-size:8pt;
48
- margin: 0 350px 0 10px;
49
- padding: 0;
50
- padding-bottom:30em;
51
- }
52
-
53
- body.nosidebar div#mainbody
54
- {
55
- margin-right:0px;
56
- }
57
-
58
- div#mainbody
59
- {
60
- padding-bottom:2em;
61
- }
62
-
63
- div.section
64
- {
65
- margin-left:1em
66
- }
67
-
68
- a:link, a:visited { white-space:nowrap; color:#6e8e34 }
69
- a:hover { color:#74b71b }
70
-
71
- a.hsglossaryreference {
72
- color:#000; cursor:help; border-color:#666 ! important
73
- }
74
- a.hsglossaryreference:hover { border-color:#74b71b ! important }
75
-
76
- ul { margin-left:2em; clear:left }
77
-
78
- strong { white-space:nowrap }
79
-
80
- h1 {
81
- margin:0;
82
- padding-left:14px;
83
- padding-right:50px;
84
- font-family: 'Arial', sans-serif;
85
- white-space:nowrap;
86
- font-size:18px;
87
- background:#6eb103 url(bg_green_bar_revised.gif) repeat-x;
88
- height:30px; line-height:30px; color:white; overflow:hidden;
89
- border-bottom:1px solid #999
90
- }
91
-
92
- h2
93
- {
94
- clear:both;
95
- margin-top:4em;
96
- }
97
- h2, h3, h4
98
- {
99
- border-bottom:1px solid #dddddd;
100
- font-size:100%;
101
- margin-bottom:0.5em;
102
- }
103
- h2.first-child, h3.first-child, h4.first-child
104
- {
105
- margin-top:0
106
- }
107
- h3, h4
108
- {
109
- margin-top:2em;
110
- color:#666;
111
- }
112
-
113
- p, li, fieldset, dl
114
- {
115
- margin:0;
116
- padding:0;
117
- padding-right:1em;
118
- margin-bottom:1em
119
- }
120
-
121
- .TODO
122
- {
123
- font-family: courier new;
124
- color: #ff80ff;
125
- font-size: 9pt;
126
- font-weight: bold
127
- }
128
-
129
- .sidebar
130
- {
131
- text-align: center;
132
- width: 350px;
133
- font-family: tahoma,sans-serif;
134
- float: right;
135
- clear: right;
136
- color: #665555;
137
- margin:0;
138
- padding:0;
139
- margin-right: -350px;
140
- margin-left: 1em;
141
- font-size: 7pt;
142
- font-weight: bold;
143
- }
144
- .sidebar img
145
- {
146
- display:block;
147
- margin:0 auto;
148
- margin-bottom:0.5em;
149
- }
150
-
151
- img.floatcap
152
- {
153
- float:left;
154
- margin-right:1em;
155
- margin-bottom:1em;
156
- margin-top:2px;
157
- }
158
-
159
- .moreinfo
160
- {
161
- font-style:italic;
162
- color:#666;
163
- }
164
-
165
- .moreinfo a
166
- {
167
- color: #6e8e34
168
- }
169
- .moreinfo a:hover
170
- {
171
- color: #76b900
172
- }
173
-
174
- p.aside
175
- {
176
- margin-left:4em
177
- }
178
-
179
- div#nonscrollingpagefooter
180
- {
181
- background:white;
182
- margin-bottom:0;
183
- margin-top:4em;
184
- clear:both;
185
- }
186
-
187
- div.tryit
188
- {
189
- border:1px solid #76b900;
190
- background:#eef6df;
191
- margin:2em 50px;
192
- padding:0;
193
- }
194
- div.tryit h3
195
- {
196
- background:#76b900;
197
- color:white;
198
- font-style:normal;
199
- padding:2px 0.5em;
200
- margin:0;
201
- margin-bottom:1em
202
- }
203
- div.tryit img.preview
204
- {
205
- float:right;
206
- width:180px;
207
- margin:-1em 0 1em 1em;
208
- }
209
- div.tryit ol
210
- {
211
- margin:1em;
212
- padding:0;
213
- }
214
- div.tryit li
215
- {
216
- margin:0;
217
- margin-left:3em;
218
- margin-bottom:1em
219
- }
220
- div.tryit .results
221
- {
222
- font-style:italic;
223
- color:#666
224
- }
225
-
226
- sup
227
- {
228
- font-size:85%
229
- }
230
-
231
- #known-issues h3 { font-style:normal; margin-bottom:0.2em; margin-top:3em; margin-right:1em }
232
- #known-issues h3 span.issue_num { margin-left:1.5em; font-weight:normal; font-size:85%; color:#666; line-height:1.2em; float:right; margin-top:-1.2em; margin-right:1em }
233
- #known-issues div.description { margin-bottom:2em }
234
- #known-issues p.workaround { margin-left:2em }
235
- #known-issues p.workaround strong { color:#666 }
236
-
237
- #pagebody
238
- {
239
- font-size: 70%;
240
- margin-bottom: 0;
241
- margin-top: 1em;
242
- padding-bottom:10em;
243
- }
244
-
245
- #pagebody h1 {
246
- background:#666; color:#ccc; border:1px solid #333; font-size:100%; padding:0.2em 1em; line-height:1em ! important;
247
- height:auto ! important; margin-top:1.5em
248
- }
249
-
250
- fieldset { margin-bottom:1.5em; margin-left:1em; padding:0.5em; border-right:none; }
251
- legend { font-weight:bold; color:#666 }
252
- fieldset dl { margin:0 1em }
253
- fieldset p { margin:1em 2em }
254
- dl.section { margin-left:1em }
255
- dt { font-weight:bold; font-style:normal; margin-top:0.8em }
256
- dd { margin-bottom:0.8em; margin-left:0; }
257
- dd p { margin-bottom:0.4em }
258
- dd ul { margin-left:3em; margin-top:0.4em; }
259
- dd ul li { margin-bottom:0 }
260
-
261
- div#pagefooter {
262
- margin-top:10em ! important; margin-bottom:1em ! important; width:25em; overflow:hidden; white-space:nowrap;
263
- background:#eee; border:1px solid #ccc; border-left:none; color:#999; font-size:7pt ! important; padding:0.1em 1em
264
- }
265
-
266
- ul.compact li { margin-bottom:0 }
267
- body.release-notes h3 { margin-left:2em }
268
- body.release-notes ul { margin-left:4em; margin-top:0; }
269
- body.release-notes li { margin-bottom:0; margin-top:0; padding:0 ! important; margin-left:1em; line-height:105%; }
@@ -1,5 +0,0 @@
1
- #glossary-box { display:none; position:absolute; width:30%; background:#e0efcc; border:1px solid #82a851; padding:0.5em 0.9em; font-size:9pt; font-family:Calibri, Tahoma; }
2
- #glossary-close { width:24px; height:24px; background:url(close.png) no-repeat; position:absolute; right:-12px; top:-12px; cursor:pointer; }
3
- #glossary-box * { margin:0 }
4
- span.glossary { color:#36401C; border-bottom:1px dashed #6e8e34; cursor:help; }
5
- span.glossary-missing { border-bottom:1px dotted #900 }
@@ -1,34 +0,0 @@
1
- function glossaryClick(evt){
2
- if (!evt) evt=event;
3
- var target = evt.target || evt.srcElement;
4
- var term = target.getAttribute('term') || target.innerHTML;
5
- var box = document.getElementById('glossary-box');
6
- box.style.display = 'block';
7
- var scroll = (document.documentElement.scrollTop || document.body.scrollTop )*1;
8
- box.style.left = (evt.clientX+5) + 'px';
9
- box.style.top = (evt.clientY+5) + scroll + 'px';
10
-
11
- var html = $glossaryTerms[term.toLowerCase()];
12
- document.getElementById('glossary-defn').innerHTML = html;
13
- }
14
-
15
- handleEvent(window,'load',function(){
16
- for ( var spans=document.getElementsByTagName('span'),i=spans.length-1; i>=0; --i ){
17
- var span = spans[i];
18
- if (cssClass.has(span,'glossary')){
19
- var term = span.getAttribute('term') || span.innerHTML;
20
- if ($glossaryTerms[term.toLowerCase()]){
21
- handleEvent(span,'click',glossaryClick);
22
- }else{
23
- cssClass.kill(span,'glossary');
24
- cssClass.add(span,'glossary-missing');
25
- }
26
-
27
- }
28
- }
29
- var box = document.getElementById('glossary-box');
30
- var close = document.getElementById('glossary-close');
31
- handleEvent( close, 'click', function(){
32
- box.style.display = 'none';
33
- });
34
- });
@@ -1,31 +0,0 @@
1
- function handleEvent(obj,eventName,callback,useCapture){
2
- return obj.addEventListener ? obj.addEventListener(eventName,callback,useCapture||false) : obj.attachEvent("on"+eventName,callback);
3
- }
4
-
5
- cssClass = {
6
- _killCache : {},
7
- _findCache : {},
8
- add : function cssClassAdd(obj,className){
9
- this.kill(obj,className);
10
- obj.className+=(obj.className.length?' ':'')+className;
11
- },
12
- kill : function cssClassKill(obj,className){
13
- var re = this._killCache[className] || (this._killCache[className]=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)','g') );
14
- obj.className = obj.className.replace(re,'');
15
- },
16
- has : function cssClassHas(obj,className){
17
- var re = this._findCache[className] || (this._findCache[className]=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)') );
18
- return re.test( obj.className );
19
- }
20
- };
21
- function isFirstChild(node){
22
- return node.parentNode.firstChild==node;
23
- }
24
- handleEvent(window,'load',function(){
25
- // Add first-child CSS class since :first-child pseudo-class doesn't work for old IE
26
- for ( var tags=['h2','h3','p','ul','dl','ol'],i=tags.length-1; i>=0; --i ){
27
- for ( var all=document.getElementsByTagName(tags[i]),j=all.length-1; j>=0; --j ){
28
- if (isFirstChild(all[j])) cssClass.add(all[j],'first-child');
29
- }
30
- }
31
- });
@@ -1,9 +0,0 @@
1
- %p The following pages are part of <em>#{page.title}</em>:
2
- %ul#children
3
- - page.pages.each do |child_page|
4
- %li
5
- %a{ :href=>root/child_page.html_path }= child_page.title
6
- - if child_page.summary?
7
- = ": #{child_page.summary}"
8
- - unless contents.nil? or contents.empty?
9
- #good-info= contents
@@ -1,28 +0,0 @@
1
- !!! Strict
2
- %html
3
- %head
4
- %meta(http-equiv='Content-Type' content='text/html; charset=utf-8')
5
- %link{:rel=>'stylesheet', :type=>'text/css', :href=>"#{root}common.css", :media=>'all'}
6
- %link{:rel=>'stylesheet', :type=>'text/css', :href=>"#{root}glossary.css", :media=>'all'}
7
- %script{:type=>'text/javascript', :src=>"#{root}nvdevtools.js"}
8
- %script{:type=>'text/javascript', :src=>"#{root}glossary-terms.js"}
9
- %script{:type=>'text/javascript', :src=>"#{root}glossary.js"}
10
- %title= page.title
11
- %body{ :class=>page.style }
12
- #pagetop
13
- #breadcrumb
14
- - toc = page.ancestors.first # The TOC has no page to link to
15
- = toc.short_title || toc.title
16
- %span.sep &gt;
17
- - page.ancestors[1..-1].each do |dad|
18
- %a{ :href=>root/dad.html_path }= dad.short_title || dad.title
19
- %span.sep &gt;
20
- = page.title
21
- %h1#title= page.title
22
- #pagebody
23
- #glossary-box
24
- #glossary-close
25
- #glossary-defn
26
- #mainbody= contents
27
- #pagefooter
28
- Copyright ©#{Time.now.year}#{ " #{global.company}" if global.company }.
@@ -1,5 +0,0 @@
1
- company : NVIDIA Corporation
2
- title : NVIDIA Reference Manual
3
- short_title: NVIDIA Reference
4
- default : Getting Started
5
- +++