You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/README.md
+75-14Lines changed: 75 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,19 @@
7
7
8
8
Convert your docs folder into a pretty docs website using [Docsify-JS](https://docsify.js.org/) and some minimal setup instructions. This project's doc site itself is also running on _Docsify_.
9
9
10
-
Two main sections of this project:
10
+
If you know what _Docsify_ is and want to start using it immediately, feel free to skip to one of these sections:
11
11
12
12
-[Quickstart local server](#quickstart-local-server) - Get a demo site running.
13
13
-[Setup your own docs site](#setup-your-own-docs-site) - Convert your docs directory into a docs site hosted on Github pages. Uses templates files to get up and running with as little effort as possible.
14
14
15
-
_Note: The instructions in this repo are intended for Linux and Mac environments._
15
+
_Note: The instructions in this repo are intended for Linux and macOS environments._
16
+
17
+
18
+
## Why use Docsify for a docs site?
19
+
20
+
My requirement is to build a docs site with minimal setup to use existing docs directories without restructuring or formatting the docs. I found _Docsify_ is ideal for this.
21
+
22
+
You can use _Docsify_ with its defaults or very simple tweaks, yet get a UI with menus, themes, mobile functionality and a cover page. And page loads are seamless in the shell as it is a SPA. These things that take more effort and code changes or additions if you want to do them with static-site generators. _Docsify_ also documentation as its main purpose, unlike some other tools.
16
23
17
24

18
25
@@ -196,7 +203,6 @@ Example:
196
203
2. Edit the *_sidebar.md* file.
197
204
3. Add items using the guidelines above.
198
205
199
-
200
206
##### Note on Home link
201
207
202
208
The clickable text above the standard sidebar takes you to the cover page. You can scroll down to the homepage (_docs/README.md_), but there are no links on the page to the homepage. So add a link to the homepage with the first entry above. Note: An alternative is to use the nav bar config for Home button, rather than sidebar config.
@@ -311,23 +317,80 @@ Next, edit your repo's setting on Github. Select the option to serve the `docs`
311
317
312
318
Open the link in the browser.
313
319
320
+
321
+
## Write content
322
+
323
+
This section deals with how to update and add to the content of your doc files.
The CLI tool is optional. It can be used to do the following.
332
+
_Docsify_ also provides a convenient but optional CLI. It helps you create and serve a Docsify project. In particular, it provides hot reloading by default when using the server - an open localhost webpage will refresh when project files are saved.
333
+
334
+
### Setup
335
+
336
+
Links:
337
+
338
+
- [Docsify Quickstart](https://docsify.js.org/#/quickstart) guide - how to install the CLI in your global node packages and then use it.
- `docsify init docs`: Setup an initial _README.md_ (duplicated from project root), _index.html_ and _.nojekyll_ in your a target directory. If you don't want the CLI to do it for you, you can create the files by hand or use this project's _quickstart_ directory to get you going.
319
-
- `docsify serve docs`: Serve the target directory as docs site locally, with hot reload forif you save any file changes. See [server](#21-serve) options above.
343
+
#### init
320
344
321
-
View the Docsify [Quickstart](https://docsify.js.org/#/quickstart) guide for how to install the CLI in your global node packages and then to use it.
345
+
> Creates new docs
322
346
347
+
Setup an initial _README.md_ (duplicated from project root), _index.html_ and _.nojekyll_ in your a target directory. If you don't want the CLI to do it for you, you can create the files by hand or use this project's _quickstart_ directory to get you going.
323
348
324
-
## Why not a static site generator?
349
+
e.g.
325
350
326
-
These are just tools to build a site. What is appropriate depends on your use case, how much you need to customized the site and how much effort you want to spend on installing/running/maintaining the project. I found a static site generator is not a good fit forwhen I want to build a light docs site around existing docs directoriesin my projects.
351
+
```bash
352
+
$ docsify init docs
353
+
```
354
+
355
+
#### serve
327
356
328
-
Jekyll and Hugo are options for static site generators which can use themes suited to documentation and they can build off of a docs directory. If you want to read more about those, see my [resources](https://github.com/MichaelCurrin/static-sites-generator-resources) project.
357
+
> Run local server to preview site.
329
358
330
-
A static site generator can be heavy...
359
+
Serve the target directory as docs site locally, with hot reload forif you save any file changes. See [server](#21-serve) options above.
360
+
361
+
e.g.
362
+
363
+
```bash
364
+
$ docsify serve docs
365
+
```
366
+
367
+
#### start
368
+
369
+
> Server for SSR
370
+
371
+
For Server-Side Rendering. I haven't tried this yet.
372
+
373
+
## Static site generator vs Single-Page Applicator
374
+
375
+
### Server side rendering
376
+
377
+
Although SEO crawlers can do better at sites like single page application, _Docsify_ is still said not to be SEO-friendly, compared with static sites where all HTML is pre-rendered.
378
+
379
+
However, _Docsify_ provides the option of pre-rendering all the views as static HTML. This can improve SEO.
380
+
381
+
See [Server-Side Rendering](https://docsify.js.org/#/ssr) section of the _Docsify_ docs.
382
+
383
+
### Why not use static site generator?
384
+
385
+
_Docsify_ is a SPA, not a static-site generator.
386
+
387
+
_Jekyll_ and _Hugo_ are excellent options for static site generators. They can use themes suited to documentation and they can build off of a _docs_ directory. If you want to read more about those, see my [resources](https://github.com/MichaelCurrin/static-sites-generator-resources) project.
388
+
389
+
These are just tools to build a site. What is appropriate depends on your usecase, how much you need to customized the site and how much effort you want to spend on installing/running/maintaining the project.
390
+
391
+
I find _Docsify_ light to add to a project and to use for new projects. So it is a great fit for me.
392
+
393
+
### A static site generator can be heavy
331
394
332
395
There are dependencies to manage - they might have to be upgraded if their are security vulnerabilities or they are no longer available. Such as plugins and themes for _Jekyll_. And plugins for _Hugo_. Plus you probably need a couple of _JavaScript_ or _CSS_ files that either you or a theme added. Such as _Query_. This _Docsify_ project only needs exactly one _JavaScript_ and one _CSS_ file.
333
396
@@ -341,8 +404,6 @@ As with _Docsify_, you will probably have to create a config file which covers t
341
404
342
405
Unlike building static files with HTML, with with Docsify there is a single page application running off of a _index.html_ - on each request, a markdown file is fetched by the client and rendered as HTML with a theme and menu. The performance will depend more on the server when serving static HTML pages (prebuild and serve page on the client) or on the client when using a single page application (build structure on the client).
343
406
344
-
Also, the _Docsify_ approach will only work ifJavaScript is enabled.
407
+
Also, the _Docsify_ approach will only work if _JavaScript_ is enabled.
345
408
346
409
The _Docsify_ site says it supports back to Internet Explorer 11, so that at least helps for a wider audience of users.
347
-
348
-
Although SEO crawlers can do better at sites like single page application, _Docsify_ is still said not to be SEO-friendly, compared with static sites where all HTML is pre-rendered.
0 commit comments