Closed paulp closed 6 years ago
So it looks like maybe the whitespace margin is configurable? But if so, please consider this a request for a more reasonable default setting.
Using scrollbars is actually not supported right now as it would not play well with exporting pdfs. You should consider to distribute the code across several slides. Reveal.js supports vertical slides, which would work well for this. You can partition your code by marking snippets.
...
/// begin #monadic-adt
sealed trait Monadic[F[X], A]
...
/// end #monadic-adt
...
And then include it like this in your slides
<code class="hidden" src="como.scala"></code>
<section>
<section>
<code class="condense" src="#monadic-adt">
</section>
<section>
<code class="condense" src="#monadic-infix">
</section>
...
</section>
You can compress the code a little bit by adding the condense
class, which reduces the font size. Of course you can also apply your own styling with css.
The whitespace is due to the fact, that I had to disable the automatic zoom of reveal.js, since it is not compatible with CodeMirror. (It applys css transforms, which destroys CodeMirror's assumptions on layout) The way to go right now is to adjust zoom levels manually by using your browser controls. (Usually Cmd++
, Cmd+-
)
Documentation and guidance on this issue will be added to the documentation and I will include automatic messages for non-optimal zoom levels in the browser. Unfortunately it is not possible to adjust zoom level with javascript so it will require user interaction.
At some point in the future, there will be an electron-based user interface for cobra, which will solve these issues.
To be clear, changing zoom level doesn't affect the whitespace. If anything it makes it worse, because the smaller font means that much more text is not being displayed. Here's a screenshot zoomed out as far as safari will allow.
You have to zoom in, to get rid of the whitespace, not out. The slide is centered and your code is too large to fit, so it stands out over the bottom and the right border. (Which are invisible with the default theme, you are using)
Am 24.06.2016 um 18:05 schrieb Paul Phillips notifications@github.com:
To be clear, changing zoom level doesn't affect the whitespace. If anything it makes it worse, because the smaller font means that much more text is not being displayed. Here's a screenshot zoomed out as far as safari will allow.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Ooooh, that makes more sense. Thanks.
This seems to be confusing for most users. Need to either
With a slides.html containing
Where como.scala contains the code sample from #18, both safari and chrome render it like this:
I am not sure what is up with the huge whitespace margin at the top and left, but it would be great to reclaim it. It's also anywhere from difficult to impossible to view and modify the code which doesn't fit on screen. There's no scrollbar; mouse scroll doesn't work; selecting into the text and dragging past the end of the window does move us downward while I pull, but as soon as I let go - or when I reach the end of the file - it bounces back up to only display the initial lines.