##introduction
If you have a good internet conection maybe you don't need do this, but if like me you have internet issues then this steps should be a good option to read YDKJS aka You Don't Know JS
at localhost usign Harpjs like markdown compiler.
###Installing Harpjs First you need a way to compile markdown template, I'm using Harpjs because is so easy to understand the basic to run an static site. Then open a terminal and write the next commands.
sudo npm install -g harp
- create file directory
mkdir mybook
and go inside itcd mybook
- create default boilerplate files from harp
harp init
- clone You Don't Know JS github repository
git clone [email protected]:getify/You-Dont-Know-JS.git
inside myblog directory
So far you should see a list of files like this: _layout.jade
, index.jade
, main.less
and the github repository You Don't Know JS github repository
###Compiling markdown to html The final step is get the github-markdown.css style and setting it.
- download github-markdown.css
sudo npm install --save github-markdown-css
- copy the css file to the root directory
cp node_modules/github-markdown-css /mybook
- open
_layout.jade
file and paste this linelink(rel="stylesheet" href="/github-markdown.css")
below main.css then add below of the body tag the next codearticle.markdown-body
remember keep the tag indentation space for .jade files and insert!= yield
below of article.markdown-body - open the
main.less
file and paste this code at the end of the file:
.markdown-body {
min-width: 200px;
max-width: 790px;
margin: 0 auto;
padding: 30px;
}
###Testing the book content Finally we just want to test the book with markdown format.
- open the terminal and go inside the mybook directory
- write the harp command:
harp compile
if any error happen you are make the steps very good! - and finally run the server
harp server
this show to you where to find the book at localhost:9000