-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Updated assets and added script to download updates.
- Loading branch information
1 parent
8558114
commit a8a36fb
Showing
17 changed files
with
2,054 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.sh] | ||
indent_size = 2 | ||
|
||
[*.{css,js,json}] | ||
indent_size = 2 | ||
|
||
[*.{yml,yaml}] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/docker-compose.yml | ||
/docroot | ||
tmp | ||
Dockerfile.* | ||
.idea | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"assets": [ | ||
{ | ||
"asset": "js/docsify.min.js", | ||
"source": "https://cdn.jsdelivr.net/npm/docsify@4", | ||
"info": "https://docsify.js.org/#/quickstart" | ||
}, | ||
{ | ||
"asset": "js/docsify-themeable.min.js", | ||
"source": "https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/js/docsify-themeable.min.js", | ||
"info": "https://jhildenbiddle.github.io/docsify-themeable/#/quick-start" | ||
}, | ||
{ | ||
"asset": "js/mermaid.min.js", | ||
"source": "https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js" | ||
}, | ||
{ | ||
"asset": "js/plugins/code-inline.min.js", | ||
"source": "https://unpkg.com/@rakutentech/docsify-code-inline/dist/index.min.js", | ||
"info": "https://www.npmjs.com/package/@rakutentech/docsify-code-inline" | ||
}, | ||
{ | ||
"asset": "js/plugins/docsify-copy-code.min.js", | ||
"source": "https://cdn.jsdelivr.net/npm/docsify-copy-code/dist/docsify-copy-code.min.js" | ||
}, | ||
{ | ||
"asset": "js/plugins/docsify-mermaid.min.js", | ||
"source": "https://unpkg.com/[email protected]/dist/docsify-mermaid.js", | ||
"info": "https://github.com/Leward/mermaid-docsify" | ||
}, | ||
{ | ||
"asset": "js/plugins/search.min.js", | ||
"source": "https://cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js" | ||
}, | ||
{ | ||
"asset": "css/docsify4-themes-vue.css", | ||
"source": "https://cdn.jsdelivr.net/npm/docsify@4/themes/vue.css" | ||
}, | ||
{ | ||
"asset": "css/themeable-simple.css", | ||
"source": "https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple.css" | ||
}, | ||
{ | ||
"asset": "css/themeable-simple-dark.css", | ||
"source": "https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple-dark.css" | ||
} | ||
], | ||
"prism": { | ||
"asset": "js/prism/*", | ||
"source": "https://raw.githubusercontent.com/PrismJS/prism/v1.29.0/components/*", | ||
"supports": [ | ||
"prism-bash.min.js", | ||
"prism-diff.min.js", | ||
"prism-docker.min.js", | ||
"prism-git.min.js", | ||
"prism-groovy.min.js", | ||
"prism-ignore.min.js", | ||
"prism-ini.min.js", | ||
"prism-json.min.js", | ||
"prism-makefile.min.js", | ||
"prism-php.min.js", | ||
"prism-regex.min.js", | ||
"prism-scss.min.js", | ||
"prism-sql.min.js", | ||
"prism-typescript.min.js", | ||
"prism-yaml.min.js" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
$assetsDir = __DIR__ . '/../html/assets'; | ||
$json = file_get_contents(__DIR__ . '/assets.json'); | ||
$assets = json_decode($json, true); | ||
|
||
$sources = $assets['assets']; | ||
echo "\nFound " . count($sources) . " docsify assets to download."; | ||
echo "\nFound " . count($assets['prism']['supports']) . " prism.js language packs to download."; | ||
|
||
foreach ($assets['prism']['supports'] as $name) { | ||
$sources[] = [ | ||
'asset' => str_replace('*', $name, $assets['prism']['asset']), | ||
'source' => str_replace('*', $name, $assets['prism']['source']), | ||
]; | ||
} | ||
|
||
echo "\n\nDownloading...\n"; | ||
|
||
foreach ($sources as $source) { | ||
if (! $script = file_get_contents($source['source'])) { | ||
echo " FAILED to download {$source['asset']}\n"; | ||
continue; | ||
} | ||
|
||
$status = file_put_contents("{$assetsDir}/{$source['asset']}", $script) | ||
? 'saved' | ||
: 'FAILED to save'; | ||
echo " {$status} {$source['asset']}\n"; | ||
} | ||
|
||
echo "Done.\n"; | ||
exit(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
:root { | ||
--content-max-width: 84em; | ||
--link-color: var(--theme-color); | ||
--code-inline-color: #e96900; | ||
} | ||
@media (prefers-color-scheme: dark) { | ||
:root { | ||
--code-inline-background: #0e2233; | ||
} | ||
} | ||
@media (prefers-color-scheme: light) { | ||
:root { | ||
--code-inline-background: #f8f8f8; | ||
} | ||
} | ||
|
||
.mermaid { | ||
background-color: #fff; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Docsify docker image | ||
|
||
## About | ||
|
||
This is docker image to fast start with [docsify](https://docsify.js.org/) markdown docs viewer. | ||
|
||
It's based on [nginx docker image](https://hub.docker.com/_/nginx). | ||
|
||
### Included Plugins | ||
|
||
- [search](https://docsify.js.org/#/plugins?id=full-text-search) - a docsify full text search plugin. | ||
- [mermaid-docsify](https://github.com/Leward/mermaid-docsify) - a docsify plugin which allows to render mermaid diagrams in docsify. | ||
- [docsify-copy-code](https://github.com/jperasmus/docsify-copy-code) - a docsify plugin that adds a button to easily copy code blocks to your clipboard. | ||
|
||
## Quick start | ||
|
||
Just launch the container to see it in action | ||
|
||
``` | ||
docker run --name docsify-example -d -p 8080:80 justcoded/docsify:latest | ||
``` | ||
|
||
Access the demo page on [127.0.0.1:8080](http://127.0.0.1:8080). | ||
|
||
## Display your docs | ||
|
||
Just mount your docs folder to `/usr/share/nginx/html/docs`. | ||
|
||
Special files you may want to create: | ||
|
||
- `_sidebar.md` - Left nav | ||
- `_navbar.md` - Top nav | ||
|
||
## Docker compose example | ||
|
||
```yaml | ||
--- | ||
version: "3.7" | ||
services: | ||
docsify: | ||
image: justcoded/docsify:latest | ||
volumes: | ||
- ./docs/:/usr/share/nginx/html/docs | ||
ports: | ||
- 8080:80 | ||
``` | ||
## Configurations | ||
### Custom docsify config | ||
If you want custom config you can override `/usr/share/nginx/html/assets/docsify.conf.js` | ||
with your mounted file. | ||
|
||
Alternatively, you can set env variable with json to override the config: | ||
|
||
```yaml | ||
... | ||
environment: | ||
OPT_DOCSIFY_CONF: "{subMaxLevel: 3}" | ||
``` | ||
|
||
### Custom page title | ||
|
||
To specify custom page title on page load you can use env variable: | ||
|
||
```yaml | ||
... | ||
environment: | ||
OPT_INDEX_TITLE: My custom page title | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [Home](/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [Getting Started](/) |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.