https://github.com/sinri/ark-staticdocs
https://github.com/sinri/ark-staticdocs
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sinri/ark-staticdocs
- Owner: sinri
- Created: 2021-04-15T10:02:12.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-05T07:57:42.000Z (almost 5 years ago)
- Last Synced: 2025-06-20T23:06:17.565Z (12 months ago)
- Language: PHP
- Size: 43.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ark Static Docs

`composer require sinri/ark-static-docs`
`Ark Static Docs` is a simple OOTB library project to support documentation.
## Usage
First, prepare the documents in Markdown format and put them into one directory; Subdirectories are allowed, but in each
subdirectory an `index.md` is needed. The file system name would be turned to readable title follow a simple rule:
underline (`_`) becomes space(` `);
```php
// If you give an array of ArkRequestFilter
$filters=[];
// The directory path where documents store
$docRootPath='/path/to/docs';
(new sinri\ark\StaticDocs\ArkStaticDocsService(Ark()->webService(),'/path/to/docs'))
->install($filters)
// If the ArkWebService instance is shared, install is enough;
// If this service is running independently, you may run it as a swift way.
->run();
```
## Other Information
### Page Rendering Reference
We use `erusev/parsedown` (version 1.7.4) for Markdown Rendering.
We use `github-markdown-css` (version 4.0.0) for HTML Style.
```html
```
### Server Config Reference (Related: Ark-Web)
If you use Apache to load the project, you need to add the .htaccess file and open the `allow override` option.
```apacheconf
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
```
For Nginx, you should use try_files.
```nginxconf
server {
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
}
```