diff --git a/Gemfile b/Gemfile index 4b692fd..89c3179 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ source 'https://rubygems.org' gem 'asciidoctor', '2.0.10' +gem 'concurrent-ruby', '1.1.7' +gem 'tilt', '2.0.10' diff --git a/Gemfile.lock b/Gemfile.lock index 8972e7d..85d3d5d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,12 +2,16 @@ GEM remote: https://rubygems.org/ specs: asciidoctor (2.0.10) + concurrent-ruby (1.1.7) + tilt (2.0.10) PLATFORMS ruby DEPENDENCIES asciidoctor (= 2.0.10) + concurrent-ruby (= 1.1.7) + tilt (= 2.0.10) BUNDLED WITH 2.0.2 diff --git a/Makefile b/Makefile index 60dca3f..3b63ba1 100644 --- a/Makefile +++ b/Makefile @@ -12,12 +12,14 @@ else MEDIA_CMD = -a china-dictatorship-media-base='$(MEDIA)' endif -$(OUT): README.adoc $(HEAD) $(FOOT) +$(OUT): README.adoc $(HEAD) $(FOOT) template_dir/* bundle exec asciidoctor \ $(MEDIA_CMD) \ --embedded \ --failure-level info \ -o $(BODY) \ + --template-dir template_dir \ + --trace \ -v \ '$<' cat $(HEAD) $(BODY) $(FOOT) > '$@' diff --git a/README.adoc b/README.adoc index 1450b36..d9ed096 100644 --- a/README.adoc +++ b/README.adoc @@ -2678,7 +2678,7 @@ Self made video shows the ex-model chained to a bed in a camp. Text messages giv Text messages and translation: https://medium.com/@millwarj/wear-your-mask-under-your-hood-an-account-of-prisoner-abuse-in-xinjiang-during-the-2020-3007a1f7437d ++++ - + ++++ [[other-islam-countries-speak-up-for-uyghur]] diff --git a/template_dir/block_image.html.erb b/template_dir/block_image.html.erb new file mode 100644 index 0000000..dbc7fbe --- /dev/null +++ b/template_dir/block_image.html.erb @@ -0,0 +1,15 @@ +<%#encoding:UTF-8%> class="<%= ['imageblock',@style,role].compact * ' ' %>"<% +if (attr? :align) || (attr? :float) +%> style="<%= [("text-align: #{attr :align};" if attr? :align),("float: #{attr :float};" if attr? :float)].compact * ' ' %>"<% +end %>> +
<% +if attr? :link %> +<%= attr :alt %><%= (attr? :height) ? %( height="#{attr :height}") : nil %>><% +else %> +<%= attr :alt %><%= (attr? :height) ? %( height="#{attr :height}") : nil %>><% +end %> +
<% +if title? %> +
<%= captioned_title %>
<% +end %> + diff --git a/template_dir/block_video.html.erb b/template_dir/block_video.html.erb new file mode 100644 index 0000000..4eabcb7 --- /dev/null +++ b/template_dir/block_video.html.erb @@ -0,0 +1,34 @@ +<%#encoding:UTF-8%> class="<%= ['videoblock',@style,role].compact * ' ' %>"><% +if title? %> +
<%= captioned_title %>
<% +end %> +
<% +case attr :poster +when 'vimeo' + start_anchor = (attr? :start) ? %(#at=#{attr :start}) : nil + delimiter = '?' + autoplay_param = (option? :autoplay) ? %(#{delimiter}autoplay=1) : nil + delimiter = '&' if autoplay_param + loop_param = (option? :loop) ? %(#{delimiter}loop=1) : nil + src = %(//player.vimeo.com/video/#{attr :target}#{start_anchor}#{autoplay_param}#{loop_param}) %> +<%= (attr? :height) ? %( height="#{attr :height}") : nil %> src="<%= src %>" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen><% +when 'youtube' + params = ['rel=0'] + params << %(start=#{attr :start}) if attr? :start + params << %(end=#{attr :end}) if attr? :end + params << 'autoplay=1' if option? :autoplay + params << 'loop=1' if option? :loop + params << 'controls=0' if option? :nocontrols + src = %(//www.youtube.com/embed/#{attr :target}?#{params * '&'}) %> +<% +else %> +<% +end %> +
+