Skip to content

Commit

Permalink
Add offline docs script
Browse files Browse the repository at this point in the history
  • Loading branch information
moloch-- committed Dec 19, 2023
1 parent 5c9b4a6 commit 31022c1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/sliver-docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# generated files
public/sitemap.json
public/docs.json
/www.zip

# code editor files
.vscode/
Expand Down
30 changes: 30 additions & 0 deletions docs/sliver-docs/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
# Sliver Docs

The source code for the Sliver documentation site.

### Developers

To run the documentation site locally first install the dependencies and then run the `dev` npm script:

```bash
npm install
npm run dev
```

**NOTE:** The markdown is compiled into a static JSON object at build time. This means if you edit a `.md` file you will need to restart the dev server to see your changes.

### Offline Docs

To run your own copy of the documentation first install the dependencies and then run the `offline` npm script:

```bash
npm install
npm run offline
```

This will produce a `www.zip` file that contains the static html and JavaScript for the documentation site. You can extract this archive and host it anywhere:

```bash
unzip -o www.zip
cd out/
python -m http.server 8000
```

Then open your browser to `http://localhost:8000/` to view the documentation.
3 changes: 2 additions & 1 deletion docs/sliver-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"offline": "next build && zip -r www.zip ./out"
},
"dependencies": {
"@fontsource/fira-code": "^5.0.16",
Expand Down

0 comments on commit 31022c1

Please sign in to comment.