Giter VIP home page Giter VIP logo

docusaurus's Introduction

Markdown Book Genrator

Prerequisite

WebSite

How to run

  1. Clone the repository
    $ git clone https://github.com/bigbinary/markdown-book-generator.git
  2. Go to website directory
    $ cd website
  3. Install required node modules
    $ npm install
  4. Run Docusaurus Server It will generate the required files in docs/ folder and will open a website at port 3000
    $ npm start
  5. Building Static HTML Pages
    To create a static build of your website, run the following script from the website directory
    $ npm run build
    You can find your generated e-book at website/build folder.

you can delete docs folder as it's generated whenever you build the project

Hosting on Netlify

Steps to configure your Docusaurus-powered site on Netlify.

  1. Select New site from Git

  2. Connect to your preferred Git provider.

  3. Select the branch to deploy. Default is master

  4. Configure your build steps:

    • For your build command enter: cd website; npm install; npm run build;
    • For publish directory: website/build/<projectName> (use the projectName from your siteConfig)
  5. Click Deploy site

You can also configure Netlify to rebuild on every commit to your repository, or only master branch commits.

Adding a chapter

  1. Upload the chapter in chapter folder
  2. Add the entry of new chapter in chapter/ToC.json

Code-block customization

  1. 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)
    ...
    ...
  2. 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)
    ...
    ...

Key Files

  • 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.

Example

Highlighting && line nuumbers

```ruby{4}
def create
  @task = Task.new(task_params)
...
...

Ouput

Snapshot

docusaurus's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.