Closed sid-kap closed 8 years ago
Hi @sid-kap ,
```haskell
x = 5
is Markdown syntax which typesets some Haskell code, but it is not actual Haskell code in the sense that you can load it into ghci. Instead, the idea is that in a literate Haskell document you set off Haskell code using "bird tracks", like this:
> x = 5
Such bindings should indeed be in scope in `ghci` blocks. (And they will also be typeset just like a `haskell` block would be.)
Changing the example to
> x = 5
```ghci
:show bindings
does not fix the problem.
Hmm, how about
> x = 5
```ghci
x
Does that work?
Nope
What does it output?
Here is the output:
> x = 5
ghci> :show bindings
it :: () = ()
ghci> x
ghci> print x
That still has :show bindings
in it. Can you try removing that and just put x
by itself in the ghci
block? I suspect that a command like :show bindings
messes up the (very hacky) way that the ghci output gets parsed.
Hmm. I removed all instances of :show bindings
and it still doesn't work. There is no output after x
and print x
.
Strange. Can you paste the exact contents of your .lhs
file and the exact output produced by BlogLiterately
?
test.md
:
> x = 5
```ghci
x
print x
I'm running the command:
stack exec BlogLiteratelyD -- -g test.md > test.html
and the HTML output is
``` html
<pre class="sourceCode haskell"><code class="sourceCode haskell"><span style="">></span> <span style="">x</span> <span style="color: red;">=</span> <span class="hs-num">5</span>
</code></pre>
<pre><code><span style="color: gray;">ghci> </span>x
<span style="color: gray;">ghci> </span>print x</code></pre>
<div id="references" class="references">
</div>
Try naming the file test.lhs
instead of test.md
?
That fixed it. Sorry for the noise!
Ah, good. No worries!
According to the documentation,
This doesn't seem to work for me. The following markdown
x = 5 ghci> :show bindings it :: () = ()