learnr
learnr copied to clipboard
setting the font size of ace editor
Hi !
I'm looking for a proper way to change the exercise editor (ace editor) font size as I need to use my tutorial in a classroom.
I've tried by adding this html code right after the YAML header of my rmarkdown document but with no success :
<style>
.ace_editor{
font-size:18px/normal;
}
</style>
Any hint ?
many thanks for your support
I'm not sure if this is the proper way, but this chunk of javascript might help :-)
$(function() {
var editor;
$('.ace_editor').each(function( index ) {
editor = ace.edit(this);
editor.setFontSize("18px");
});
})
Other ace editor related actions can be found here: https://ace.c9.io/#nav=howto
As simple as adding a bit of JS instead of css ;) I should have guess this ! Thanks @annafergusson
Works like a charm!
For others landing here, you can put the code @annafergusson suggested above in a file with a .js extension in a directory called js/
(as suggested here) and then call it with
<script language="JavaScript" src="js/exercise-font-size.js"></script>
at the beginning of the R Markdown document.
Is there a more elegant way of doing this?