On windows, the 'unixFilter' function used window's 'createProcess'
function to create the external process that will filter some String
input. The problem with this is that it is unable to execute batch
stubs (eg. anything created using 'gem install ...') even if its in
$PATH. Anyways a solution to this issue is to execute the batch file
explicitly using 'cmd /c batchfile' but there is no rational way to know
where said batchfile is on the system. My solution is to detect windows
using the System.Info module and then instead of using 'proc' to create
the function, use 'shell' instead which will be able to execute
everything 'proc' can + batch files.
Inspired by: http://www.blaenkdenum.com/posts/the-switch-to-hakyll/#scss
Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
The old test returns an exit code of 1 whenever the number of
errors is >= 0, which should always be the case. The fix replaces
this with a test whether the number of errors is strictly > 0.
I have moved the blog to blog.darkfox.id.au, hosting it on github for performance and darkfox.id.au (optionally with ssl), will include a /blog mirror and be more or less a front-page with my links / stats. (Not setup just yet)
Below is the generated HTML for with line numbers and without line numbers, respectively.
```html
<!-- Without line numbers -->
<pre class="sourceCode scala">
<code class="sourceCode scala">
<span class="kw">trait</span>
Monad[M[_]]
</code>
</pre>
<!-- With line numbers -->
<table class="sourceCode scala numberLines">
<tr class="sourceCode">
<td class="lineNumbers">
<pre>1</pre>
</td>
<td class="sourceCode">
<pre>
<code class="sourceCode scala">
<span class="kw">trait</span>
Monad[M[_]]
</code>
</pre>
</td>
</tr>
</table>
```
The markdown used is:
```
~~~~ { .scala }
trait Monad[M[_]]
~~~~
~~~~ { .scala .numberLines}
trait Monad[M[_]]
~~~~
```
Notice that without line numbers the outer `pre` has a `sourceCode` class whereas with line numbers the `sourceCode` class is only put in `code` and table-related tags.
In the original `syntax.css` file synax highlighting was only triggered if the `kw` and friends tags were within a `pre.sourceCode` - that means it did not trigger with line numbers. This change removes the requirement for the `pre` prefix so that highlighting is triggered with or without line numbers, so long as the code is within *some* `.sourceCode` tag.