rich_text_renderer 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -0
  3. data/lib/rich_text_renderer/version.rb +1 -1
  4. metadata +6 -167
  5. data/.gitignore +0 -7
  6. data/.rspec +0 -1
  7. data/.rubocop.yml +0 -27
  8. data/.rubocop_todo.yml +0 -35
  9. data/.travis.yml +0 -13
  10. data/.yardopts +0 -4
  11. data/Gemfile +0 -3
  12. data/Gemfile.lock +0 -110
  13. data/Guardfile +0 -24
  14. data/Rakefile +0 -33
  15. data/coverage/.last_run.json +0 -5
  16. data/coverage/.resultset.json +0 -1372
  17. data/coverage/.resultset.json.lock +0 -0
  18. data/coverage/assets/0.10.2/application.css +0 -799
  19. data/coverage/assets/0.10.2/application.js +0 -1707
  20. data/coverage/assets/0.10.2/colorbox/border.png +0 -0
  21. data/coverage/assets/0.10.2/colorbox/controls.png +0 -0
  22. data/coverage/assets/0.10.2/colorbox/loading.gif +0 -0
  23. data/coverage/assets/0.10.2/colorbox/loading_background.png +0 -0
  24. data/coverage/assets/0.10.2/favicon_green.png +0 -0
  25. data/coverage/assets/0.10.2/favicon_red.png +0 -0
  26. data/coverage/assets/0.10.2/favicon_yellow.png +0 -0
  27. data/coverage/assets/0.10.2/loading.gif +0 -0
  28. data/coverage/assets/0.10.2/magnify.png +0 -0
  29. data/coverage/assets/0.10.2/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  30. data/coverage/assets/0.10.2/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  31. data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  32. data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  33. data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  34. data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  35. data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  36. data/coverage/assets/0.10.2/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  37. data/coverage/assets/0.10.2/smoothness/images/ui-icons_222222_256x240.png +0 -0
  38. data/coverage/assets/0.10.2/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  39. data/coverage/assets/0.10.2/smoothness/images/ui-icons_454545_256x240.png +0 -0
  40. data/coverage/assets/0.10.2/smoothness/images/ui-icons_888888_256x240.png +0 -0
  41. data/coverage/assets/0.10.2/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  42. data/coverage/index.html +0 -9146
  43. data/doc/RichTextRenderer/BaseBlockRenderer.html +0 -242
  44. data/doc/RichTextRenderer/BaseInlineRenderer.html +0 -242
  45. data/doc/RichTextRenderer/BaseNodeRenderer.html +0 -300
  46. data/doc/RichTextRenderer/BlockQuoteRenderer.html +0 -169
  47. data/doc/RichTextRenderer/BoldRenderer.html +0 -169
  48. data/doc/RichTextRenderer/CodeRenderer.html +0 -169
  49. data/doc/RichTextRenderer/DocumentRenderer.html +0 -242
  50. data/doc/RichTextRenderer/EntryBlockRenderer.html +0 -239
  51. data/doc/RichTextRenderer/HeadingFiveRenderer.html +0 -169
  52. data/doc/RichTextRenderer/HeadingFourRenderer.html +0 -169
  53. data/doc/RichTextRenderer/HeadingOneRenderer.html +0 -169
  54. data/doc/RichTextRenderer/HeadingSixRenderer.html +0 -169
  55. data/doc/RichTextRenderer/HeadingThreeRenderer.html +0 -169
  56. data/doc/RichTextRenderer/HeadingTwoRenderer.html +0 -169
  57. data/doc/RichTextRenderer/HrRenderer.html +0 -238
  58. data/doc/RichTextRenderer/HyperlinkRenderer.html +0 -246
  59. data/doc/RichTextRenderer/ItalicRenderer.html +0 -169
  60. data/doc/RichTextRenderer/ListItemRenderer.html +0 -169
  61. data/doc/RichTextRenderer/NullRenderer.html +0 -238
  62. data/doc/RichTextRenderer/OrderedListRenderer.html +0 -169
  63. data/doc/RichTextRenderer/ParagraphRenderer.html +0 -169
  64. data/doc/RichTextRenderer/Renderer.html +0 -349
  65. data/doc/RichTextRenderer/TextRenderer.html +0 -254
  66. data/doc/RichTextRenderer/UnderlineRenderer.html +0 -169
  67. data/doc/RichTextRenderer/UnorderedListRenderer.html +0 -169
  68. data/doc/RichTextRenderer.html +0 -155
  69. data/doc/StructuredTextRenderer/BaseBlockRenderer.html +0 -242
  70. data/doc/StructuredTextRenderer/BaseInlineRenderer.html +0 -242
  71. data/doc/StructuredTextRenderer/BaseNodeRenderer.html +0 -300
  72. data/doc/StructuredTextRenderer/BoldRenderer.html +0 -169
  73. data/doc/StructuredTextRenderer/CodeRenderer.html +0 -169
  74. data/doc/StructuredTextRenderer/DocumentRenderer.html +0 -242
  75. data/doc/StructuredTextRenderer/EntryBlockRenderer.html +0 -239
  76. data/doc/StructuredTextRenderer/HeadingFiveRenderer.html +0 -169
  77. data/doc/StructuredTextRenderer/HeadingFourRenderer.html +0 -169
  78. data/doc/StructuredTextRenderer/HeadingOneRenderer.html +0 -169
  79. data/doc/StructuredTextRenderer/HeadingSixRenderer.html +0 -169
  80. data/doc/StructuredTextRenderer/HeadingThreeRenderer.html +0 -169
  81. data/doc/StructuredTextRenderer/HeadingTwoRenderer.html +0 -169
  82. data/doc/StructuredTextRenderer/HrRenderer.html +0 -238
  83. data/doc/StructuredTextRenderer/HyperlinkRenderer.html +0 -246
  84. data/doc/StructuredTextRenderer/ItalicRenderer.html +0 -169
  85. data/doc/StructuredTextRenderer/ListItemRenderer.html +0 -169
  86. data/doc/StructuredTextRenderer/NullRenderer.html +0 -238
  87. data/doc/StructuredTextRenderer/OrderedListRenderer.html +0 -169
  88. data/doc/StructuredTextRenderer/ParagraphRenderer.html +0 -169
  89. data/doc/StructuredTextRenderer/QuoteRenderer.html +0 -169
  90. data/doc/StructuredTextRenderer/Renderer.html +0 -349
  91. data/doc/StructuredTextRenderer/TextRenderer.html +0 -254
  92. data/doc/StructuredTextRenderer/UnderlineRenderer.html +0 -169
  93. data/doc/StructuredTextRenderer/UnorderedListRenderer.html +0 -169
  94. data/doc/StructuredTextRenderer.html +0 -155
  95. data/doc/_index.html +0 -387
  96. data/doc/class_list.html +0 -51
  97. data/doc/css/common.css +0 -1
  98. data/doc/css/full_list.css +0 -58
  99. data/doc/css/style.css +0 -496
  100. data/doc/file.CHANGELOG.html +0 -91
  101. data/doc/file.LICENSE.html +0 -70
  102. data/doc/file.README.html +0 -170
  103. data/doc/file_list.html +0 -66
  104. data/doc/frames.html +0 -17
  105. data/doc/index.html +0 -170
  106. data/doc/js/app.js +0 -292
  107. data/doc/js/full_list.js +0 -216
  108. data/doc/js/jquery.js +0 -4
  109. data/doc/method_list.html +0 -147
  110. data/doc/top-level-namespace.html +0 -110
  111. data/rich_text_renderer.gemspec +0 -30
  112. data/spec/lib/rich_text_renderer/block_renderers/asset_block_renderer_spec.rb +0 -101
  113. data/spec/lib/rich_text_renderer/block_renderers/asset_hyperlink_renderer_spec.rb +0 -32
  114. data/spec/lib/rich_text_renderer/block_renderers/base_block_renderer_spec.rb +0 -26
  115. data/spec/lib/rich_text_renderer/block_renderers/blockquote_renderer_spec.rb +0 -25
  116. data/spec/lib/rich_text_renderer/block_renderers/entry_block_renderer_spec.rb +0 -15
  117. data/spec/lib/rich_text_renderer/block_renderers/heading_five_renderer_spec.rb +0 -24
  118. data/spec/lib/rich_text_renderer/block_renderers/heading_four_renderer_spec.rb +0 -24
  119. data/spec/lib/rich_text_renderer/block_renderers/heading_one_renderer_spec.rb +0 -24
  120. data/spec/lib/rich_text_renderer/block_renderers/heading_six_renderer_spec.rb +0 -24
  121. data/spec/lib/rich_text_renderer/block_renderers/heading_three_renderer_spec.rb +0 -24
  122. data/spec/lib/rich_text_renderer/block_renderers/heading_two_renderer_spec.rb +0 -24
  123. data/spec/lib/rich_text_renderer/block_renderers/hr_renderer_spec.rb +0 -13
  124. data/spec/lib/rich_text_renderer/block_renderers/hyperlink_renderer_spec.rb +0 -24
  125. data/spec/lib/rich_text_renderer/block_renderers/list_item_renderer_spec.rb +0 -24
  126. data/spec/lib/rich_text_renderer/block_renderers/ordered_list_renderer_spec.rb +0 -56
  127. data/spec/lib/rich_text_renderer/block_renderers/paragraph_renderer_spec.rb +0 -30
  128. data/spec/lib/rich_text_renderer/block_renderers/unordered_list_renderer_spec.rb +0 -56
  129. data/spec/lib/rich_text_renderer/document_renderers/document_renderer_spec.rb +0 -42
  130. data/spec/lib/rich_text_renderer/null_renderer_spec.rb +0 -19
  131. data/spec/lib/rich_text_renderer/renderer_spec.rb +0 -308
  132. data/spec/lib/rich_text_renderer/text_renderers/base_inline_renderer_spec.rb +0 -11
  133. data/spec/lib/rich_text_renderer/text_renderers/bold_renderer_spec.rb +0 -11
  134. data/spec/lib/rich_text_renderer/text_renderers/code_renderer_spec.rb +0 -11
  135. data/spec/lib/rich_text_renderer/text_renderers/italic_renderer_spec.rb +0 -11
  136. data/spec/lib/rich_text_renderer/text_renderers/text_renderer_spec.rb +0 -65
  137. data/spec/lib/rich_text_renderer/text_renderers/underline_renderer_spec.rb +0 -11
  138. data/spec/spec_helper.rb +0 -105
data/doc/file.README.html DELETED
@@ -1,170 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>
7
- File: README
8
-
9
- &mdash; Documentation by YARD 0.9.16
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- pathId = "README";
19
- relpath = '';
20
- </script>
21
-
22
-
23
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
-
25
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
-
27
-
28
- </head>
29
- <body>
30
- <div class="nav_wrap">
31
- <iframe id="nav" src="file_list.html?1"></iframe>
32
- <div id="resizer"></div>
33
- </div>
34
-
35
- <div id="main" tabindex="-1">
36
- <div id="header">
37
- <div id="menu">
38
-
39
- <a href="_index.html">Index</a> &raquo;
40
- <span class="title">File: README</span>
41
-
42
- </div>
43
-
44
- <div id="search">
45
-
46
- <a class="full_list_link" id="class_list_link"
47
- href="class_list.html">
48
-
49
- <svg width="24" height="24">
50
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
51
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
52
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
53
- </svg>
54
- </a>
55
-
56
- </div>
57
- <div class="clear"></div>
58
- </div>
59
-
60
- <div id="content"><div id='filecontents'>
61
- <h1 id="label-Contentful+Rich+Text+Renderer">Contentful Rich Text Renderer</h1>
62
-
63
- <p><a href="https://www.contentful.com">Contentful</a> provides a content
64
- infrastructure for digital teams to power content in websites, apps, and
65
- devices. Unlike a CMS, Contentful was built to integrate with the modern
66
- software stack. It offers a central hub for structured content, powerful
67
- management and delivery APIs, and a customizable web app that enable
68
- developers and content creators to ship digital products faster.</p>
69
-
70
- <p>This library provides rendering capabilities for the <code>RichText</code>
71
- field type. It is recommended to be used alongside the <a
72
- href="https://www.github.com/contentful/contentful.rb">Contentful Delivery
73
- SDK</a>. By default this library will serialize <code>RichText</code>
74
- fields into it&#39;s corresponding HTML representation. All behaviour can
75
- be overridden to serialize to different formats.</p>
76
-
77
- <h2 id="label-Installation">Installation</h2>
78
-
79
- <p>Install Contentful Rich Text Renderer from RubyGems:</p>
80
-
81
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='id identifier rubyid_install'>install</span> <span class='id identifier rubyid_rich_text_renderer'>rich_text_renderer</span>
82
- </code></pre>
83
-
84
- <h2 id="label-Usage">Usage</h2>
85
-
86
- <p>Create a renderer:</p>
87
-
88
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>rich_text_renderer</span><span class='tstring_end'>&#39;</span></span>
89
-
90
- <span class='id identifier rubyid_renderer'>renderer</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="RichTextRenderer.html" title="RichTextRenderer (module)">RichTextRenderer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="RichTextRenderer/Renderer.html" title="RichTextRenderer::Renderer (class)">Renderer</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="RichTextRenderer/Renderer.html#initialize-instance_method" title="RichTextRenderer::Renderer#initialize (method)">new</a></span></span>
91
- </code></pre>
92
-
93
- <p>Render your document:</p>
94
-
95
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_renderer'>renderer</span><span class='period'>.</span><span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='id identifier rubyid_document'>document</span><span class='rparen'>)</span>
96
- </code></pre>
97
-
98
- <h2 id="label-Using+different+renderers">Using different renderers</h2>
99
-
100
- <p>There are many cases in which HTML serialization is not what you want.
101
- Therefore, all renderers are overridable when creating a
102
- <code>RichTextRenderer</code>.</p>
103
-
104
- <p>Also, if you&#39;re planning to embed entries within your rich text,
105
- overriding the <code>&#39;embedded-entry-block&#39;</code> mapping is a
106
- must, as by default it only does
107
- <code>&lt;div&gt;#{entry.to_s}&lt;/div&gt;</code>.</p>
108
-
109
- <p>You can override the configuration like follows:</p>
110
-
111
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_renderer'>renderer</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="RichTextRenderer.html" title="RichTextRenderer (module)">RichTextRenderer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="RichTextRenderer/Renderer.html" title="RichTextRenderer::Renderer (class)">Renderer</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="RichTextRenderer/Renderer.html#initialize-instance_method" title="RichTextRenderer::Renderer#initialize (method)">new</a></span></span><span class='lparen'>(</span>
112
- <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>embedded-entry-block</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='const'>MyEntryBlockRenderer</span>
113
- <span class='rparen'>)</span>
114
- </code></pre>
115
-
116
- <p>Where <code>MyEntryBlockRenderer</code> requires to have a
117
- <code>#render(node)</code> method and needs to return a string.</p>
118
-
119
- <p>An example entry renderer, assuming our entry has 2 fields called
120
- <code>name</code> and <code>description</code> could be:</p>
121
-
122
- <pre class="code ruby"><code class="ruby"><span class='kw'>class</span> <span class='const'>MyEntryBlockRenderer</span> <span class='op'>&lt;</span> <span class='const'><span class='object_link'><a href="RichTextRenderer.html" title="RichTextRenderer (module)">RichTextRenderer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="RichTextRenderer/BaseNodeRenderer.html" title="RichTextRenderer::BaseNodeRenderer (class)">BaseNodeRenderer</a></span></span>
123
- <span class='kw'>def</span> <span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
124
- <span class='id identifier rubyid_entry'>entry</span> <span class='op'>=</span> <span class='id identifier rubyid_node'>node</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>data</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
125
-
126
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;div class=&#39;my-entry&#39;&gt;&lt;h3&gt;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>&lt;/h3&gt;&lt;p&gt;&lt;small&gt;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_description'>description</span><span class='embexpr_end'>}</span><span class='tstring_content'>&lt;/p&gt;&lt;/small&gt;&lt;/div&gt;</span><span class='tstring_end'>&quot;</span></span>
127
- <span class='kw'>end</span>
128
- <span class='kw'>end</span>
129
- </code></pre>
130
-
131
- <h2 id="label-Dealing+with+unknown+node+types">Dealing with unknown node types</h2>
132
-
133
- <p>By default, this gem will treat all unknown node types as errors and will
134
- raise an exception letting the user know which node mapping is missing. If
135
- you wish to remove this behaviour then replace the <code>nil</code> key of
136
- the mapping with a NullRenderer that returns an empty string, or something
137
- similar.</p>
138
-
139
- <p>An example would be like follows:</p>
140
-
141
- <pre class="code ruby"><code class="ruby"><span class='kw'>class</span> <span class='const'>SilentNullRenderer</span> <span class='op'>&lt;</span> <span class='const'><span class='object_link'><a href="RichTextRenderer.html" title="RichTextRenderer (module)">RichTextRenderer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="RichTextRenderer/BaseNodeRenderer.html" title="RichTextRenderer::BaseNodeRenderer (class)">BaseNodeRenderer</a></span></span>
142
- <span class='kw'>def</span> <span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
143
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span>
144
- <span class='kw'>end</span>
145
- <span class='kw'>end</span>
146
-
147
- <span class='id identifier rubyid_renderer'>renderer</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="RichTextRenderer.html" title="RichTextRenderer (module)">RichTextRenderer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="RichTextRenderer/Renderer.html" title="RichTextRenderer::Renderer (class)">Renderer</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="RichTextRenderer/Renderer.html#initialize-instance_method" title="RichTextRenderer::Renderer#initialize (method)">new</a></span></span><span class='lparen'>(</span>
148
- <span class='kw'>nil</span> <span class='op'>=&gt;</span> <span class='const'>SilentNullRenderer</span>
149
- <span class='rparen'>)</span>
150
- </code></pre>
151
-
152
- <h2 id="label-License">License</h2>
153
-
154
- <p>Copyright © 2018 Contentful GmbH. See <a href="./LICENSE">LICENSE</a> for
155
- further details.</p>
156
-
157
- <h2 id="label-Contributing">Contributing</h2>
158
-
159
- <p>Feel free to improve this tool by submitting a Pull Request.</p>
160
- </div></div>
161
-
162
- <div id="footer">
163
- Generated on Mon Oct 15 14:58:22 2018 by
164
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
165
- 0.9.16 (ruby-2.5.1).
166
- </div>
167
-
168
- </div>
169
- </body>
170
- </html>
data/doc/file_list.html DELETED
@@ -1,66 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
5
- <meta charset="utf-8" />
6
-
7
- <link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
8
-
9
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
10
-
11
-
12
-
13
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
14
-
15
- <script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
16
-
17
-
18
- <title>File List</title>
19
- <base id="base_target" target="_parent" />
20
- </head>
21
- <body>
22
- <div id="content">
23
- <div class="fixed_header">
24
- <h1 id="full_list_header">File List</h1>
25
- <div id="full_list_nav">
26
-
27
- <span><a target="_self" href="class_list.html">
28
- Classes
29
- </a></span>
30
-
31
- <span><a target="_self" href="method_list.html">
32
- Methods
33
- </a></span>
34
-
35
- <span><a target="_self" href="file_list.html">
36
- Files
37
- </a></span>
38
-
39
- </div>
40
-
41
- <div id="search">Search: <input type="text" /></div>
42
- </div>
43
-
44
- <ul id="full_list" class="file">
45
-
46
-
47
- <li id="object_README" class="odd">
48
- <div class="item"><span class="object_link"><a href="index.html" title="README">README</a></span></div>
49
- </li>
50
-
51
-
52
- <li id="object_CHANGELOG" class="even">
53
- <div class="item"><span class="object_link"><a href="file.CHANGELOG.html" title="CHANGELOG">CHANGELOG</a></span></div>
54
- </li>
55
-
56
-
57
- <li id="object_LICENSE" class="odd">
58
- <div class="item"><span class="object_link"><a href="file.LICENSE.html" title="LICENSE">LICENSE</a></span></div>
59
- </li>
60
-
61
-
62
-
63
- </ul>
64
- </div>
65
- </body>
66
- </html>
data/doc/frames.html DELETED
@@ -1,17 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Documentation by YARD 0.9.16</title>
6
- </head>
7
- <script type="text/javascript" charset="utf-8">
8
- var match = unescape(window.location.hash).match(/^#!(.+)/);
9
- var name = match ? match[1] : 'index.html';
10
- name = name.replace(/^(\w+):\/\//, '').replace(/^\/\//, '');
11
- window.top.location = name;
12
- </script>
13
- <noscript>
14
- <h1>Oops!</h1>
15
- <h2>YARD requires JavaScript!</h2>
16
- </noscript>
17
- </html>
data/doc/index.html DELETED
@@ -1,170 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>
7
- File: README
8
-
9
- &mdash; Documentation by YARD 0.9.16
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- pathId = "README";
19
- relpath = '';
20
- </script>
21
-
22
-
23
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
-
25
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
-
27
-
28
- </head>
29
- <body>
30
- <div class="nav_wrap">
31
- <iframe id="nav" src="class_list.html?1"></iframe>
32
- <div id="resizer"></div>
33
- </div>
34
-
35
- <div id="main" tabindex="-1">
36
- <div id="header">
37
- <div id="menu">
38
-
39
- <a href="_index.html">Index</a> &raquo;
40
- <span class="title">File: README</span>
41
-
42
- </div>
43
-
44
- <div id="search">
45
-
46
- <a class="full_list_link" id="class_list_link"
47
- href="class_list.html">
48
-
49
- <svg width="24" height="24">
50
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
51
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
52
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
53
- </svg>
54
- </a>
55
-
56
- </div>
57
- <div class="clear"></div>
58
- </div>
59
-
60
- <div id="content"><div id='filecontents'>
61
- <h1 id="label-Contentful+Rich+Text+Renderer">Contentful Rich Text Renderer</h1>
62
-
63
- <p><a href="https://www.contentful.com">Contentful</a> provides a content
64
- infrastructure for digital teams to power content in websites, apps, and
65
- devices. Unlike a CMS, Contentful was built to integrate with the modern
66
- software stack. It offers a central hub for structured content, powerful
67
- management and delivery APIs, and a customizable web app that enable
68
- developers and content creators to ship digital products faster.</p>
69
-
70
- <p>This library provides rendering capabilities for the <code>RichText</code>
71
- field type. It is recommended to be used alongside the <a
72
- href="https://www.github.com/contentful/contentful.rb">Contentful Delivery
73
- SDK</a>. By default this library will serialize <code>RichText</code>
74
- fields into it&#39;s corresponding HTML representation. All behaviour can
75
- be overridden to serialize to different formats.</p>
76
-
77
- <h2 id="label-Installation">Installation</h2>
78
-
79
- <p>Install Contentful Rich Text Renderer from RubyGems:</p>
80
-
81
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='id identifier rubyid_install'>install</span> <span class='id identifier rubyid_rich_text_renderer'>rich_text_renderer</span>
82
- </code></pre>
83
-
84
- <h2 id="label-Usage">Usage</h2>
85
-
86
- <p>Create a renderer:</p>
87
-
88
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>rich_text_renderer</span><span class='tstring_end'>&#39;</span></span>
89
-
90
- <span class='id identifier rubyid_renderer'>renderer</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="RichTextRenderer.html" title="RichTextRenderer (module)">RichTextRenderer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="RichTextRenderer/Renderer.html" title="RichTextRenderer::Renderer (class)">Renderer</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="RichTextRenderer/Renderer.html#initialize-instance_method" title="RichTextRenderer::Renderer#initialize (method)">new</a></span></span>
91
- </code></pre>
92
-
93
- <p>Render your document:</p>
94
-
95
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_renderer'>renderer</span><span class='period'>.</span><span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='id identifier rubyid_document'>document</span><span class='rparen'>)</span>
96
- </code></pre>
97
-
98
- <h2 id="label-Using+different+renderers">Using different renderers</h2>
99
-
100
- <p>There are many cases in which HTML serialization is not what you want.
101
- Therefore, all renderers are overridable when creating a
102
- <code>RichTextRenderer</code>.</p>
103
-
104
- <p>Also, if you&#39;re planning to embed entries within your rich text,
105
- overriding the <code>&#39;embedded-entry-block&#39;</code> mapping is a
106
- must, as by default it only does
107
- <code>&lt;div&gt;#{entry.to_s}&lt;/div&gt;</code>.</p>
108
-
109
- <p>You can override the configuration like follows:</p>
110
-
111
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_renderer'>renderer</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="RichTextRenderer.html" title="RichTextRenderer (module)">RichTextRenderer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="RichTextRenderer/Renderer.html" title="RichTextRenderer::Renderer (class)">Renderer</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="RichTextRenderer/Renderer.html#initialize-instance_method" title="RichTextRenderer::Renderer#initialize (method)">new</a></span></span><span class='lparen'>(</span>
112
- <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>embedded-entry-block</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='const'>MyEntryBlockRenderer</span>
113
- <span class='rparen'>)</span>
114
- </code></pre>
115
-
116
- <p>Where <code>MyEntryBlockRenderer</code> requires to have a
117
- <code>#render(node)</code> method and needs to return a string.</p>
118
-
119
- <p>An example entry renderer, assuming our entry has 2 fields called
120
- <code>name</code> and <code>description</code> could be:</p>
121
-
122
- <pre class="code ruby"><code class="ruby"><span class='kw'>class</span> <span class='const'>MyEntryBlockRenderer</span> <span class='op'>&lt;</span> <span class='const'><span class='object_link'><a href="RichTextRenderer.html" title="RichTextRenderer (module)">RichTextRenderer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="RichTextRenderer/BaseNodeRenderer.html" title="RichTextRenderer::BaseNodeRenderer (class)">BaseNodeRenderer</a></span></span>
123
- <span class='kw'>def</span> <span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
124
- <span class='id identifier rubyid_entry'>entry</span> <span class='op'>=</span> <span class='id identifier rubyid_node'>node</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>data</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
125
-
126
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt;div class=&#39;my-entry&#39;&gt;&lt;h3&gt;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>&lt;/h3&gt;&lt;p&gt;&lt;small&gt;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_description'>description</span><span class='embexpr_end'>}</span><span class='tstring_content'>&lt;/p&gt;&lt;/small&gt;&lt;/div&gt;</span><span class='tstring_end'>&quot;</span></span>
127
- <span class='kw'>end</span>
128
- <span class='kw'>end</span>
129
- </code></pre>
130
-
131
- <h2 id="label-Dealing+with+unknown+node+types">Dealing with unknown node types</h2>
132
-
133
- <p>By default, this gem will treat all unknown node types as errors and will
134
- raise an exception letting the user know which node mapping is missing. If
135
- you wish to remove this behaviour then replace the <code>nil</code> key of
136
- the mapping with a NullRenderer that returns an empty string, or something
137
- similar.</p>
138
-
139
- <p>An example would be like follows:</p>
140
-
141
- <pre class="code ruby"><code class="ruby"><span class='kw'>class</span> <span class='const'>SilentNullRenderer</span> <span class='op'>&lt;</span> <span class='const'><span class='object_link'><a href="RichTextRenderer.html" title="RichTextRenderer (module)">RichTextRenderer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="RichTextRenderer/BaseNodeRenderer.html" title="RichTextRenderer::BaseNodeRenderer (class)">BaseNodeRenderer</a></span></span>
142
- <span class='kw'>def</span> <span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='id identifier rubyid_node'>node</span><span class='rparen'>)</span>
143
- <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span>
144
- <span class='kw'>end</span>
145
- <span class='kw'>end</span>
146
-
147
- <span class='id identifier rubyid_renderer'>renderer</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="RichTextRenderer.html" title="RichTextRenderer (module)">RichTextRenderer</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="RichTextRenderer/Renderer.html" title="RichTextRenderer::Renderer (class)">Renderer</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="RichTextRenderer/Renderer.html#initialize-instance_method" title="RichTextRenderer::Renderer#initialize (method)">new</a></span></span><span class='lparen'>(</span>
148
- <span class='kw'>nil</span> <span class='op'>=&gt;</span> <span class='const'>SilentNullRenderer</span>
149
- <span class='rparen'>)</span>
150
- </code></pre>
151
-
152
- <h2 id="label-License">License</h2>
153
-
154
- <p>Copyright © 2018 Contentful GmbH. See <a href="./LICENSE">LICENSE</a> for
155
- further details.</p>
156
-
157
- <h2 id="label-Contributing">Contributing</h2>
158
-
159
- <p>Feel free to improve this tool by submitting a Pull Request.</p>
160
- </div></div>
161
-
162
- <div id="footer">
163
- Generated on Mon Oct 15 14:58:22 2018 by
164
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
165
- 0.9.16 (ruby-2.5.1).
166
- </div>
167
-
168
- </div>
169
- </body>
170
- </html>