markdown_helper 2.2.0 → 2.3.0

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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +10 -4
  4. data/lib/markdown_helper/version.rb +1 -1
  5. data/lib/markdown_helper.rb +14 -5
  6. data/markdown/readme/README.template.md +8 -3
  7. data/markdown/use_cases/Rakefile +17 -20
  8. data/markdown/use_cases/include_files/diagnose_circular_includes/diagnose_circular_includes.err +9 -9
  9. data/markdown/use_cases/include_files/diagnose_circular_includes/use_case.md +16 -25
  10. data/markdown/use_cases/include_files/diagnose_missing_includee/diagnose_missing_includee.err +9 -9
  11. data/markdown/use_cases/include_files/diagnose_missing_includee/use_case.md +16 -25
  12. data/markdown/use_cases/include_files/include_code_block/use_case.md +7 -17
  13. data/markdown/use_cases/include_files/include_highlighted_code/use_case.md +7 -17
  14. data/markdown/use_cases/include_files/include_markdown/use_case.md +7 -18
  15. data/markdown/use_cases/include_files/include_page_toc/included.md +0 -6
  16. data/markdown/use_cases/include_files/include_page_toc/use_case.md +7 -30
  17. data/markdown/use_cases/include_files/include_text_as_comment/use_case.md +7 -18
  18. data/markdown/use_cases/include_files/include_text_as_details/details.md +5 -0
  19. data/markdown/use_cases/include_files/include_text_as_details/included.md +10 -0
  20. data/markdown/use_cases/include_files/include_text_as_details/includer.md +4 -0
  21. data/markdown/use_cases/include_files/include_text_as_details/use_case.md +84 -0
  22. data/markdown/use_cases/include_files/include_text_as_details/use_case_template.md +31 -0
  23. data/markdown/use_cases/include_files/include_text_as_pre/use_case.md +7 -18
  24. data/markdown/use_cases/include_files/include_with_added_comments/included.md +0 -4
  25. data/markdown/use_cases/include_files/include_with_added_comments/use_case.md +0 -4
  26. data/markdown/use_cases/include_files/interface.md +8 -17
  27. data/markdown/use_cases/include_files/nest_inclusions/use_case.md +7 -16
  28. data/markdown/use_cases/include_files/reuse_text/use_case.md +7 -18
  29. data/markdown/use_cases/use_cases.md +1 -0
  30. metadata +8 -20
  31. data/markdown/use_cases/include_files/diagnose_circular_includes/include.rb +0 -5
  32. data/markdown/use_cases/include_files/diagnose_circular_includes/use_case_builder.rb +0 -64
  33. data/markdown/use_cases/include_files/diagnose_missing_includee/include.rb +0 -5
  34. data/markdown/use_cases/include_files/diagnose_missing_includee/use_case_builder.rb +0 -66
  35. data/markdown/use_cases/include_files/include_code_block/use_case_builder.rb +0 -78
  36. data/markdown/use_cases/include_files/include_generated_text/use_case_builder.rb +0 -37
  37. data/markdown/use_cases/include_files/include_highlighted_code/use_case_builder.rb +0 -82
  38. data/markdown/use_cases/include_files/include_markdown/use_case_builder.rb +0 -80
  39. data/markdown/use_cases/include_files/include_page_toc/use_case_builder.rb +0 -121
  40. data/markdown/use_cases/include_files/include_text_as_comment/use_case_builder.rb +0 -71
  41. data/markdown/use_cases/include_files/include_text_as_pre/use_case_builder.rb +0 -68
  42. data/markdown/use_cases/include_files/include_use_case.rb +0 -104
  43. data/markdown/use_cases/include_files/include_with_added_comments/use_case_builder.rb +0 -66
  44. data/markdown/use_cases/include_files/nest_inclusions/use_case_builder.rb +0 -60
  45. data/markdown/use_cases/include_files/reuse_text/include.rb +0 -5
  46. data/markdown/use_cases/include_files/reuse_text/use_case_builder.rb +0 -48
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09204d578d4034b5940afc983b9d3989adff2d1b05763b0e6e867e3183b338c8'
4
- data.tar.gz: a90232dc47c8d901f1fa1a5bed7964e0deee6fb3b3bd9d2713f46ea105b162b2
3
+ metadata.gz: 5f87e472a6df990e637dacc06c4e6bc7daffd512634c69c4202e3d9d6f96bc43
4
+ data.tar.gz: 414fe00be28329fef09722912fffe9bb9a5bb1ba998c69432d68908219a639e3
5
5
  SHA512:
6
- metadata.gz: ad9d3e8cbf0a1fa17eba25579c02165571e5408ea979747600aa6db74b52122fd2157d61d6f2a65e7302eac52a443e40343d10d0c291eae7912d64ccd099ed6f
7
- data.tar.gz: 4ee21575e5d049259b9c365ab9842d904127ebe8df9f023304bcb35c34242f3eb81edf37a055aee6cdce61283c635fb4d38bb4ffbfa7cdc54f6b7f8584fb8672
6
+ metadata.gz: b8a99c9e3a3b2ffa39abbf36fcf44a21650b19498849ed2d60e78e418792464c8efffe680c758c6f23b65bc95c4fdef67a97e894339a96d6196bc7c7d362851d
7
+ data.tar.gz: 861b07f382444226d6fcacf224e16da75e94a3822305592fbf9dba7b1d38f0686a0f890fc1914f33c8640c04f2bf3a3d39ecfd52014c39ae95b47d40ddc008b5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- markdown_helper (2.2.0)
4
+ markdown_helper (2.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  ## What's New?
7
7
 
8
- Command line creation of page TOC (table of contents), previously deprecated, is removed.
8
+ Inclusion of text as details is added. See the [use case](markdown/use_cases/include_files/include_text_as_details/use_case.md#include-text-as-details).
9
9
 
10
10
  ## Contents
11
11
  - [What's a Markdown Helper?](#whats-a-markdown-helper)
@@ -21,7 +21,8 @@ Command line creation of page TOC (table of contents), previously deprecated, is
21
21
  - [Highlighted Code Block](#highlighted-code-block)
22
22
  - [Plain Code Block](#plain-code-block)
23
23
  - [Comment](#comment)
24
- - [Pre-Formattted Text](#pre-formattted-text)
24
+ - [Details](#details)
25
+ - [Pre-Formatted Text](#pre-formatted-text)
25
26
  - [Usage](#usage)
26
27
  - [CLI](#cli)
27
28
  - [API](#api)
@@ -100,7 +101,11 @@ You can also include a code block without highlighting. See the [use case](mark
100
101
 
101
102
  You can include text that's to become a comment in the markdown. See the [use case](markdown/use_cases/include_files/include_text_as_comment/use_case.md#include-text-as-comment).
102
103
 
103
- ### Pre-Formattted Text
104
+ #### Details
105
+
106
+ You can include text that's to become details in the markdown. See the [use case](markdown/use_cases/include_files/include_text_as_details/use_case.md#include-text-as-details).
107
+
108
+ ### Pre-Formatted Text
104
109
 
105
110
  You can include text that's pre-formatted. See the [use case](markdown/use_cases/include_files/include_text_as_pre/use_case.md#include-text-as-pre).
106
111
 
@@ -159,8 +164,9 @@ where:
159
164
  * Highlighting mode such as <code>[ruby]</code>, to include a highlighted code block. This can be any Ace mode mentioned in [GitHub Languages](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml).
160
165
  * <code>[:code_block]</code>, to include a plain code block.
161
166
  * <code>[:markdown]</code>, to include text markdown (to be rendered as markdown).
162
- * <code>[:comment]</code>, to insert text as a markdown comment.
167
+ * <code>[:comment]</code>, to include text as a markdown comment.
163
168
  * <code>[:pre]</code>, to include pre-formatted text.
169
+ * <code>[:details]</code>, to include text as details.
164
170
  * *relative_file_path* points to the file to be included.
165
171
 
166
172
  ##### Example Include Descriptions
@@ -1,3 +1,3 @@
1
1
  class MarkdownHelper
2
- VERSION = '2.2.0'
2
+ VERSION = '2.3.0'
3
3
  end
@@ -68,8 +68,9 @@ class MarkdownHelper
68
68
  Dir.chdir(File.dirname(template_file_path)) do
69
69
  markdown_lines = []
70
70
  unless File.readable?(template_file_path)
71
+ path_in_project = MarkdownHelper.path_in_project(template_file_path )
71
72
  message = [
72
- 'Could not read template file:',
73
+ "Could not read template file: #{path_in_project}",
73
74
  MarkdownHelper.backtrace_inclusions(@inclusions),
74
75
  ].join("\n")
75
76
  e = UnreadableTemplateError.new(message)
@@ -96,27 +97,31 @@ class MarkdownHelper
96
97
  includee_file_path,
97
98
  @inclusions
98
99
  )
99
- treatment.sub!(/^:/, '')
100
100
  case treatment
101
- when 'markdown'
101
+ when ':markdown'
102
102
  check_includee(inclusion)
103
103
  check_circularity(inclusion)
104
104
  @inclusions.push(inclusion)
105
105
  includee_lines = include_markdown(File.absolute_path(includee_file_path))
106
106
  markdown_lines.concat(includee_lines)
107
- when 'comment'
107
+ when ':comment'
108
108
  text = File.read(includee_file_path)
109
109
  markdown_lines.push(MarkdownHelper.comment(text))
110
110
  @inclusions.push(inclusion)
111
- when 'pre'
111
+ when ':pre'
112
112
  text = File.read(includee_file_path)
113
113
  markdown_lines.push(MarkdownHelper.pre(text))
114
114
  @inclusions.push(inclusion)
115
+ when ':details'
116
+ text = File.read(includee_file_path)
117
+ markdown_lines.push(MarkdownHelper.details(text))
118
+ @inclusions.push(inclusion)
115
119
  else
116
120
  markdown_lines.push(template_line)
117
121
  next
118
122
  end
119
123
  @inclusions.pop
124
+ treatment.sub!(/^:/, '')
120
125
  add_inclusion_comments(treatment, includee_file_path, markdown_lines)
121
126
  end
122
127
  markdown_lines
@@ -222,6 +227,10 @@ class MarkdownHelper
222
227
  "<pre>\n#{text}</pre>"
223
228
  end
224
229
 
230
+ def self.details(text)
231
+ "<details>\n#{text}</details>"
232
+ end
233
+
225
234
  def self.git_clone_dir_path
226
235
  git_dir = `git rev-parse --show-toplevel`.chomp
227
236
  unless $?.success?
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## What's New?
6
6
 
7
- Command line creation of page TOC (table of contents), previously deprecated, is removed.
7
+ Inclusion of text as details is added. See the [use case](markdown/use_cases/include_files/include_text_as_details/use_case.md#include-text-as-details).
8
8
 
9
9
  @[:page_toc](## Contents)
10
10
 
@@ -74,7 +74,11 @@ You can also include a code block without highlighting. See the [use case](mark
74
74
 
75
75
  You can include text that's to become a comment in the markdown. See the [use case](markdown/use_cases/include_files/include_text_as_comment/use_case.md#include-text-as-comment).
76
76
 
77
- ### Pre-Formattted Text
77
+ #### Details
78
+
79
+ You can include text that's to become details in the markdown. See the [use case](markdown/use_cases/include_files/include_text_as_details/use_case.md#include-text-as-details).
80
+
81
+ ### Pre-Formatted Text
78
82
 
79
83
  You can include text that's pre-formatted. See the [use case](markdown/use_cases/include_files/include_text_as_pre/use_case.md#include-text-as-pre).
80
84
 
@@ -100,8 +104,9 @@ where:
100
104
  * Highlighting mode such as <code>[ruby]</code>, to include a highlighted code block. This can be any Ace mode mentioned in [GitHub Languages](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml).
101
105
  * <code>[:code_block]</code>, to include a plain code block.
102
106
  * <code>[:markdown]</code>, to include text markdown (to be rendered as markdown).
103
- * <code>[:comment]</code>, to insert text as a markdown comment.
107
+ * <code>[:comment]</code>, to include text as a markdown comment.
104
108
  * <code>[:pre]</code>, to include pre-formatted text.
109
+ * <code>[:details]</code>, to include text as details.
105
110
  * *relative_file_path* points to the file to be included.
106
111
 
107
112
  ##### Example Include Descriptions
@@ -1,4 +1,3 @@
1
- require_relative 'include_files/include_use_case'
2
1
  require_relative '../../lib/string_helper'
3
2
 
4
3
  namespace :build do
@@ -18,7 +17,6 @@ EOT
18
17
  )
19
18
  dir_path = File.dirname(__FILE__)
20
19
  Dir.chdir(dir_path) do
21
- IncludeUseCase.write_interface_file
22
20
  use_case_dirs = {
23
21
  :include_files => %w/
24
22
  reuse_text
@@ -27,6 +25,7 @@ EOT
27
25
  include_code_block
28
26
  include_highlighted_code
29
27
  include_page_toc
28
+ include_text_as_details
30
29
  include_text_as_comment
31
30
  include_text_as_pre
32
31
  include_generated_text
@@ -54,29 +53,27 @@ EOT
54
53
  # Each use case is in a separate directory.
55
54
  dir_names.each do |dir_name|
56
55
  Dir.chdir("#{section}/#{dir_name}") do
57
-
58
- # There should be a conventionally-named ruby file to build the use case.
59
- fail dir_name unless File.exist?(UseCase::BUILDER_FILE_NAME)
60
-
61
- # There should be a conventionally-named use-case template.
62
- fail dir_name unless File.exist?(UseCase::TEMPLATE_FILE_NAME)
63
-
64
- class_name = camelize(dir_name)
65
- command = "ruby -I . -r #{UseCase::BUILDER_FILE_NAME} -e #{class_name}.build"
66
- if backtrace_cases.include?(dir_name)
67
- command += " 2> #{dir_name}.err"
68
- begin
56
+ if File.exist?('includer.md')
57
+ command = 'markdown_helper include --pristine includer.md included.md'
58
+ if backtrace_cases.include?(dir_name)
59
+ # Capture the exception.
60
+ command += " 2> #{dir_name}.err"
61
+ # Generate the error.
62
+ begin
63
+ system(command)
64
+ rescue
65
+ #
66
+ end
67
+ else
69
68
  system(command)
70
- rescue
71
- #
72
69
  end
73
- else
74
- system(command)
75
70
  end
71
+ command = 'markdown_helper include --pristine use_case_template.md use_case.md'
72
+ system(command)
76
73
 
77
- title_line = File.open(UseCase::TEMPLATE_FILE_NAME).grep(/^#/).first.chomp
74
+ title_line = File.open('use_case_template.md').grep(/^#/).first.chomp
78
75
  title = title_line.split(/\s/, 2).pop
79
- use_case_file_name = File.basename(UseCase::USE_CASE_FILE_NAME)
76
+ use_case_file_name = File.basename('use_case.md')
80
77
  use_case_anchor = dir_name.gsub('_', '-')
81
78
  use_case_relative_url = File.join(
82
79
  section.to_s,
@@ -1,26 +1,26 @@
1
- C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/markdown_helper-2.1.0/bin/_include: Includes are circular: (MarkdownHelper::CircularIncludeError)
1
+ C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/markdown_helper-2.3.0/bin/_include: Includes are circular: (MarkdownHelper::CircularIncludeError)
2
2
  Backtrace (innermost include first):
3
3
  Level 0:
4
4
  Includer:
5
- Location: markdown/use_cases/include_files/diagnose_circular_includes/includer_2.md:1
6
- Include description: @[:markdown](includer_0.md)
5
+ Location: markdown/use_cases/include_files/diagnose_circular_includes/includer_2.md:0
6
+ Include pragma: @[:markdown](includer_0.md)
7
7
  Includee:
8
8
  File path: markdown/use_cases/include_files/diagnose_circular_includes/includer_0.md
9
9
  Level 1:
10
10
  Includer:
11
- Location: markdown/use_cases/include_files/diagnose_circular_includes/includer_1.md:1
12
- Include description: @[:markdown](includer_2.md)
11
+ Location: markdown/use_cases/include_files/diagnose_circular_includes/includer_1.md:0
12
+ Include pragma: @[:markdown](includer_2.md)
13
13
  Includee:
14
14
  File path: markdown/use_cases/include_files/diagnose_circular_includes/includer_2.md
15
15
  Level 2:
16
16
  Includer:
17
- Location: markdown/use_cases/include_files/diagnose_circular_includes/includer_0.md:1
18
- Include description: @[:markdown](includer_1.md)
17
+ Location: markdown/use_cases/include_files/diagnose_circular_includes/includer_0.md:0
18
+ Include pragma: @[:markdown](includer_1.md)
19
19
  Includee:
20
20
  File path: markdown/use_cases/include_files/diagnose_circular_includes/includer_1.md
21
21
  Level 3:
22
22
  Includer:
23
- Location: includer.md:1
24
- Include description: @[:markdown](includer_0.md)
23
+ Location: markdown/use_cases/include_files/diagnose_circular_includes/includer.md:0
24
+ Include pragma: @[:markdown](includer_0.md)
25
25
  Includee:
26
26
  File path: markdown/use_cases/include_files/diagnose_circular_includes/includer_0.md
@@ -30,23 +30,18 @@ This file initiates the nested inclusions.
30
30
  @[:markdown](includer_0.md)
31
31
  ```
32
32
 
33
- #### CLI
34
-
35
- You can use the command-line interface to perform the inclusion.
36
-
37
- ##### Command
33
+ #### Include Via <code>markdown_helper</code>
34
+ <details>
35
+ <summary>CLI</summary>
38
36
 
39
37
  ```sh
40
38
  markdown_helper include --pristine includer.md included.md
41
39
  ```
42
40
 
43
41
  (Option ```--pristine``` suppresses comment insertion.)
44
-
45
- #### API
46
-
47
- You can use the API to perform the inclusion.
48
-
49
- ##### Ruby Code
42
+ </details>
43
+ <details>
44
+ <summary>API</summary>
50
45
 
51
46
  ```include.rb```:
52
47
  ```ruby
@@ -57,11 +52,7 @@ markdown_helper = MarkdownHelper.new(:pristine => true)
57
52
  markdown_helper.include('includer.md', 'included.md')
58
53
  ```
59
54
 
60
- ##### Command
61
-
62
- ```sh
63
- ruby include.rb
64
- ```
55
+ </details>
65
56
 
66
57
  #### Error and Backtrace
67
58
 
@@ -69,30 +60,30 @@ Here's the resulting backtrace of inclusions.
69
60
 
70
61
  ```diagnose_circular_includes.err```:
71
62
  ```
72
- C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/markdown_helper-2.1.0/bin/_include: Includes are circular: (MarkdownHelper::CircularIncludeError)
63
+ C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/markdown_helper-2.3.0/bin/_include: Includes are circular: (MarkdownHelper::CircularIncludeError)
73
64
  Backtrace (innermost include first):
74
65
  Level 0:
75
66
  Includer:
76
- Location: markdown/use_cases/include_files/diagnose_circular_includes/includer_2.md:1
77
- Include description: @[:markdown](includer_0.md)
67
+ Location: markdown/use_cases/include_files/diagnose_circular_includes/includer_2.md:0
68
+ Include pragma: @[:markdown](includer_0.md)
78
69
  Includee:
79
70
  File path: markdown/use_cases/include_files/diagnose_circular_includes/includer_0.md
80
71
  Level 1:
81
72
  Includer:
82
- Location: markdown/use_cases/include_files/diagnose_circular_includes/includer_1.md:1
83
- Include description: @[:markdown](includer_2.md)
73
+ Location: markdown/use_cases/include_files/diagnose_circular_includes/includer_1.md:0
74
+ Include pragma: @[:markdown](includer_2.md)
84
75
  Includee:
85
76
  File path: markdown/use_cases/include_files/diagnose_circular_includes/includer_2.md
86
77
  Level 2:
87
78
  Includer:
88
- Location: markdown/use_cases/include_files/diagnose_circular_includes/includer_0.md:1
89
- Include description: @[:markdown](includer_1.md)
79
+ Location: markdown/use_cases/include_files/diagnose_circular_includes/includer_0.md:0
80
+ Include pragma: @[:markdown](includer_1.md)
90
81
  Includee:
91
82
  File path: markdown/use_cases/include_files/diagnose_circular_includes/includer_1.md
92
83
  Level 3:
93
84
  Includer:
94
- Location: includer.md:1
95
- Include description: @[:markdown](includer_0.md)
85
+ Location: markdown/use_cases/include_files/diagnose_circular_includes/includer.md:0
86
+ Include pragma: @[:markdown](includer_0.md)
96
87
  Includee:
97
88
  File path: markdown/use_cases/include_files/diagnose_circular_includes/includer_0.md
98
89
  ```
@@ -1,26 +1,26 @@
1
- C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/markdown_helper-2.1.0/bin/_include: Could not read include file, (MarkdownHelper::UnreadableInputError)
1
+ C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/markdown_helper-2.3.0/bin/_include: Could not read includee file: (MarkdownHelper::UnreadableIncludeeError)
2
2
  Backtrace (innermost include first):
3
3
  Level 0:
4
4
  Includer:
5
- Location: markdown/use_cases/include_files/diagnose_missing_includee/includer_2.md:1
6
- Include description: @[:markdown](includer_3.md)
5
+ Location: markdown/use_cases/include_files/diagnose_missing_includee/includer_2.md:0
6
+ Include pragma: @[:markdown](includer_3.md)
7
7
  Includee:
8
8
  File path: markdown/use_cases/include_files/diagnose_missing_includee/includer_3.md
9
9
  Level 1:
10
10
  Includer:
11
- Location: markdown/use_cases/include_files/diagnose_missing_includee/includer_1.md:1
12
- Include description: @[:markdown](includer_2.md)
11
+ Location: markdown/use_cases/include_files/diagnose_missing_includee/includer_1.md:0
12
+ Include pragma: @[:markdown](includer_2.md)
13
13
  Includee:
14
14
  File path: markdown/use_cases/include_files/diagnose_missing_includee/includer_2.md
15
15
  Level 2:
16
16
  Includer:
17
- Location: markdown/use_cases/include_files/diagnose_missing_includee/includer_0.md:1
18
- Include description: @[:markdown](includer_1.md)
17
+ Location: markdown/use_cases/include_files/diagnose_missing_includee/includer_0.md:0
18
+ Include pragma: @[:markdown](includer_1.md)
19
19
  Includee:
20
20
  File path: markdown/use_cases/include_files/diagnose_missing_includee/includer_1.md
21
21
  Level 3:
22
22
  Includer:
23
- Location: includer.md:1
24
- Include description: @[:markdown](includer_0.md)
23
+ Location: markdown/use_cases/include_files/diagnose_missing_includee/includer.md:0
24
+ Include pragma: @[:markdown](includer_0.md)
25
25
  Includee:
26
26
  File path: markdown/use_cases/include_files/diagnose_missing_includee/includer_0.md
@@ -32,23 +32,18 @@ This file initiates the nested inclusions.
32
32
  @[:markdown](includer_0.md)
33
33
  ```
34
34
 
35
- #### CLI
36
-
37
- You can use the command-line interface to perform the inclusion.
38
-
39
- ##### Command
35
+ #### Include Via <code>markdown_helper</code>
36
+ <details>
37
+ <summary>CLI</summary>
40
38
 
41
39
  ```sh
42
40
  markdown_helper include --pristine includer.md included.md
43
41
  ```
44
42
 
45
43
  (Option ```--pristine``` suppresses comment insertion.)
46
-
47
- #### API
48
-
49
- You can use the API to perform the inclusion.
50
-
51
- ##### Ruby Code
44
+ </details>
45
+ <details>
46
+ <summary>API</summary>
52
47
 
53
48
  ```include.rb```:
54
49
  ```ruby
@@ -59,11 +54,7 @@ markdown_helper = MarkdownHelper.new(:pristine => true)
59
54
  markdown_helper.include('includer.md', 'included.md')
60
55
  ```
61
56
 
62
- ##### Command
63
-
64
- ```sh
65
- ruby include.rb
66
- ```
57
+ </details>
67
58
 
68
59
  #### Error and Backtrace
69
60
 
@@ -71,30 +62,30 @@ Here's the resulting backtrace of inclusions.
71
62
 
72
63
  ```diagnose_missing_includee.err```:
73
64
  ```
74
- C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/markdown_helper-2.1.0/bin/_include: Could not read include file, (MarkdownHelper::UnreadableInputError)
65
+ C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/markdown_helper-2.3.0/bin/_include: Could not read includee file: (MarkdownHelper::UnreadableIncludeeError)
75
66
  Backtrace (innermost include first):
76
67
  Level 0:
77
68
  Includer:
78
- Location: markdown/use_cases/include_files/diagnose_missing_includee/includer_2.md:1
79
- Include description: @[:markdown](includer_3.md)
69
+ Location: markdown/use_cases/include_files/diagnose_missing_includee/includer_2.md:0
70
+ Include pragma: @[:markdown](includer_3.md)
80
71
  Includee:
81
72
  File path: markdown/use_cases/include_files/diagnose_missing_includee/includer_3.md
82
73
  Level 1:
83
74
  Includer:
84
- Location: markdown/use_cases/include_files/diagnose_missing_includee/includer_1.md:1
85
- Include description: @[:markdown](includer_2.md)
75
+ Location: markdown/use_cases/include_files/diagnose_missing_includee/includer_1.md:0
76
+ Include pragma: @[:markdown](includer_2.md)
86
77
  Includee:
87
78
  File path: markdown/use_cases/include_files/diagnose_missing_includee/includer_2.md
88
79
  Level 2:
89
80
  Includer:
90
- Location: markdown/use_cases/include_files/diagnose_missing_includee/includer_0.md:1
91
- Include description: @[:markdown](includer_1.md)
81
+ Location: markdown/use_cases/include_files/diagnose_missing_includee/includer_0.md:0
82
+ Include pragma: @[:markdown](includer_1.md)
92
83
  Includee:
93
84
  File path: markdown/use_cases/include_files/diagnose_missing_includee/includer_1.md
94
85
  Level 3:
95
86
  Includer:
96
- Location: includer.md:1
97
- Include description: @[:markdown](includer_0.md)
87
+ Location: markdown/use_cases/include_files/diagnose_missing_includee/includer.md:0
88
+ Include pragma: @[:markdown](includer_0.md)
98
89
  Includee:
99
90
  File path: markdown/use_cases/include_files/diagnose_missing_includee/includer_0.md
100
91
  ```
@@ -27,28 +27,22 @@ Here's a template file that includes it:
27
27
  This file includes the code as a code block.
28
28
 
29
29
  @[:code_block](hello.rb)
30
-
31
30
  ```
32
31
 
33
32
  The treatment token ```:code_block``` specifies that the included text is to be treated as a code block.
34
33
 
35
- #### CLI
36
-
37
- You can use the command-line interface to perform the inclusion.
38
-
39
- ##### Command
34
+ #### Include Via <code>markdown_helper</code>
35
+ <details>
36
+ <summary>CLI</summary>
40
37
 
41
38
  ```sh
42
39
  markdown_helper include --pristine includer.md included.md
43
40
  ```
44
41
 
45
42
  (Option ```--pristine``` suppresses comment insertion.)
46
-
47
- #### API
48
-
49
- You can use the API to perform the inclusion.
50
-
51
- ##### Ruby Code
43
+ </details>
44
+ <details>
45
+ <summary>API</summary>
52
46
 
53
47
  ```include.rb```:
54
48
  ```ruby
@@ -59,11 +53,7 @@ markdown_helper = MarkdownHelper.new(:pristine => true)
59
53
  markdown_helper.include('includer.md', 'included.md')
60
54
  ```
61
55
 
62
- ##### Command
63
-
64
- ```sh
65
- ruby include.rb
66
- ```
56
+ </details>
67
57
 
68
58
  #### File with Inclusion
69
59
 
@@ -27,30 +27,24 @@ Here's a template file that includes it:
27
27
  This file includes the code as highlighted code.
28
28
 
29
29
  @[ruby](hello.rb)
30
-
31
30
  ```
32
31
 
33
32
  The treatment token ```ruby``` specifies that the included text is to be highlighted as Ruby code.
34
33
 
35
34
  The treatment token can be any Ace mode mentioned in [GitHub Languages](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml). The file lists about 100 Ace modes, covering just about every language and format.
36
35
 
37
- #### CLI
38
-
39
- You can use the command-line interface to perform the inclusion.
40
-
41
- ##### Command
36
+ #### Include Via <code>markdown_helper</code>
37
+ <details>
38
+ <summary>CLI</summary>
42
39
 
43
40
  ```sh
44
41
  markdown_helper include --pristine includer.md included.md
45
42
  ```
46
43
 
47
44
  (Option ```--pristine``` suppresses comment insertion.)
48
-
49
- #### API
50
-
51
- You can use the API to perform the inclusion.
52
-
53
- ##### Ruby Code
45
+ </details>
46
+ <details>
47
+ <summary>API</summary>
54
48
 
55
49
  ```include.rb```:
56
50
  ```ruby
@@ -61,11 +55,7 @@ markdown_helper = MarkdownHelper.new(:pristine => true)
61
55
  markdown_helper.include('includer.md', 'included.md')
62
56
  ```
63
57
 
64
- ##### Command
65
-
66
- ```sh
67
- ruby include.rb
68
- ```
58
+ </details>
69
59
 
70
60
  #### File with Inclusion
71
61
 
@@ -29,28 +29,22 @@ Here's a template file that includes it:
29
29
  This file includes the markdown file.
30
30
 
31
31
  @[:markdown](markdown.md)
32
-
33
32
  ```
34
33
 
35
34
  The treatment token ```:markdown``` specifies that the included text is to be treated as markdown.
36
35
 
37
- #### CLI
38
-
39
- You can use the command-line interface to perform the inclusion.
40
-
41
- ##### Command
36
+ #### Include Via <code>markdown_helper</code>
37
+ <details>
38
+ <summary>CLI</summary>
42
39
 
43
40
  ```sh
44
41
  markdown_helper include --pristine includer.md included.md
45
42
  ```
46
43
 
47
44
  (Option ```--pristine``` suppresses comment insertion.)
48
-
49
- #### API
50
-
51
- You can use the API to perform the inclusion.
52
-
53
- ##### Ruby Code
45
+ </details>
46
+ <details>
47
+ <summary>API</summary>
54
48
 
55
49
  ```include.rb```:
56
50
  ```ruby
@@ -61,11 +55,7 @@ markdown_helper = MarkdownHelper.new(:pristine => true)
61
55
  markdown_helper.include('includer.md', 'included.md')
62
56
  ```
63
57
 
64
- ##### Command
65
-
66
- ```sh
67
- ruby include.rb
68
- ```
58
+ </details>
69
59
 
70
60
  #### File with Inclusion
71
61
 
@@ -85,7 +75,6 @@ This is an unordered list:
85
75
  * One.
86
76
  * Two.
87
77
  * Three.
88
-
89
78
  ```
90
79
 
91
80
  And here's the finished markdown, as rendered on this page:
@@ -1,4 +1,3 @@
1
- <!-- >>>>>> BEGIN GENERATED FILE (include): SOURCE includer.md -->
2
1
  # Page Title
3
2
 
4
3
  ## Page Contents
@@ -23,7 +22,6 @@
23
22
 
24
23
  ## Another includer level-two title.
25
24
 
26
- <!-- >>>>>> BEGIN INCLUDED FILE (markdown): SOURCE markdown/use_cases/include_files/include_page_toc/markdown_0.md -->
27
25
 
28
26
  ## Includee 0 level-two title.
29
27
 
@@ -32,9 +30,7 @@
32
30
  ### Another includee 0 level-three title.
33
31
 
34
32
  ## Another includee 0 level-two title.
35
- <!-- <<<<<< END INCLUDED FILE (markdown): SOURCE markdown/use_cases/include_files/include_page_toc/markdown_0.md -->
36
33
 
37
- <!-- >>>>>> BEGIN INCLUDED FILE (markdown): SOURCE markdown/use_cases/include_files/include_page_toc/markdown_1.md -->
38
34
 
39
35
  ## Includee 1 level-two title.
40
36
 
@@ -43,6 +39,4 @@
43
39
  ### Another includee 1 level-three title.
44
40
 
45
41
  ## Another includee 1 level-two title.
46
- <!-- <<<<<< END INCLUDED FILE (markdown): SOURCE markdown/use_cases/include_files/include_page_toc/markdown_1.md -->
47
42
 
48
- <!-- <<<<<< END GENERATED FILE (include): SOURCE includer.md -->