Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cosmetic improvements to callout lists #335

Merged
merged 4 commits into from
Feb 14, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion examples/source-emphasis.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

== Using Asciidoctor features

Using bold markers and `subs="+quotes,+macros"` attribute
=== Bold markers and `subs="+quotes,+macros"` attribute

[source,java,subs="+quotes,+macros"]
----
Expand All @@ -23,6 +23,17 @@ protected void configure(HttpSecurity http) throws Exception {
.permitAll();
----

=== Callouts

[source, rust]
----
fn main() {
println!("Hello World!"); // <1>
}
----
<1> `println!` is a macro.


== Using reveal.js <mark> tags

Needs `subs="none"` attribute
Expand Down
10 changes: 10 additions & 0 deletions templates/asciidoctor-compatibility.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-bl
pre .conum[data-value]{position:relative;top:-.125em}
b.conum *{color:inherit!important}
.conum:not([data-value]):empty{display:none}
/* callout lists */
.hdlist>table,.colist>table{border:0;background:none}
.hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none}
td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em}
td.hdlist1{font-weight:bold;padding-bottom:1.25em}
/* .literalblock+.colist,.listingblock+.colist{margin-top:-.5em} */
.colist td:not([class]):first-child{padding:.4em .75em 0;line-height:1;vertical-align:top}
.colist td:not([class]):first-child img{max-width:none}
.colist td:not([class]):last-child{padding:.25em 0}

/* Override Asciidoctor CSS that causes issues with reveal.js features */
.reveal .hljs table{border: 0}
.reveal .colist>table th, .reveal .colist>table td {border-bottom:0}
41 changes: 32 additions & 9 deletions test/doctest/source-emphasis.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
<section class="title" data-state="title">
<h1>Source Code Emphasis</h1>
</section>
<section id="_using_asciidoctor_features">
<h2>Using Asciidoctor features</h2>
<div class="paragraph">
<p>Using bold markers and <code>subs="+quotes,+macros"</code> attribute</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java" data-noescape="true">protected void configure(HttpSecurity http) throws Exception {
<section>
<section id="_using_asciidoctor_features">
<h2>Using Asciidoctor features</h2>
</section>
<section id="_bold_markers_and_subsquotesmacros_attribute">
<h2>Bold markers and <code>subs="+quotes,+macros"</code> attribute</h2>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java" data-noescape="true">protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
<strong>.antMatchers("/resources/**").permitAll()</strong>
Expand All @@ -19,8 +20,30 @@ <h2>Using Asciidoctor features</h2>
.formLogin()
.loginPage("/login")
.permitAll();</code></pre>
</div>
</div>
</div>
</section>
<section id="_callouts">
<h2>Callouts</h2>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-rust hljs" data-lang="rust" data-noescape="true">fn main() {
println!("Hello World!"); <i class="conum" data-value="1"></i><b>(1)</b>
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td>
<i class="conum" data-value="1"></i><b>1</b>
</td>
<td>
<code>println!</code> is a macro.</td>
</tr>
</table>
</div>
</section>
</section>
<section id="_using_reveal_js_mark_tags">
<h2>Using reveal.js &lt;mark&gt; tags</h2>
Expand Down