Created
January 22, 2020 15:48
-
-
Save bshelling/a7bb9276b5f516a0120717adac9da42a to your computer and use it in GitHub Desktop.
Markdown - Index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Import markdown file | |
*/ | |
const chaperOne = require(‘../Chapter_01/chapter01.md’); | |
/** | |
* CDN Bootstrap stylesheet | |
*/ | |
const markdownCss = ‘https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css'; | |
/** | |
* Create link tag | |
* Pass markdown variable to link href. | |
* Set rel to stylesheet | |
* Set type text/css | |
*/ | |
const cssStyle = document.createElement(‘link’); | |
cssStyle.href = markdownCss; | |
cssStyle.rel = “stylesheet”; | |
cssStyle.type =”text/css”; | |
/** | |
* Append link to head | |
*/ | |
document.head.appendChild(cssStyle); | |
/** | |
* Append chapterOne variable to page inner Html | |
*/ | |
page = document.getElementById(‘container’); | |
page.setAttribute(“class”,”container”); | |
page.innerHTML = chaperOne; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment