-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·36 lines (32 loc) · 942 Bytes
/
Copy pathindex.js
File metadata and controls
executable file
·36 lines (32 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
(function() {
var wrapper,
html,
css;
/**
* Make some HTML.
*/
html = window.marked(document.body.innerText);
/**
* We better make a wrapper element for the html.
*/
wrapper = document.createElement('div');
wrapper.className = 'markdown-body';
wrapper.innerHTML = html;
/**
* Some styling of the body element and appending
* of the markdown wrapper.
*/
document.body.innerHTML = '';
document.body.style.maxWidth = '790px';
document.body.style.margin = '0 auto';
document.body.style.padding = '8px 8px 32px 8px';
document.body.appendChild(wrapper);
/**
* Make sure to add the stylesheet link to the DOM.
*/
css = document.createElement('link');
css.rel = 'stylesheet';
css.href = chrome.extension
.getURL('components/github-markdown-css/github-markdown.css');
document.head.appendChild(css);
}());