Skip to content

Commit 025e71e

Browse files
committed
change all the things
Transition to docusarus for documentation site
1 parent c350c8a commit 025e71e

File tree

1,016 files changed

+87696
-57306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,016 files changed

+87696
-57306
lines changed

.github/workflows/auto-commit.yml

-24
This file was deleted.

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ Icon
2424
Network Trash Folder
2525
Temporary Items
2626
.apdisk
27+
28+
node_modules/
29+

Makefile

100755100644
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
12
all:
3+
npm install
24
./build.sh all
3-
4-
clean:
5-
./build.sh clean
5+
npm run build

README.md

+21-39
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,33 @@
1-
![Try our extra BIG-ASS Manual. Now with more... MARKDOWN](./artwork/hero.png)
1+
# Website
22

3-
> It doesn’t matter how good your product is, because if its documentation is not good enough, people will not use it
3+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
44

5-
## Examples
5+
## Installation
66

7-
- [Manual](http://10.6.6.250:8000/guides/manual/manual.html)
8-
- [SDK C/C++ Reference](http://10.6.6.250:8000/reference/libzt-c/html/ZeroTierSockets_8h.html)
9-
- [SDK Guide](http://10.6.6.250:8000/guides/libzt/#getting-started)
10-
11-
## What are we doing?
12-
13-
We are auto-generating all [four categories](https://diataxis.fr/introduction/) of documentation from markdown and source files.
14-
15-
- Tutorials
16-
- How-to guides
17-
- Explanation
18-
- Reference
19-
20-
## Usage
21-
22-
1. Edit your source material in `src/`
23-
2. Commit your changes -- Github actions will take care of the rest
24-
3. You're done. Now go do something else
7+
```console
8+
yarn install
9+
```
2510

26-
## How it works
11+
## Local Development
2712

28-
On each push, [.github/workflows/auto-commit.yml](.github/workflows/auto-commit.yml) triggers a rebuild of all documentation in the [src](./src) directory and outputs it to [dst](./dst). Language-specific tools are used to generate API reference documentation (stuff like Doxygen, javadoc, whatever). This covers the `Reference` category. Then, [slatedocs/slate](https://github.com/slatedocs/slate) is used to generate pretty tutorial-like guides. This covers the remaining three categories `Tutorials`, `How-to guides` and `Explanation`. The result is a set of trivially-hostable static html and javascript that we can dump in a small bucket somewhere. You can manually invoke a build of everything using `make` if you have docker and all of the required tools for your use-case.
13+
```console
14+
yarn start
15+
```
2916

30-
Styling assets for the various tools are stored in `style/` and copied during and/or after builds.
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
3118

32-
## Add Your Project
19+
## Build
3320

34-
- Add build steps in [build.sh](./build.sh)
35-
- The `Makefile` just calls `build.sh`. I just like typing make, it rolls off the keyboard faster but I hate using make for anything complex.
21+
```console
22+
yarn build
23+
```
3624

37-
## Pro-tip
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
3826

39-
Add this to your shell profile:
27+
## Deployment
4028

29+
```console
30+
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
4131
```
42-
docs()
43-
{
44-
MSG=${1:-"Documentation edit"}
45-
echo $MSG
46-
git pull
47-
git add .
48-
git commit -m $MSG -S
49-
git push
50-
}
51-
```
32+
33+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

artwork/documentashun.png

-268 KB
Binary file not shown.

artwork/documentashun_s.png

-89.1 KB
Binary file not shown.

artwork/hero.png

-231 KB
Binary file not shown.

auto-pull.sh

-7
This file was deleted.

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

bin/doxybook-linux

2.37 MB
Binary file not shown.

bin/doxybook-mac

1.16 MB
Binary file not shown.

build.sh

+25-38
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,11 @@
11
#!/bin/bash
22

3-
################################################################################
4-
# STYLE FIXES #
5-
################################################################################
6-
7-
apply-slate-style-to()
8-
{
9-
mkdir -p $1
10-
cp -rf style/slate/* $1
11-
}
12-
13-
remove-slate-style-from()
14-
{
15-
cd $1
16-
rm -rf fonts images includes javascripts layouts stylesheets
17-
cd -
18-
}
3+
if [[ "$OSTYPE" == "darwin"* ]]; then
4+
DOXYBOOK="bin/doxybook-mac"
5+
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
6+
DOXYBOOK="bin/doxybook-linux"
7+
fi
198

20-
apply-doxygen-style-to()
21-
{
22-
mkdir -p $1
23-
cp -f style/doxygen/*.png $1
24-
}
259

2610
################################################################################
2711
# PROJECTS #
@@ -38,30 +22,33 @@ manual()
3822
libztcore()
3923
{
4024
# API REFERENCE
41-
mkdir -p dst/reference/libztcore-c # dst
42-
cd src/reference/libztcore-c # src
43-
git clone https://github.com/zerotier/zerotierone.git repo
25+
pushd reference/libztcore-c # src
4426
doxygen
4527
rm -rf repo
46-
cd -
47-
apply-doxygen-style-to dst/reference/libztcore-c/html
28+
popd
29+
30+
rm -rf docs/autogen/libztcore
31+
mkdir -p docs/autogen/libztcore
32+
$DOXYBOOK -i reference/libztcore-c/tmp/xml -o docs/autogen/libztcore/ --config doxybook2/config/doxybook-config-zerotier.json --templates doxybook2/template/libzt
33+
rm -f docs/autogen/libztcore/files/dir_*.md
34+
echo '{"label": "API Reference", "position": 9}' > docs/autogen/libztcore/_category_.json
35+
rm -rf reference/libztcore-c/tmp
4836
}
4937

5038
libzt()
5139
{
5240
# API REFERENCE
53-
mkdir -p dst/reference/libzt-c # dst
54-
cd src/reference/libzt-c # src
55-
#git clone https://github.com/zerotier/libzt.git repo
41+
mkdir -p docs/autogen/libzt-c # dst
42+
pushd reference/libzt-c # src
5643
doxygen
57-
#rm -rf repo
58-
cd -
59-
apply-doxygen-style-to dst/reference/libzt-c/html
44+
popd
6045

61-
# GUIDE
62-
apply-slate-style-to src/guides/libzt/
63-
docker run --rm --name slate -v $(pwd)/dst/guides/libzt:/srv/slate/build -v $(pwd)/src/guides/libzt:/srv/slate/source slatedocs/slate
64-
remove-slate-style-from src/guides/libzt/
46+
rm -rf docs/autogen/libzt/*
47+
mkdir -p docs/autogen/libzt
48+
$DOXYBOOK -i reference/libzt-c/tmp/xml -o docs/autogen/libzt --config doxybook2/config/doxybook-config-libzt.json --templates doxybook2/template/libzt
49+
rm -f autogen/libzt/files/dir_*.md
50+
echo '{"label": "API Reference", "position": 9}' > docs/autogen/libzt/_category_.json
51+
rm -rf reference/libzt-c/tmp
6552
}
6653

6754
################################################################################
@@ -85,14 +72,14 @@ are-there-changes-we-care-about()
8572

8673
clean()
8774
{
88-
rm -rf dst
75+
rm -rf docs/autogen/*
8976
}
9077

9178
all()
9279
{
9380
#are-there-changes-we-care-about
9481

95-
manual
82+
#manual
9683
libztcore
9784
libzt
9885
#terraport

build/.nojekyll

Whitespace-only changes.

build/404.html

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!doctype html>
2+
<html lang="en" dir="ltr">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width,initial-scale=1">
6+
<meta name="generator" content="Docusaurus v2.0.0-alpha.73">
7+
<link rel="alternate" type="application/rss+xml" href="/blog/rss.xml" title="ZeroTier Documentation Blog RSS Feed">
8+
<link rel="alternate" type="application/atom+xml" href="/blog/atom.xml" title="ZeroTier Documentation Blog Atom Feed"><title data-react-helmet="true">Page Not Found | ZeroTier Documentation</title><meta data-react-helmet="true" property="og:title" content="Page Not Found | ZeroTier Documentation"><meta data-react-helmet="true" property="og:url" content="https://docs.zerotier.com/404.html"><meta data-react-helmet="true" name="docusaurus_locale" content="en"><meta data-react-helmet="true" name="docusaurus_tag" content="default"><link data-react-helmet="true" rel="shortcut icon" href="/img/favicon.ico"><link data-react-helmet="true" rel="canonical" href="https://docs.zerotier.com/404.html"><link data-react-helmet="true" rel="alternate" href="https://docs.zerotier.com/404.html" hreflang="en"><link data-react-helmet="true" rel="alternate" href="https://docs.zerotier.com/404.html" hreflang="x-default"><link rel="stylesheet" href="/assets/css/styles.ac863d77.css">
9+
<link rel="preload" href="/assets/js/styles.677a4bb9.js" as="script">
10+
<link rel="preload" href="/assets/js/runtime~main.4cd1716d.js" as="script">
11+
<link rel="preload" href="/assets/js/main.777a9448.js" as="script">
12+
<link rel="preload" href="/assets/js/1.accfc5a0.js" as="script">
13+
<link rel="preload" href="/assets/js/2.4213ea57.js" as="script">
14+
<link rel="preload" href="/assets/js/82.828490fa.js" as="script">
15+
<link rel="preload" href="/assets/js/84.6387da1f.js" as="script">
16+
<link rel="preload" href="/assets/js/935f2afb.7ac3aafe.js" as="script">
17+
</head>
18+
<body>
19+
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
20+
<div><a href="#main" class="skipToContent_1oUP">Skip to main content</a></div><nav class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><a class="navbar__brand" href="/"><img src="/img/ZeroTierIcon.png" alt="My Site Logo" class="themedImage_1VuW themedImage--light_3UqQ navbar__logo"><img src="/img/ZeroTierIcon.png" alt="My Site Logo" class="themedImage_1VuW themedImage--dark_hz6m navbar__logo"><strong class="navbar__title">ZeroTier Documentation</strong></a></div><div class="navbar__items navbar__items--right"><div class="react-toggle displayOnlyInLargeViewport_GrZ2 react-toggle--disabled" role="button" tabindex="-1"><div class="react-toggle-track"><div class="react-toggle-track-check"><span class="toggle_71bT">🌜</span></div><div class="react-toggle-track-x"><span class="toggle_71bT">🌞</span></div></div><div class="react-toggle-thumb"></div><input type="checkbox" class="react-toggle-screenreader-only" aria-label="Switch between dark and light mode"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div><div class="navbar-sidebar"><div class="navbar-sidebar__brand"><a class="navbar__brand" href="/"><img src="/img/ZeroTierIcon.png" alt="My Site Logo" class="themedImage_1VuW themedImage--light_3UqQ navbar__logo"><img src="/img/ZeroTierIcon.png" alt="My Site Logo" class="themedImage_1VuW themedImage--dark_hz6m navbar__logo"><strong class="navbar__title">ZeroTier Documentation</strong></a></div><div class="navbar-sidebar__items"><div class="menu"><ul class="menu__list"></ul></div></div></div></nav><div class="main-wrapper"><main class="container margin-vert--xl"><div class="row"><div class="col col--6 col--offset-3"><h1 class="hero__title">Page Not Found</h1><p>We could not find what you were looking for.</p><p>Please contact the owner of the site that linked you to the original URL and let them know their link is broken.</p></div></div></main></div><footer class="footer footer--dark"><div class="container"><div class="row footer__links"><div class="col footer__col"><h4 class="footer__title">Docs</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/zerotier/ztintro">ZeroTier</a></li><li class="footer__item"><a class="footer__link-item" href="/libzt/manual.html">libzt SDK</a></li><li class="footer__item"><a class="footer__link-item" href="/centralv1">Central API</a></li><li class="footer__item"><a class="footer__link-item" href="/servicev1">Service API</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">Community</h4><ul class="footer__items"><li class="footer__item"><a href="https://discuss.zerotier.com" target="_blank" rel="noopener noreferrer" class="footer__link-item">ZeroTier Discussions</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">More</h4><ul class="footer__items"><li class="footer__item"><a href="https://github.com/zerotier/ZeroTierOne" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub</a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2021 ZeroTier, Inc. Built with Docusaurus.</div></div></div></footer></div>
21+
<script src="/assets/js/styles.677a4bb9.js"></script>
22+
<script src="/assets/js/runtime~main.4cd1716d.js"></script>
23+
<script src="/assets/js/main.777a9448.js"></script>
24+
<script src="/assets/js/1.accfc5a0.js"></script>
25+
<script src="/assets/js/2.4213ea57.js"></script>
26+
<script src="/assets/js/82.828490fa.js"></script>
27+
<script src="/assets/js/84.6387da1f.js"></script>
28+
<script src="/assets/js/935f2afb.7ac3aafe.js"></script>
29+
</body>
30+
</html>

build/assets/css/styles.ac863d77.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Loading
Loading

build/assets/js/04169b3a.4d4ed4ec.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)