Skip to content
Snippets Groups Projects
  • Alyssa Ross's avatar
    e03483d8
    Improve display of AsciiDoc examples with titles (#944) · e03483d8
    Alyssa Ross authored
    
    The jekyll-asciidoc plugin will take AsciiDoc markup like this:
    
    	.A method that returns the string "Hello, world"
    	[example]
    	[source,ruby]
    	----
    	def hello
    	  "Hello, world"
    	end
    	----
    
    And produce HTML like this (syntax highlighting disabled):
    
    	<div class="listingblock">
    	  <div class="title">A method that returns the string "Hello, world"</div>
    	  <div class="content">
    	    <pre class="highlight"><code class="language-ruby" data-lang="ruby">def hello
    	  "Hello, world"
    	end</code></pre>
    	  </div>
    	</div>
    
    Previously, because we were applying code block styling to the whole
    listingblock, the title would be rendered as normal body text, inside
    the code block, which did not look good.  With this change, it will
    instead be rendered similarly to a Just The Docs rendered example —
    the title will appear where the rendered example usually would.
    
    Co-authored-by: default avatarMatt Wang <matt@matthewwang.me>
    Improve display of AsciiDoc examples with titles (#944)
    Alyssa Ross authored
    
    The jekyll-asciidoc plugin will take AsciiDoc markup like this:
    
    	.A method that returns the string "Hello, world"
    	[example]
    	[source,ruby]
    	----
    	def hello
    	  "Hello, world"
    	end
    	----
    
    And produce HTML like this (syntax highlighting disabled):
    
    	<div class="listingblock">
    	  <div class="title">A method that returns the string "Hello, world"</div>
    	  <div class="content">
    	    <pre class="highlight"><code class="language-ruby" data-lang="ruby">def hello
    	  "Hello, world"
    	end</code></pre>
    	  </div>
    	</div>
    
    Previously, because we were applying code block styling to the whole
    listingblock, the title would be rendered as normal body text, inside
    the code block, which did not look good.  With this change, it will
    instead be rendered similarly to a Just The Docs rendered example —
    the title will appear where the rendered example usually would.
    
    Co-authored-by: default avatarMatt Wang <matt@matthewwang.me>