tests: Changing syntax theme

This commit is contained in:
Ed Page 2017-07-26 20:04:53 -06:00
parent 043240c61a
commit be782b5d13
4 changed files with 47 additions and 0 deletions

View file

@ -0,0 +1,2 @@
syntax-highlight:
theme: Solarized (light)

View file

@ -0,0 +1,23 @@
This is a rust markdown-inline-example
```rust
fn hello() -> bool {
true
}
```
{% highlight rust %}
pub struct World {
virtual: bool
}
fn create(virtual: bool) -> World {
World{virtual: virtual}
}
{% endhighlight %}

View file

@ -146,7 +146,10 @@ pub fn custom_template_extensions() {
#[cfg(feature = "syntax-highlight")]
#[test]
pub fn syntax_highlight() {
// Syntect isn't thread safe, for now run everything in the same test.
run_test("syntax_highlight").expect("Build error");
run_test("syntax_highlight_theme").expect("Build error");
}
#[test]

View file

@ -0,0 +1,19 @@
<p>This is a rust markdown-inline-example</p>
<pre style="background-color:#fdf6e3">
<span style="background-color:#fdf6e3;color:#657b83;">
</span><span style="background-color:#fdf6e3;color:#268bd2;">fn</span><span style="background-color:#fdf6e3;color:#657b83;"> </span><span style="background-color:#fdf6e3;color:#b58900;">hello</span><span style="background-color:#fdf6e3;color:#657b83;">(</span><span style="background-color:#fdf6e3;color:#657b83;">)</span><span style="background-color:#fdf6e3;color:#657b83;"> </span><span style="background-color:#fdf6e3;color:#657b83;">-&gt;</span><span style="background-color:#fdf6e3;color:#657b83;"> </span><span style="background-color:#fdf6e3;color:#268bd2;">bool</span><span style="background-color:#fdf6e3;color:#657b83;"> </span><span style="background-color:#fdf6e3;color:#657b83;">{</span><span style="background-color:#fdf6e3;color:#657b83;">
</span><span style="background-color:#fdf6e3;color:#657b83;"> </span><span style="background-color:#fdf6e3;color:#b58900;">true</span><span style="background-color:#fdf6e3;color:#657b83;">
</span><span style="background-color:#fdf6e3;color:#657b83;">}</span><span style="background-color:#fdf6e3;color:#657b83;">
</span><span style="background-color:#fdf6e3;color:#657b83;">
</span></pre><pre style="background-color:#fdf6e3;">
<span style="color:#859900;">pub</span><span style="color:#657b83;"> </span><span style="color:#268bd2;">struct</span><span style="color:#657b83;"> </span><span style="color:#657b83;">World</span><span style="color:#657b83;"> </span><span style="color:#657b83;">{</span>
<span style="color:#657b83;"> </span><span style="color:#268bd2;">virtual</span><span style="color:#657b83;">:</span><span style="color:#657b83;"> </span><span style="color:#268bd2;">bool</span>
<span style="color:#657b83;">}</span>
<span style="color:#268bd2;">fn</span><span style="color:#657b83;"> </span><span style="color:#b58900;">create</span><span style="color:#657b83;">(</span><span style="color:#268bd2;">virtual</span><span style="color:#657b83;">:</span><span style="color:#657b83;"> </span><span style="color:#268bd2;">bool</span><span style="color:#657b83;">)</span><span style="color:#657b83;"> </span><span style="color:#657b83;">-&gt;</span><span style="color:#657b83;"> World</span><span style="color:#657b83;"> </span><span style="color:#657b83;">{</span>
<span style="color:#657b83;"> World</span><span style="color:#657b83;">{</span><span style="background-color:#ec9489;color:#657b83;">virtual</span><span style="color:#657b83;">:</span><span style="color:#657b83;"> </span><span style="background-color:#ec9489;color:#657b83;">virtual</span><span style="color:#657b83;">}</span>
<span style="color:#657b83;">}</span>
</pre>