- You have to be on Node >= 8.x and Yarn >= 1.5.
- Docusaurus
- Clone the repository
$ git clone https://github.com/bigbinary/markdown-book-generator.git
- Go to website directory
$ cd website
- Install required node modules
$ npm install
- Run Docusaurus Server
It will generate the required files in
docs/
folder and will open a website at port 3000$ npm start
- Building Static HTML Pages
To create a static build of your website, run the following script from thewebsite
directoryYou can find your generated e-book at$ npm run build
website/build
folder.
you can delete
docs
folder as it's generated whenever you build the project
Steps to configure your Docusaurus-powered site on Netlify.
-
Select New site from Git
-
Connect to your preferred Git provider.
-
Select the branch to deploy. Default is
master
-
Configure your build steps:
- For your build command enter:
cd website; npm install; npm run build;
- For publish directory:
website/build/<projectName>
(use theprojectName
from yoursiteConfig
)
- For your build command enter:
-
Click Deploy site
You can also configure Netlify to rebuild on every commit to your repository, or only master
branch commits.
- Upload the chapter in chapter folder
- Add the entry of new chapter in
chapter/ToC.json
- To show line-number in code-block.
just add'line-numbers'
in your code-block.```ruby line-numbers def create @task = Task.new(task_params) ... ...
- To highlight a line in code block.
just add the line number within'{}'
. eg.,{2}
or{1-4,3}
```ruby{4} def create @task = Task.new(task_params) ... ...
- Footer: The
website/core/Footer.js
file is a React component that acts as the footer for the site generated by Docusaurus and should be customized by the user. - Configuration file: The
website/siteConfig.js
file is the main configuration file used by Docusaurus. - Sidebars: The
sidebars.json
file contains the structure and order of the documentation files. - Highlighter: The
website/static/js/highlighter.js
file contains the code for highlighting.
```ruby{4}
def create
@task = Task.new(task_params)
...
...