kramdown-asciidoc 1.0.0.alpha.1 → 1.0.0.alpha.2

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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.adoc +33 -0
  3. data/README.adoc +1 -1
  4. data/lib/kramdown-asciidoc/converter.rb +96 -32
  5. data/lib/kramdown-asciidoc/version.rb +1 -1
  6. data/spec/converter_spec.rb +24 -1
  7. data/spec/fixtures/a/containing-inline-image.adoc +5 -0
  8. data/spec/fixtures/a/containing-inline-image.md +5 -0
  9. data/spec/fixtures/a/double-underscore-in-url.adoc +1 -0
  10. data/spec/fixtures/a/double-underscore-in-url.md +1 -0
  11. data/spec/fixtures/codespan/literal.adoc +2 -0
  12. data/spec/fixtures/codespan/literal.md +2 -0
  13. data/spec/fixtures/entity/reverse.adoc +2 -0
  14. data/spec/fixtures/entity/reverse.md +2 -0
  15. data/spec/fixtures/heading/block-title.adoc +10 -0
  16. data/spec/fixtures/heading/block-title.md +9 -0
  17. data/spec/fixtures/heading/not-block-title.adoc +8 -0
  18. data/spec/fixtures/heading/not-block-title.md +7 -0
  19. data/spec/fixtures/html_element/admonition.adoc +5 -0
  20. data/spec/fixtures/html_element/admonition.md +7 -0
  21. data/spec/fixtures/html_element/img-with-alt-and-width.adoc +1 -0
  22. data/spec/fixtures/html_element/img-with-alt-and-width.md +1 -0
  23. data/spec/fixtures/html_element/img-with-width.adoc +1 -0
  24. data/spec/fixtures/html_element/img-with-width.md +1 -0
  25. data/spec/fixtures/html_element/img.adoc +2 -0
  26. data/spec/fixtures/html_element/img.md +1 -0
  27. data/spec/fixtures/table/cell-with-pipe.adoc +5 -0
  28. data/spec/fixtures/table/cell-with-pipe.md +1 -0
  29. data/spec/fixtures/table/single-column-with-header.adoc +6 -0
  30. data/spec/fixtures/table/single-column-with-header.md +4 -0
  31. data/spec/fixtures/table/single-column-without-header.adoc +4 -0
  32. data/spec/fixtures/table/single-column-without-header.md +2 -0
  33. data/spec/fixtures/text/caret.adoc +1 -0
  34. data/spec/fixtures/text/caret.md +1 -0
  35. data/spec/fixtures/xml_comment/above-header.adoc +13 -0
  36. data/spec/fixtures/xml_comment/above-header.md +16 -0
  37. metadata +54 -6
  38. data/spec/fixtures/codeblock/fenced/bash-to-console.adoc +0 -4
  39. data/spec/fixtures/codeblock/fenced/bash-to-console.md +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70b7c1c3b371ac7e88456a531413b89ccb7186f706f44ad33abedd96ce6ef52d
4
- data.tar.gz: b8ee1cb2365ff90ad26abb4528dad929cb75034297bd2e590c48453c2a3f61bc
3
+ metadata.gz: d272b7da83b441ebdb647887c7d9355fb05eba02b5dd3f01094bc7b089fe2a34
4
+ data.tar.gz: 58f6c5b345bd05e72c06a571b72cdd829766a87a33fa87b3ae0f0d7adab3b3b7
5
5
  SHA512:
6
- metadata.gz: b2cf8e0cf5ef344ee31621f1b05e86e9504c5392adbc79b443db9594764bf51d39371cb2db57a36d7bb59ed4b0079a0eec0519c95d78cfb615c4cf00d8680830
7
- data.tar.gz: 1bc00c04fd46be08e697a562eeea7f583a0e6afc3949a9c1bc937f1509d0605c07b367dec9fc2c578a8ff31f4d438349c5832b72799612f18b53eb9306549ce6
6
+ metadata.gz: e3f41c1b6a204e64ea4f4baf582910a0b06004dd1fe11676f6b2cb47cca317214c359a86991ba24c133aa18764df6ab1a4b06e9e107eeb31f0085d37d30e3719
7
+ data.tar.gz: 362e0cb506477aae3cf22b57b2be596b573259e6da83e20a0a9cfc62e0c7e63d830760975b2ddd72f360ffb59b07e0e0245dc779289153e17ef5c4af931fb5b7
data/CHANGELOG.adoc CHANGED
@@ -5,6 +5,39 @@
5
5
  This document provides a high-level view of the changes to {project-name} by release.
6
6
  For a detailed view of what has changed, refer to the {uri-repo}/commits/master[commit history] on GitHub.
7
7
 
8
+ == 1.0.0.alpha.2 (2018-05-24) - @mojavelinux
9
+
10
+ === Added
11
+
12
+ * automatically coerce level 5 heading above codeblock to block title
13
+ * convert HTML-based admonition blocks
14
+ * drop HTML div element if enclosing an image
15
+ * transfer id and class/role attributes to block image
16
+ * pass through width attribute to image if specified on HTML img element
17
+
18
+ === Changed
19
+
20
+ * don't modify AST when converting
21
+ * transfer comments above document title to document header
22
+ * only process link as image with link if only child
23
+ * escape closing square bracket in contents of link
24
+ * don't add cols attribute to table if table only has a single column
25
+ * don't add blank line between rows if table only has a single column
26
+ * expand \| to |
27
+ * escape pipe in table cell
28
+ * replace ^ with \{caret} in normal text
29
+ * replace double underscore in URL with %5F%5F
30
+ * don't rewrite bash source language as console
31
+
32
+ === Details
33
+
34
+ {uri-repo}/releases/tag/v1.0.0.alpha.2[git tag] |
35
+ {uri-repo}/compare/v1.0.0.alpha.1...v1.0.0.alpha.2[full diff]
36
+
8
37
  == 1.0.0.alpha.1 (2018-05-22) - @mojavelinux
9
38
 
10
39
  Initial release.
40
+
41
+ === Details
42
+
43
+ {uri-repo}/releases/tag/v1.0.0.alpha.1[git tag]
data/README.adoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = {project-name} (Markdown to AsciiDoc)
2
2
  Dan Allen <https://github.com/mojavelinux>
3
- v1.0.0.alpha.1, 2018-05-22
3
+ v1.0.0.alpha.2, 2018-05-24
4
4
  // Aliases:
5
5
  :project-name: Kramdown AsciiDoc
6
6
  :project-handle: kramdown-asciidoc
@@ -27,7 +27,7 @@ module Kramdown; module AsciiDoc
27
27
  while (line = lines.shift) && line.chomp != '---'
28
28
  front_matter << line
29
29
  end
30
- lines.shift while (line = lines[0]) && line.chomp.empty?
30
+ lines.shift while (line = lines[0]) && line == ?\n
31
31
  (::YAML.load front_matter.join).each do |key, val|
32
32
  case key
33
33
  when 'title'
@@ -45,7 +45,7 @@ module Kramdown; module AsciiDoc
45
45
  end
46
46
 
47
47
  class Converter < ::Kramdown::Converter::Base
48
- RESOLVE_ENTITY_TABLE = %w(lt gt).map {|name| Utils::Entities.entity name }.map {|obj| [obj, obj.char] }.to_h
48
+ RESOLVE_ENTITY_TABLE = { 60 => '<', 62 => '>', 124 => '|' }
49
49
  ADMON_LABELS = %w(Note Tip Caution Warning Important Attention).map {|l| [l, l] }.to_h
50
50
  ADMON_MARKERS = ADMON_LABELS.map {|l, _| %(#{l}: ) }
51
51
  ADMON_FORMATTED_MARKERS = ADMON_LABELS.map {|l, _| [%(#{l}:), l] }.to_h
@@ -98,6 +98,7 @@ module Kramdown; module AsciiDoc
98
98
  end
99
99
 
100
100
  def convert_root el, opts
101
+ el = extract_prologue el, opts
101
102
  body = %(#{inner el, (opts.merge rstrip: true)}#{LF})
102
103
  @attributes.each {|k, v| @header << %(:#{k}: #{v}) } unless @attributes.empty?
103
104
  @header.empty? ? body : %(#{@header.join LF}#{body == LF ? '' : LFx2}#{body})
@@ -111,12 +112,19 @@ module Kramdown; module AsciiDoc
111
112
  result = []
112
113
  style = []
113
114
  level = el.options[:level]
114
- style << 'discrete' if (discrete = @last_heading_level && level > @last_heading_level + 1)
115
+ if (discrete = @last_heading_level && level > @last_heading_level + 1)
116
+ # TODO make block title promotion an option (allow certain levels and titles)
117
+ #if ((raw_text = el.options[:raw_text]) == 'Example' || raw_text == 'Examples') &&
118
+ if level == 5 && (next_2_siblings = (siblings = opts[:parent].children).slice (siblings.index el) + 1, 2) &&
119
+ next_2_siblings.any? {|sibling| sibling.type == :codeblock }
120
+ return %(.#{inner el, opts}#{LF})
121
+ end
122
+ style << 'discrete'
123
+ end
115
124
  if (id = el.attr['id'])
116
125
  style << %(##{id})
117
126
  elsif (child_i = el.children[0] || VoidElement).type == :html_element && child_i.value == 'a' && (id = child_i.attr['id'])
118
- el.children.shift
119
- el.children.unshift(*child_i.children) unless child_i.children.empty?
127
+ el = clone el, children: child_i.children + (el.children.drop 1)
120
128
  style << %(##{id})
121
129
  elsif (role = el.attr['class'])
122
130
  style << %(.#{role.tr ' ', '.'})
@@ -125,7 +133,7 @@ module Kramdown; module AsciiDoc
125
133
  result << %(#{'=' * level} #{inner el, opts})
126
134
  @last_heading_level = level unless discrete
127
135
  if level == 1 && opts[:result].empty?
128
- @header = result
136
+ @header += result
129
137
  nil
130
138
  else
131
139
  @attributes['doctype'] = 'book' if level == 1
@@ -149,15 +157,16 @@ module Kramdown; module AsciiDoc
149
157
  # NOTE detect plain admonition marker (e.g, Note: ...)
150
158
  if (child_i = el.children[0] || VoidElement).type == :text && (child_i_text = child_i.value).start_with?(*ADMON_MARKERS)
151
159
  marker, child_i_text = child_i_text.split ': ', 2
152
- child_i.value = %(#{ADMON_TYPE_MAP[marker]}: #{child_i_text})
160
+ child_i = clone child_i, value: %(#{ADMON_TYPE_MAP[marker]}: #{child_i_text})
161
+ el = clone el, children: [child_i] + (el.children.drop 1)
153
162
  contents = inner el, opts
154
163
  # NOTE detect formatted admonition marker (e.g., *Note:* ...)
155
164
  elsif (child_i.type == :strong || child_i.type == :em) &&
156
165
  (marker_el = child_i.children[0]) && ((marker = ADMON_FORMATTED_MARKERS[marker_el.value]) ||
157
166
  ((marker = ADMON_LABELS[marker_el.value]) && (child_ii = el.children[1] || VoidElement).type == :text &&
158
167
  ((child_ii_text = child_ii.value).start_with? ': ')))
159
- el.children.shift
160
- child_ii.value = child_ii_text.slice 1, child_ii_text.length if child_ii
168
+ el = clone el, children: (el.children.drop 1)
169
+ el.children[0] = clone child_ii, value: (child_ii_text.slice 1, child_ii_text.length) if child_ii
161
170
  contents = %(#{ADMON_TYPE_MAP[marker]}:#{inner el, opts})
162
171
  else
163
172
  contents = inner el, opts
@@ -198,11 +207,11 @@ module Kramdown; module AsciiDoc
198
207
  contents = el.value.rstrip
199
208
  if (lang = el.attr['class'])
200
209
  lang = lang.slice 9, lang.length if lang.start_with? 'language-'
201
- #lang = 'console' if lang == 'bash' && (contents.start_with? '$ ')
202
- lang = 'console' if lang == 'bash'
210
+ # TODO remap lang if requested
203
211
  result << %([source,#{lang}])
204
212
  end
205
213
  if !lang && (contents.start_with? '$ ')
214
+ # QUESTION should we make these a source,console block?
206
215
  if contents.include? LFx2
207
216
  result << '....'
208
217
  result << contents
@@ -252,18 +261,22 @@ module Kramdown; module AsciiDoc
252
261
  container.children.each do |row|
253
262
  row_buf = []
254
263
  row.children.each do |cell|
255
- row_buf << %(| #{inner cell, opts})
264
+ cell_contents = inner cell, opts
265
+ cell_contents = cell_contents.gsub '|', '\|' if cell_contents.include? '|'
266
+ row_buf << %(| #{cell_contents})
256
267
  end
257
- cols = row_buf.size unless cols
268
+ cols ||= row_buf.size
258
269
  if container.type == :thead
259
270
  head = true
260
271
  row_buf = [row_buf * ' ']
272
+ row_buf << ''
273
+ elsif cols > 1
274
+ row_buf << ''
261
275
  end
262
- row_buf << ''
263
276
  table_buf.concat row_buf
264
277
  end
265
278
  end
266
- table_buf.unshift %([cols=#{cols}*]) unless head
279
+ table_buf.unshift %([cols=#{cols}*]) unless head || cols < 2
267
280
  table_buf.pop if table_buf[-1] == ''
268
281
  table_buf << '|==='
269
282
  %(#{table_buf * LF}#{LFx2})
@@ -274,15 +287,16 @@ module Kramdown; module AsciiDoc
274
287
  end
275
288
 
276
289
  def convert_text el, opts
277
- if (result = el.value).include? '++'
290
+ if (text = el.value).include? '++'
278
291
  @attributes['pp'] = '{plus}{plus}'
279
- result = result.gsub '++', '{pp}'
292
+ text = text.gsub '++', '{pp}'
280
293
  end
281
- result = result.gsub '<=', '\\<=' if result.include? '<='
282
- if result.ascii_only?
283
- result
294
+ text = text.gsub '^', '{caret}' if (text.include? '^') && text != '^'
295
+ text = text.gsub '<=', '\<=' if text.include? '<='
296
+ if text.ascii_only?
297
+ text
284
298
  else
285
- (result.gsub ApostropheRx, ?').gsub TypographicSymbolRx, TYPOGRAPHIC_SYMBOL_TO_MARKUP
299
+ (text.gsub ApostropheRx, ?').gsub TypographicSymbolRx, TYPOGRAPHIC_SYMBOL_TO_MARKUP
286
300
  end
287
301
  end
288
302
 
@@ -316,34 +330,56 @@ module Kramdown; module AsciiDoc
316
330
  end
317
331
 
318
332
  def convert_entity el, opts
319
- RESOLVE_ENTITY_TABLE[el.value] || el.options[:original]
333
+ RESOLVE_ENTITY_TABLE[el.value.code_point] || el.options[:original]
320
334
  end
321
335
 
322
336
  def convert_a el, opts
323
337
  if (url = el.attr['href']).start_with? '#'
324
338
  %(<<#{url.slice 1, url.length},#{inner el, opts}>>)
325
339
  elsif url.start_with? 'https://', 'http://'
326
- if (child_i = el.children[0] || VoidElement).type == :img
340
+ if (children = el.children).size == 1 && (child_i = el.children[0]).type == :img
327
341
  convert_img child_i, parent: opts[:parent], index: 0, url: url
328
342
  else
329
- ((contents = inner el, opts).chomp '/') == (url.chomp '/') ? url : %(#{url}[#{contents}])
343
+ bare = ((contents = inner el, opts).chomp '/') == (url.chomp '/')
344
+ url = url.gsub '__', '%5F%5F' if (url.include? '__')
345
+ bare ? url : %(#{url}[#{contents.gsub ']', '\]'}])
330
346
  end
331
347
  elsif url.end_with? '.md'
332
- %(xref:#{url.slice 0, url.length - 3}.adoc[#{inner el, opts}])
348
+ %(xref:#{url.slice 0, url.length - 3}.adoc[#{(inner el, opts).gsub ']', '\]'}])
333
349
  else
334
- %(link:#{url}[#{inner el, opts}])
350
+ %(link:#{url}[#{(inner el, opts).gsub ']', '\]'}])
335
351
  end
336
352
  end
337
353
 
338
354
  def convert_img el, opts
339
- prefix = !(parent = opts[:parent]) || parent.type == :p && parent.children.size == 1 ? 'image::' : 'image:'
340
- alt_text = el.attr['alt']
341
- link_attr = (url = opts[:url]) ? %(#{alt_text.empty? ? '' : ','}link=#{url}) : ''
355
+ if !(parent = opts[:parent]) || parent.type == :p && parent.children.size == 1
356
+ style = []
357
+ if (id = el.attr['id'])
358
+ style << %(##{id})
359
+ end
360
+ if (role = el.attr['class'])
361
+ style << %(.#{role.tr ' ', '.'})
362
+ end
363
+ macro_prefix = style.empty? ? 'image::' : ([%([#{style.join}]), 'image::'].join LF)
364
+ else
365
+ macro_prefix = 'image:'
366
+ end
367
+ macro_attrs = []
368
+ if (alt_text = el.attr['alt'])
369
+ macro_attrs << alt_text unless alt_text.empty?
370
+ end
371
+ if (width = el.attr['width'])
372
+ macro_attrs << '' if macro_attrs.empty?
373
+ macro_attrs << width
374
+ end
375
+ if (url = opts[:url])
376
+ macro_attrs << %(link=#{url})
377
+ end
342
378
  src = el.attr['src']
343
379
  if (imagesdir = @imagesdir) && (src.start_with? %(#{imagesdir}/))
344
380
  src = src.slice imagesdir.length + 1, src.length
345
381
  end
346
- %(#{prefix}#{src}[#{alt_text}#{link_attr}])
382
+ %(#{macro_prefix}#{src}[#{macro_attrs.join ','}])
347
383
  end
348
384
 
349
385
  # NOTE leave enabled so we can down-convert mdash to --
@@ -352,9 +388,20 @@ module Kramdown; module AsciiDoc
352
388
  end
353
389
 
354
390
  def convert_html_element el, opts
391
+ if (tagname = el.value) == 'div' && (child_i = el.children[0]) && child_i.options[:transparent] &&
392
+ (child_i_i = child_i.children[0])
393
+ if child_i_i.type == :img
394
+ return convert_img child_i_i, (opts.merge parent: child_i, index: 0) if child_i.children.size == 1
395
+ elsif child_i_i.value == 'span' && ((role = el.attr['class'] || '').start_with? 'note') &&
396
+ child_i_i.attr['class'] == 'notetitle'
397
+ marker = ADMON_FORMATTED_MARKERS[(child_i_i.children[0] || VoidElement).value] || 'Note'
398
+ (el = child_i.dup).children = el.children.drop 1
399
+ return %(#{ADMON_TYPE_MAP[marker]}:#{inner el, opts}#{LFx2})
400
+ end
401
+ end
355
402
  contents = inner el, (opts.merge rstrip: el.options[:category] == :block)
356
403
  attrs = (attrs = el.attr).empty? ? '' : attrs.map {|k, v| %( #{k}="#{v}") }.join
357
- case (tagname = el.value)
404
+ case tagname
358
405
  when 'sup'
359
406
  %(^#{contents}^)
360
407
  when 'sub'
@@ -397,7 +444,16 @@ module Kramdown; module AsciiDoc
397
444
  end
398
445
  end
399
446
 
400
- def inner el, opts
447
+ def extract_prologue el, opts
448
+ if (child_i = (children = el.children)[0] || VoidElement).type == :xml_comment
449
+ (prologue_el = el.dup).children = children.take_while {|child| child.type == :xml_comment || child.type == :blank }
450
+ (el = el.dup).children = children.drop prologue_el.children.size
451
+ @header += [%(#{inner prologue_el, (opts.merge rstrip: true)})]
452
+ end
453
+ el
454
+ end
455
+
456
+ def inner el, opts = {}
401
457
  rstrip = opts.delete :rstrip
402
458
  result = []
403
459
  prev = nil
@@ -407,6 +463,14 @@ module Kramdown; module AsciiDoc
407
463
  end
408
464
  rstrip ? result.join.rstrip : result.join
409
465
  end
466
+
467
+ def clone el, properties = {}
468
+ el = el.dup
469
+ properties.each do |name, value|
470
+ el.send %(#{name}=).to_sym, value
471
+ end
472
+ el
473
+ end
410
474
  end
411
475
  end; end
412
476
 
@@ -1,3 +1,3 @@
1
1
  module Kramdown; module AsciiDoc
2
- VERSION = '1.0.0.alpha.1'
2
+ VERSION = '1.0.0.alpha.2'
3
3
  end; end
@@ -4,16 +4,39 @@ describe Kramdown::AsciiDoc::Converter do
4
4
  let(:opts) { Kramdown::AsciiDoc::DEFAULT_PARSER_OPTS }
5
5
  let(:doc) { Kramdown::Document.new input, opts }
6
6
  let(:root) { doc.root }
7
+ let(:converter) { described_class.send :new, root, {} }
7
8
 
8
9
  context '#convert' do
9
10
  let (:input) { %(# Document Title\n\nBody text.) }
10
11
  it 'adds line feed (EOL) to end of output document' do
11
- converter = described_class.send :new, root, {}
12
12
  (expect converter.convert root).to end_with %(\n)
13
13
  (expect doc.to_asciidoc).to end_with %(\n)
14
14
  end
15
15
  end
16
16
 
17
+ context '#clone' do
18
+ let :input do
19
+ <<~EOS
20
+ ## <a id="anchor-name">Heading Title</a>
21
+
22
+ Note: Be mindful.
23
+
24
+ *Important*: Turn off the lights.
25
+ EOS
26
+ end
27
+
28
+ it 'does not modify the AST when converting' do
29
+ doc.to_asciidoc
30
+ heading = root.children[0]
31
+ (expect heading.children[0].type).to be :html_element
32
+ (expect heading.children[0].value).to eql 'a'
33
+ para_i = root.children[2]
34
+ (expect para_i.children[0].value).to start_with 'Note: '
35
+ para_ii = root.children[4]
36
+ (expect para_ii.children[0].type).to be :em
37
+ end
38
+ end
39
+
17
40
  context '.replace_toc' do
18
41
  it 'does not modify source if TOC directive not detected' do
19
42
  input = <<~EOS
@@ -0,0 +1,5 @@
1
+ https://rubygems.org/gems/kramdown-asciidoc[image:download.svg[\] Download]
2
+
3
+ xref:download.adoc[image:download.svg[\] Download]
4
+
5
+ link:download.html[image:download.svg[\] Download]
@@ -0,0 +1,5 @@
1
+ [![](download.svg) Download](https://rubygems.org/gems/kramdown-asciidoc)
2
+
3
+ [![](download.svg) Download](download.md)
4
+
5
+ [![](download.svg) Download](download.html)
@@ -0,0 +1 @@
1
+ See the https://example.com/compatibility.html#feature-matrix%5F%5Fproduct_a[compatibility feature matrix for product A].
@@ -0,0 +1 @@
1
+ See the [compatibility feature matrix for product A](https://example.com/compatibility.html#feature-matrix__product_a).
@@ -1,3 +1,5 @@
1
1
  Use the `+<=+` operator to define a version that is less than or equal to a specific version.
2
2
 
3
3
  Use `+(start...end)+` to create a range from start to end that excludes the last element.
4
+
5
+ Use an `+<!-- XML comment -->+` to disable or hide markup.
@@ -1,3 +1,5 @@
1
1
  Use the `<=` operator to define a version that is less than or equal to a specific version.
2
2
 
3
3
  Use `(start...end)` to create a range from start to end that excludes the last element.
4
+
5
+ Use an `<!-- XML comment -->` to disable or hide markup.
@@ -1 +1,3 @@
1
1
  <undefined>
2
+
3
+ a | b
@@ -1 +1,3 @@
1
1
  &lt;undefined&gt;
2
+
3
+ a &#124; b
@@ -0,0 +1,10 @@
1
+ = Document Title
2
+
3
+ What follows is a listing with a block title.
4
+
5
+ .Example
6
+ ----
7
+ SELECT * from users u where u.id = 1;
8
+ ----
9
+
10
+ This query should return exactly one result.
@@ -0,0 +1,9 @@
1
+ # Document Title
2
+
3
+ What follows is a listing with a block title.
4
+
5
+ ##### Example
6
+
7
+ SELECT * from users u where u.id = 1;
8
+
9
+ This query should return exactly one result.
@@ -0,0 +1,8 @@
1
+ = Document Title
2
+
3
+ Paragraph
4
+
5
+ [discrete]
6
+ ===== Discrete Heading
7
+
8
+ Paragraph
@@ -0,0 +1,7 @@
1
+ # Document Title
2
+
3
+ Paragraph
4
+
5
+ ##### Discrete Heading
6
+
7
+ Paragraph
@@ -0,0 +1,5 @@
1
+ Main instructions.
2
+
3
+ IMPORTANT: For the configuration changes to take effect, the server must be restarted using the link:restart-api.html[Restart API].
4
+
5
+ Now back to our regularly scheduled program.
@@ -0,0 +1,7 @@
1
+ Main instructions.
2
+
3
+ <div class="note note"><span class="notetitle">Attention:</span> For the configuration changes to take effect,
4
+ the server must be restarted using the <a href="restart-api.html">Restart API</a>.
5
+ </div>
6
+
7
+ Now back to our regularly scheduled program.
@@ -0,0 +1 @@
1
+ image::logo.png[Project,480]
@@ -0,0 +1 @@
1
+ <img src="logo.png" alt="Project" width="480">
@@ -0,0 +1 @@
1
+ image::logo.png[,480]
@@ -0,0 +1 @@
1
+ <img src="logo.png" width="480">
@@ -0,0 +1,2 @@
1
+ [#img-add-new-user.image]
2
+ image::add-new-user.png[Add New User]
@@ -0,0 +1 @@
1
+ <div><img id="img-add-new-user" class="image" src="add-new-user.png" alt="Add New User"/></div>
@@ -0,0 +1,5 @@
1
+ [cols=2*]
2
+ |===
3
+ | a\|b
4
+ | c\|d
5
+ |===
@@ -0,0 +1 @@
1
+ | a\|b | c\|d |
@@ -0,0 +1,6 @@
1
+ |===
2
+ | col
3
+
4
+ | abc
5
+ | xyz
6
+ |===
@@ -0,0 +1,4 @@
1
+ | col |
2
+ | --- |
3
+ | abc |
4
+ | xyz |
@@ -0,0 +1,4 @@
1
+ |===
2
+ | abc
3
+ | xyz
4
+ |===
@@ -0,0 +1,2 @@
1
+ | abc |
2
+ | xyz |
@@ -0,0 +1 @@
1
+ Current mood: {caret}_{caret}
@@ -0,0 +1 @@
1
+ Current mood: ^_^
@@ -0,0 +1,13 @@
1
+ // Copyright 2018 ACME, Inc.
2
+
3
+ ////
4
+ Usage:
5
+
6
+ * Download
7
+ * Install
8
+ * Deploy
9
+ * Prevail
10
+ ////
11
+ = Command Line Tool
12
+
13
+ You can use the command line tool to trap roadrunners from your office chair.
@@ -0,0 +1,16 @@
1
+ <!--
2
+ Copyright 2018 ACME, Inc.
3
+ -->
4
+
5
+ <!--
6
+ Usage:
7
+
8
+ * Download
9
+ * Install
10
+ * Deploy
11
+ * Prevail
12
+ -->
13
+
14
+ # Command Line Tool
15
+
16
+ You can use the command line tool to trap roadrunners from your office chair.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown-asciidoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha.1
4
+ version: 1.0.0.alpha.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Allen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-22 00:00:00.000000000 Z
11
+ date: 2018-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown
@@ -87,6 +87,10 @@ files:
87
87
  - spec/converter_spec.rb
88
88
  - spec/fixtures/a/bare-url.adoc
89
89
  - spec/fixtures/a/bare-url.md
90
+ - spec/fixtures/a/containing-inline-image.adoc
91
+ - spec/fixtures/a/containing-inline-image.md
92
+ - spec/fixtures/a/double-underscore-in-url.adoc
93
+ - spec/fixtures/a/double-underscore-in-url.md
90
94
  - spec/fixtures/a/interdoc-xref.adoc
91
95
  - spec/fixtures/a/interdoc-xref.md
92
96
  - spec/fixtures/a/internal.adoc
@@ -117,8 +121,6 @@ files:
117
121
  - spec/fixtures/br/trailing-double-space.md
118
122
  - spec/fixtures/codeblock/contiguous-lines.adoc
119
123
  - spec/fixtures/codeblock/contiguous-lines.md
120
- - spec/fixtures/codeblock/fenced/bash-to-console.adoc
121
- - spec/fixtures/codeblock/fenced/bash-to-console.md
122
124
  - spec/fixtures/codeblock/fenced/with-command-prompt.adoc
123
125
  - spec/fixtures/codeblock/fenced/with-command-prompt.md
124
126
  - spec/fixtures/codeblock/fenced/with-language.adoc
@@ -145,6 +147,10 @@ files:
145
147
  - spec/fixtures/entity/numeric.md
146
148
  - spec/fixtures/entity/reverse.adoc
147
149
  - spec/fixtures/entity/reverse.md
150
+ - spec/fixtures/heading/block-title.adoc
151
+ - spec/fixtures/heading/block-title.md
152
+ - spec/fixtures/heading/not-block-title.adoc
153
+ - spec/fixtures/heading/not-block-title.md
148
154
  - spec/fixtures/heading/out-of-sequence.adoc
149
155
  - spec/fixtures/heading/out-of-sequence.md
150
156
  - spec/fixtures/heading/outline.adoc
@@ -159,10 +165,18 @@ files:
159
165
  - spec/fixtures/hr/dashes.md
160
166
  - spec/fixtures/html_element/abbr.adoc
161
167
  - spec/fixtures/html_element/abbr.md
168
+ - spec/fixtures/html_element/admonition.adoc
169
+ - spec/fixtures/html_element/admonition.md
162
170
  - spec/fixtures/html_element/heading-with-class.adoc
163
171
  - spec/fixtures/html_element/heading-with-class.md
164
172
  - spec/fixtures/html_element/heading-with-id.adoc
165
173
  - spec/fixtures/html_element/heading-with-id.md
174
+ - spec/fixtures/html_element/img-with-alt-and-width.adoc
175
+ - spec/fixtures/html_element/img-with-alt-and-width.md
176
+ - spec/fixtures/html_element/img-with-width.adoc
177
+ - spec/fixtures/html_element/img-with-width.md
178
+ - spec/fixtures/html_element/img.adoc
179
+ - spec/fixtures/html_element/img.md
166
180
  - spec/fixtures/html_element/native.adoc
167
181
  - spec/fixtures/html_element/native.md
168
182
  - spec/fixtures/html_element/sub.adoc
@@ -239,10 +253,18 @@ files:
239
253
  - spec/fixtures/strong/constrained.md
240
254
  - spec/fixtures/strong/nested-emphasis.adoc
241
255
  - spec/fixtures/strong/nested-emphasis.md
256
+ - spec/fixtures/table/cell-with-pipe.adoc
257
+ - spec/fixtures/table/cell-with-pipe.md
258
+ - spec/fixtures/table/single-column-with-header.adoc
259
+ - spec/fixtures/table/single-column-with-header.md
260
+ - spec/fixtures/table/single-column-without-header.adoc
261
+ - spec/fixtures/table/single-column-without-header.md
242
262
  - spec/fixtures/table/with-header.adoc
243
263
  - spec/fixtures/table/with-header.md
244
264
  - spec/fixtures/table/without-header.adoc
245
265
  - spec/fixtures/table/without-header.md
266
+ - spec/fixtures/text/caret.adoc
267
+ - spec/fixtures/text/caret.md
246
268
  - spec/fixtures/text/lte.adoc
247
269
  - spec/fixtures/text/lte.md
248
270
  - spec/fixtures/text/plus-plus.adoc
@@ -277,6 +299,8 @@ files:
277
299
  - spec/fixtures/ul/simple-separated.md
278
300
  - spec/fixtures/ul/simple.adoc
279
301
  - spec/fixtures/ul/simple.md
302
+ - spec/fixtures/xml_comment/above-header.adoc
303
+ - spec/fixtures/xml_comment/above-header.md
280
304
  - spec/fixtures/xml_comment/block.adoc
281
305
  - spec/fixtures/xml_comment/block.md
282
306
  - spec/fixtures/xml_comment/line-offset-by-space.adoc
@@ -325,6 +349,10 @@ test_files:
325
349
  - spec/converter_spec.rb
326
350
  - spec/fixtures/a/bare-url.adoc
327
351
  - spec/fixtures/a/bare-url.md
352
+ - spec/fixtures/a/containing-inline-image.adoc
353
+ - spec/fixtures/a/containing-inline-image.md
354
+ - spec/fixtures/a/double-underscore-in-url.adoc
355
+ - spec/fixtures/a/double-underscore-in-url.md
328
356
  - spec/fixtures/a/interdoc-xref.adoc
329
357
  - spec/fixtures/a/interdoc-xref.md
330
358
  - spec/fixtures/a/internal.adoc
@@ -355,8 +383,6 @@ test_files:
355
383
  - spec/fixtures/br/trailing-double-space.md
356
384
  - spec/fixtures/codeblock/contiguous-lines.adoc
357
385
  - spec/fixtures/codeblock/contiguous-lines.md
358
- - spec/fixtures/codeblock/fenced/bash-to-console.adoc
359
- - spec/fixtures/codeblock/fenced/bash-to-console.md
360
386
  - spec/fixtures/codeblock/fenced/with-command-prompt.adoc
361
387
  - spec/fixtures/codeblock/fenced/with-command-prompt.md
362
388
  - spec/fixtures/codeblock/fenced/with-language.adoc
@@ -383,6 +409,10 @@ test_files:
383
409
  - spec/fixtures/entity/numeric.md
384
410
  - spec/fixtures/entity/reverse.adoc
385
411
  - spec/fixtures/entity/reverse.md
412
+ - spec/fixtures/heading/block-title.adoc
413
+ - spec/fixtures/heading/block-title.md
414
+ - spec/fixtures/heading/not-block-title.adoc
415
+ - spec/fixtures/heading/not-block-title.md
386
416
  - spec/fixtures/heading/out-of-sequence.adoc
387
417
  - spec/fixtures/heading/out-of-sequence.md
388
418
  - spec/fixtures/heading/outline.adoc
@@ -397,10 +427,18 @@ test_files:
397
427
  - spec/fixtures/hr/dashes.md
398
428
  - spec/fixtures/html_element/abbr.adoc
399
429
  - spec/fixtures/html_element/abbr.md
430
+ - spec/fixtures/html_element/admonition.adoc
431
+ - spec/fixtures/html_element/admonition.md
400
432
  - spec/fixtures/html_element/heading-with-class.adoc
401
433
  - spec/fixtures/html_element/heading-with-class.md
402
434
  - spec/fixtures/html_element/heading-with-id.adoc
403
435
  - spec/fixtures/html_element/heading-with-id.md
436
+ - spec/fixtures/html_element/img-with-alt-and-width.adoc
437
+ - spec/fixtures/html_element/img-with-alt-and-width.md
438
+ - spec/fixtures/html_element/img-with-width.adoc
439
+ - spec/fixtures/html_element/img-with-width.md
440
+ - spec/fixtures/html_element/img.adoc
441
+ - spec/fixtures/html_element/img.md
404
442
  - spec/fixtures/html_element/native.adoc
405
443
  - spec/fixtures/html_element/native.md
406
444
  - spec/fixtures/html_element/sub.adoc
@@ -477,10 +515,18 @@ test_files:
477
515
  - spec/fixtures/strong/constrained.md
478
516
  - spec/fixtures/strong/nested-emphasis.adoc
479
517
  - spec/fixtures/strong/nested-emphasis.md
518
+ - spec/fixtures/table/cell-with-pipe.adoc
519
+ - spec/fixtures/table/cell-with-pipe.md
520
+ - spec/fixtures/table/single-column-with-header.adoc
521
+ - spec/fixtures/table/single-column-with-header.md
522
+ - spec/fixtures/table/single-column-without-header.adoc
523
+ - spec/fixtures/table/single-column-without-header.md
480
524
  - spec/fixtures/table/with-header.adoc
481
525
  - spec/fixtures/table/with-header.md
482
526
  - spec/fixtures/table/without-header.adoc
483
527
  - spec/fixtures/table/without-header.md
528
+ - spec/fixtures/text/caret.adoc
529
+ - spec/fixtures/text/caret.md
484
530
  - spec/fixtures/text/lte.adoc
485
531
  - spec/fixtures/text/lte.md
486
532
  - spec/fixtures/text/plus-plus.adoc
@@ -515,6 +561,8 @@ test_files:
515
561
  - spec/fixtures/ul/simple-separated.md
516
562
  - spec/fixtures/ul/simple.adoc
517
563
  - spec/fixtures/ul/simple.md
564
+ - spec/fixtures/xml_comment/above-header.adoc
565
+ - spec/fixtures/xml_comment/above-header.md
518
566
  - spec/fixtures/xml_comment/block.adoc
519
567
  - spec/fixtures/xml_comment/block.md
520
568
  - spec/fixtures/xml_comment/line-offset-by-space.adoc
@@ -1,4 +0,0 @@
1
- [source,console]
2
- ----
3
- $ docker -it --run node:8-alpine
4
- ----
@@ -1,3 +0,0 @@
1
- ```bash
2
- $ docker -it --run node:8-alpine
3
- ```