How to Build a Docsify-Powered Documentation Site for Your SpringBoot Mall Project

This guide walks you through using Docsify to create a lightweight, dynamic documentation website for the SpringBoot-based mall project, covering installation, project initialization, sidebar and navigation customization, search, code highlighting, copy‑code features, and deployment via GitHub Pages.

macrozheng
macrozheng
macrozheng
How to Build a Docsify-Powered Documentation Site for Your SpringBoot Mall Project

Abstract

mall is a SpringBoot e‑commerce project with over 18k stars on GitHub. After expanding its tutorial to more than thirty articles, a small Docsify‑based documentation site was built to improve reading experience.

Project Documentation Demo

Using Docsify to Write Project Documentation

Docsify Overview

Docsify dynamically generates a website from Markdown files at runtime, keeping the Git repository clean and ideal for quickly building small documentation sites.

Project Initialization

Install Node.js

Download from https://nodejs.org/dist/v8.9.4/node-v8.9.4-x64.msi and install.

Install docsify‑cli npm i docsify-cli -g After installation you can preview documents locally.

Initialize Project Structure

docsify init ./docs
-| docs/
    -| .nojekyll
    -| index.html
    -| README.md

Live Preview docsify serve docs Open http://localhost:3000/ to view the site.

Customize Sidebar

Add sidebar configuration in index.html:

window.$docsify = {
  loadSidebar: true,
  maxLevel: 2,
  subMaxLevel: 4,
  alias: {
    '/.*/_sidebar.md': '/_sidebar.md'
  }
}

Create _sidebar.md to define the menu, e.g.:

* Foreword
  * [mall Architecture Overview](foreword/mall_foreword_01.md)
  * [Knowledge Points for Learning](foreword/mall_foreword_02.md)
* Architecture
  * [SpringBoot+MyBatis Skeleton](architect/mall_arch_01.md)
  * [Swagger‑UI API Docs](architect/mall_arch_02.md)

Customize Navbar

window.$docsify = {
  loadNavbar: true,
  alias: {
    '/.*/_navbar.md': '/_navbar.md'
  }
}

Create _navbar.md with links to backend, mobile, project repos, etc.

Customize Cover Page

window.$docsify = {
  coverpage: true
}

Create _coverpage.md with a logo, title, description, and links.

Add Full‑Text Search

window.$docsify = {
  search: {
    placeholder: '搜索',
    noData: '找不到结果!',
    depth: 3
  }
}

Add Code Highlighting

<script src="//unpkg.com/prismjs/components/prism-bash.js"></script>
<script src="//unpkg.com/prismjs/components/prism-java.js"></script>
<script src="//unpkg.com/prismjs/components/prism-sql.js"></script>

Refer to PrismJS for additional languages.

Add One‑Click Copy Code

<script src="//unpkg.com/docsify-copy-code"></script>

Deploy Documentation on GitHub

Push code to GitHub, open the repository Settings, enable GitHub Pages.

Enable the GitHub Pages service.

Documentation URL

https://macrozheng.github.io/mall-learning/

Project Source Code

https://github.com/macrozheng/mall-learning

Recommended Reading

Order Module Database Table Analysis (Part 3)

Order Module Database Table Analysis (Part 2)

Order Module Database Table Analysis (Part 1)

Product Module Database Table Analysis (Part 2)

Product Module Database Table Analysis (Part 1)

mall Database Table Overview

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

frontendDocumentationDocsifystatic siteGitHub Pages
macrozheng
Written by

macrozheng

Dedicated to Java tech sharing and dissecting top open-source projects. Topics include Spring Boot, Spring Cloud, Docker, Kubernetes and more. Author’s GitHub project “mall” has 50K+ stars.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.