article_json 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -1
- data/README.md +30 -18
- data/bin/update_reference_document.sh +0 -4
- data/lib/article_json/article.rb +0 -12
- data/lib/article_json/configuration.rb +4 -4
- data/lib/article_json/elements/heading.rb +0 -1
- data/lib/article_json/elements/image.rb +0 -1
- data/lib/article_json/elements/list.rb +0 -1
- data/lib/article_json/elements/paragraph.rb +1 -1
- data/lib/article_json/elements/quote.rb +0 -1
- data/lib/article_json/elements/text.rb +1 -1
- data/lib/article_json/elements/text_box.rb +0 -1
- data/lib/article_json/export/amp/custom_element_library_resolver.rb +0 -1
- data/lib/article_json/export/amp/elements/embed.rb +42 -30
- data/lib/article_json/export/amp/elements/image.rb +7 -5
- data/lib/article_json/export/amp/exporter.rb +4 -2
- data/lib/article_json/export/apple_news/elements/embed.rb +1 -1
- data/lib/article_json/export/apple_news/elements/image.rb +2 -1
- data/lib/article_json/export/apple_news/elements/paragraph.rb +1 -1
- data/lib/article_json/export/apple_news/elements/text.rb +15 -2
- data/lib/article_json/export/apple_news/exporter.rb +1 -1
- data/lib/article_json/export/common/html/elements/embed.rb +2 -1
- data/lib/article_json/export/common/html/elements/image.rb +2 -1
- data/lib/article_json/export/common/html/elements/text.rb +2 -0
- data/lib/article_json/import/google_doc/html/embedded_parser.rb +1 -0
- data/lib/article_json/import/google_doc/html/heading_parser.rb +5 -5
- data/lib/article_json/import/google_doc/html/image_parser.rb +2 -0
- data/lib/article_json/import/google_doc/html/list_parser.rb +2 -2
- data/lib/article_json/import/google_doc/html/node_analyzer.rb +14 -2
- data/lib/article_json/import/google_doc/html/parser.rb +1 -0
- data/lib/article_json/import/google_doc/html/shared/caption.rb +1 -0
- data/lib/article_json/import/google_doc/html/shared/float.rb +2 -0
- data/lib/article_json/import/google_doc/html/text_box_parser.rb +2 -1
- data/lib/article_json/import/google_doc/html/text_parser.rb +2 -0
- data/lib/article_json/utils/additional_element_placer.rb +2 -0
- data/lib/article_json/utils/o_embed_resolver/base.rb +14 -4
- data/lib/article_json/utils/o_embed_resolver/facebook_video.rb +1 -1
- data/lib/article_json/utils/o_embed_resolver/slideshare.rb +2 -2
- data/lib/article_json/utils/o_embed_resolver/youtube_video.rb +13 -0
- data/lib/article_json/version.rb +1 -1
- data/lib/article_json.rb +0 -11
- metadata +3 -18
- data/bin/article_json_export_facebook.rb +0 -16
- data/lib/article_json/export/facebook_instant_article/elements/base.rb +0 -30
- data/lib/article_json/export/facebook_instant_article/elements/embed.rb +0 -44
- data/lib/article_json/export/facebook_instant_article/elements/heading.rb +0 -11
- data/lib/article_json/export/facebook_instant_article/elements/image.rb +0 -11
- data/lib/article_json/export/facebook_instant_article/elements/list.rb +0 -11
- data/lib/article_json/export/facebook_instant_article/elements/paragraph.rb +0 -11
- data/lib/article_json/export/facebook_instant_article/elements/quote.rb +0 -30
- data/lib/article_json/export/facebook_instant_article/elements/text.rb +0 -11
- data/lib/article_json/export/facebook_instant_article/elements/text_box.rb +0 -40
- data/lib/article_json/export/facebook_instant_article/exporter.rb +0 -17
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
module ArticleJSON
|
|
2
|
-
module Export
|
|
3
|
-
module FacebookInstantArticle
|
|
4
|
-
module Elements
|
|
5
|
-
class TextBox < Base
|
|
6
|
-
include ArticleJSON::Export::Common::HTML::Elements::TextBox
|
|
7
|
-
|
|
8
|
-
# Generate a `<div>` node containing all text box elements and
|
|
9
|
-
# surrounded by an ASCII-art line to the top and bottom
|
|
10
|
-
# @return [Nokogiri::XML::NodeSet]
|
|
11
|
-
def export
|
|
12
|
-
create_element(:div, class: 'text-box') do |div|
|
|
13
|
-
div.add_child(ascii_art_line_node)
|
|
14
|
-
@element.content.each do |child_element|
|
|
15
|
-
div.add_child(base_class.new(child_element).export)
|
|
16
|
-
end
|
|
17
|
-
div.add_child(ascii_art_line_node)
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
private
|
|
22
|
-
|
|
23
|
-
# Returns a paragraph with the `ascii_art_line_text_element`. This
|
|
24
|
-
# gets inserted above and below the text box content
|
|
25
|
-
# @return [Nokogiri::XML::NodeSet]
|
|
26
|
-
def ascii_art_line_node
|
|
27
|
-
create_element(:p) { |p| p.add_child ascii_art_line_text_element }
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# Returns the delimiter of text boxes. Overwrite this method to have a
|
|
31
|
-
# custom text box delimiter
|
|
32
|
-
# @return [String]
|
|
33
|
-
def ascii_art_line_text_element
|
|
34
|
-
'────────'
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
module ArticleJSON
|
|
2
|
-
module Export
|
|
3
|
-
module FacebookInstantArticle
|
|
4
|
-
class Exporter
|
|
5
|
-
include ArticleJSON::Export::Common::HTML::Exporter
|
|
6
|
-
|
|
7
|
-
class << self
|
|
8
|
-
# Return the module namespace this class is nested in
|
|
9
|
-
# @return [Module]
|
|
10
|
-
def namespace
|
|
11
|
-
ArticleJSON::Export::FacebookInstantArticle
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|