From c3c7ddbda681cc8f44832b0549bb623d3eace748 Mon Sep 17 00:00:00 2001
From: Sarah White <graphitefriction@gmail.com>
Date: Wed, 18 Nov 2020 15:53:10 -0700
Subject: rearchitect modules and filenames and drop asciidoctor folder under
 docs

---
 .../extensions/pages/include-processor.adoc        | 49 ++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 docs/modules/extensions/pages/include-processor.adoc

(limited to 'docs/modules/extensions/pages/include-processor.adoc')

diff --git a/docs/modules/extensions/pages/include-processor.adoc b/docs/modules/extensions/pages/include-processor.adoc
new file mode 100644
index 00000000..8dbdd8e0
--- /dev/null
+++ b/docs/modules/extensions/pages/include-processor.adoc
@@ -0,0 +1,49 @@
+= Include Processor Extension Example
+:navtitle: Include Processor
+
+Purpose::
+Include a file from a URI.
+
+TIP: Asciidoctor supports including content from a URI out of the box if you set the `allow-uri-read` attribute (not available if the safe mode is `secure`).
+
+== sample-with-uri-include.adoc
+
+```
+:source-highlighter: coderay
+
+.Gemfile
+[source,ruby]
+----
+\include::https://raw.githubusercontent.com/asciidoctor/asciidoctor/master/Gemfile[]
+----
+```
+
+== UriIncludeProcessor
+
+```ruby
+require 'asciidoctor'
+require 'asciidoctor/extensions'
+require 'open-uri'
+
+class UriIncludeProcessor < Asciidoctor::Extensions::IncludeProcessor
+  def handles? target
+    (target.start_with? 'http://') or (target.start_with? 'https://')
+  end
+
+  def process doc, reader, target, attributes
+    content = (open target).readlines
+    reader.push_include content, target, target, 1, attributes
+    reader
+  end
+end
+```
+
+== Usage
+
+```ruby
+Asciidoctor::Extensions.register do
+  include_processor UriIncludeProcessor
+end
+
+Asciidoctor.convert_file 'sample-with-uri-include.adoc', :safe => :safe
+```
-- 
cgit v1.2.3


From b5af8e2d8d66d24d9ac03d2bbfac66c74872ac78 Mon Sep 17 00:00:00 2001
From: Dan Allen <dan.j.allen@gmail.com>
Date: Mon, 30 Nov 2020 18:21:31 -0700
Subject: switch fenced code blocks to AsciiDoc source blocks and always set
 language

---
 docs/modules/extensions/pages/include-processor.adoc | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

(limited to 'docs/modules/extensions/pages/include-processor.adoc')

diff --git a/docs/modules/extensions/pages/include-processor.adoc b/docs/modules/extensions/pages/include-processor.adoc
index 8dbdd8e0..be27729a 100644
--- a/docs/modules/extensions/pages/include-processor.adoc
+++ b/docs/modules/extensions/pages/include-processor.adoc
@@ -8,7 +8,8 @@ TIP: Asciidoctor supports including content from a URI out of the box if you set
 
 == sample-with-uri-include.adoc
 
-```
+[source,asciidoc]
+....
 :source-highlighter: coderay
 
 .Gemfile
@@ -16,11 +17,12 @@ TIP: Asciidoctor supports including content from a URI out of the box if you set
 ----
 \include::https://raw.githubusercontent.com/asciidoctor/asciidoctor/master/Gemfile[]
 ----
-```
+....
 
 == UriIncludeProcessor
 
-```ruby
+[source,ruby]
+----
 require 'asciidoctor'
 require 'asciidoctor/extensions'
 require 'open-uri'
@@ -36,14 +38,15 @@ class UriIncludeProcessor < Asciidoctor::Extensions::IncludeProcessor
     reader
   end
 end
-```
+----
 
 == Usage
 
-```ruby
+[source,ruby]
+----
 Asciidoctor::Extensions.register do
   include_processor UriIncludeProcessor
 end
 
 Asciidoctor.convert_file 'sample-with-uri-include.adoc', :safe => :safe
-```
+----
-- 
cgit v1.2.3


From a90f36363994f51fd5bb142942608e9dd7b8dd25 Mon Sep 17 00:00:00 2001
From: Dan Allen <dan.j.allen@gmail.com>
Date: Mon, 30 Nov 2020 18:25:25 -0700
Subject: use Ruby 2 hash syntax in examples

---
 docs/modules/extensions/pages/include-processor.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'docs/modules/extensions/pages/include-processor.adoc')

diff --git a/docs/modules/extensions/pages/include-processor.adoc b/docs/modules/extensions/pages/include-processor.adoc
index be27729a..ee1a220a 100644
--- a/docs/modules/extensions/pages/include-processor.adoc
+++ b/docs/modules/extensions/pages/include-processor.adoc
@@ -48,5 +48,5 @@ Asciidoctor::Extensions.register do
   include_processor UriIncludeProcessor
 end
 
-Asciidoctor.convert_file 'sample-with-uri-include.adoc', :safe => :safe
+Asciidoctor.convert_file 'sample-with-uri-include.adoc', safe: :safe
 ----
-- 
cgit v1.2.3

