Guide for running the docs site
If you're just working on content, then you'll probably like the Remote setup instructions so you can setup your own Github Page site which builds on commits to master on Github. No local setup needed.
If you're working more on styling, menus or moving content, then the Run locally section will be great for you to run a local web server. Then you can make changes in the IDE and see the browser live reload to see your changes instantly.
The Github Pages site is served from the docs
directory and uses Docsify.JS - a single-page JS application which builds an elegant site focused on documentation.
Mostly you'll just have to write markdown and not have to learn any templating syntax or config values.
For interest, Docsify works using an index.html
page as the base to specify plugins and config values, markdown files are read as content and there are some other configs sidebar or navbar.
To learn more about DocsifyJS, see my Docsify JS Tutorial.
If your changes are simple enough you can even make them all on Github without setting up and testing locally. However, testing locally makes testing much easier and also Docsify is so light that you don't even have to install anything to get it working locally.
How to run the docs site on GitHub pages
- Add a fork this repo to your Github repos.
- Go to Settings.
- Enable Github Pages for the /docs directory.
- Check the environment tab to check on the deploy.
How to run the docs site in a local dev environment
- Install NPM.
- Clone the repo (see the Clone or download button on the repo's main page) and navigate to the project root.
- Install node dependencies (just Docsify CLI). This can be run from the VS Code task too.
$ npm install
- Serve the docs directory. This can be run from the configured VS Code task too.
$ npm start
- Open in the browser:
The browser will auto reload when you save changes.
- The
python
andbash
highlighting extensions have been added to index.html, so those will work on the frontend. - Use
bash
only for shell codeblock language - the syntax highlighting plugin does not recognizesh
properly. - Add info blocks with
?> Message
and alert blocks with!> Message
.
- Search
- Ensure the search paths are kept up to date with the navbar. The
auto
setting for search seemed limited.
- Ensure the search paths are kept up to date with the navbar. The
- Edit on Github
- Unlike other plugins, this one must be loaded before the app is setup.
Use an understated info block for external links.
?> **Tweepy docs:** [Cursor tutorial](http://docs.tweepy.org/en/v3.8.0/cursor_tutorial.html)
?> Tweepy docs: Cursor tutorial
Avoid using stronger CTA button:
<a href="http://docs.tweepy.org/en/v3.8.0/cursor_tutorial.html">
<button class="myButton">See Cursor tutorial on Tweepy docs</button>
</a>
See this guide.
e.g.
<details>
<summary><b>script_name.py</b></summary>
[script_name.py](_scripts/script_name.py ':include :type=code')
</details>