Initial upload

This commit is contained in:
ryliejamesthomas 2017-04-24 22:49:17 +10:00 committed by GitHub
parent bc2099c2e8
commit e74f914be2
2 changed files with 42 additions and 0 deletions

19
style.css Normal file
View File

@ -0,0 +1,19 @@
table {
/* Note: Never had any luck getting rid of the space between the
cells border-collapse doesn't work, nor does removing or
colouring the borders in the td/th cells. Thanks Qt?
*/
border-color:lightgray;
border-style:solid;
border-width:1px;
margin-top:1em;
margin-bottom:1em;
}
td, th {
padding:0.2em 0.5em 0.2em 0.5em;
}
ol, ul {
margin:-1.5em;
}

23
style_loader.qml Normal file
View File

@ -0,0 +1,23 @@
import QtQml 2.0
// Script to load an external .CSS file and apply it to the Markdown preview
QtObject {
function openFile(fileUrl){
// Load external file
var request = new XMLHttpRequest();
request.open("GET", fileUrl, false);
request.send(null);
return request.responseText;
}
function noteToMarkdownHtmlHook(note, html) {
// Pass loaded file into internal stylesheet
// We can alternately skip the previous function
// and directly add CSS here.
var stylesheet = openFile("style.css");
html = html.replace("</style>", stylesheet + "</style>");
return html;
}
}