-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from visto9259/docs
Added Docusaurus, moved docs from LM-Commons. Added GH actions to tes…
- Loading branch information
Showing
29 changed files
with
9,372 additions
and
0 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,48 @@ | ||
name: Build and Deploy to GitHub Pages | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
paths: | ||
- 'docs/**' | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
deploy: | ||
name: Build and Deploy to GitHub Pages | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./docs | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: yarn | ||
cache-dependency-path: docs/yarn.lock | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Build website | ||
run: yarn build | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# Build output to publish to the `gh-pages` branch: | ||
publish_dir: ./docs/build | ||
# The following lines assign commit authorship to the official | ||
# GH-Actions bot for deploys to `gh-pages` branch: | ||
# https://github.com/actions/checkout/issues/13#issuecomment-724415212 | ||
# The GH actions bot is used by default if you didn't specify the two fields. | ||
# You can swap them out with your own user credentials. | ||
user_name: github-actions[bot] | ||
user_email: 41898282+github-actions[bot]@users.noreply.github.com |
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,29 @@ | ||
name: Build GitHub Pages on PRs No Deploy | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./docs | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'docs/**' | ||
push: | ||
paths: | ||
- 'docs/**' | ||
jobs: | ||
test-deploy: | ||
name: Build GitHub Pages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: yarn | ||
cache-dependency-path: docs/yarn.lock | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Test build website | ||
run: yarn build |
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,20 @@ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
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,41 @@ | ||
# Website | ||
|
||
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. | ||
|
||
### Installation | ||
|
||
``` | ||
$ yarn | ||
``` | ||
|
||
### Local Development | ||
|
||
``` | ||
$ yarn start | ||
``` | ||
|
||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
### Build | ||
|
||
``` | ||
$ yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
### Deployment | ||
|
||
Using SSH: | ||
|
||
``` | ||
$ USE_SSH=true yarn deploy | ||
``` | ||
|
||
Not using SSH: | ||
|
||
``` | ||
$ GIT_USER=<Your GitHub username> yarn deploy | ||
``` | ||
|
||
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. |
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,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
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,9 @@ | ||
--- | ||
slug: new-documentation | ||
title: New documentation | ||
authors: [ericr] | ||
tags: [laminas, PHP, LmcUser, authentication, LM-Commons] | ||
--- | ||
This the new documentation site dedicated to the LmcUser module. | ||
|
||
There are no changes to the code, just improvements in the documentation. |
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,24 @@ | ||
endi: | ||
name: Endilie Yacop Sucipto | ||
title: Maintainer of Docusaurus | ||
url: https://github.com/endiliey | ||
image_url: https://github.com/endiliey.png | ||
|
||
yangshun: | ||
name: Yangshun Tay | ||
title: Front End Engineer @ Facebook | ||
url: https://github.com/yangshun | ||
image_url: https://github.com/yangshun.png | ||
|
||
slorber: | ||
name: Sébastien Lorber | ||
title: Docusaurus maintainer | ||
url: https://sebastienlorber.com | ||
image_url: https://github.com/slorber.png | ||
|
||
ericr: | ||
name: Eric Richer | ||
title: LM-Commons Administrator | ||
url: https://github.com/visto9259 | ||
image_url: https://github.com/visto9259.png | ||
|
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,26 @@ | ||
--- | ||
sidebar_label: Requirements and Installation | ||
sidebar_position: 2 | ||
--- | ||
# Requirements and Installation | ||
## Requirements | ||
|
||
- PHP 7.3 or higher | ||
|
||
|
||
## Installation | ||
|
||
LmcRbac only officially supports installation through Composer. For Composer documentation, please refer to | ||
[getcomposer.org](http://getcomposer.org/). | ||
|
||
Install the module: | ||
|
||
```sh | ||
$ composer require lm-commons/lmc-rbac:^1.1 | ||
``` | ||
|
||
Enable the module by adding `LmcRbac` key to your `application.config.php` file. Customize the module by copy-pasting | ||
the `config.global.php` file to your `config/autoload` folder. | ||
|
||
You can also find some Doctrine entities in the [data](https://github.com/LM-Commons/LmcRbac/tree/master/data) folder that will help you to more quickly take advantage | ||
of LmcRbac. |
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,15 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
# Introduction | ||
Role-based access control module to provide additional features on top of Laminas\Permissions\Rbac | ||
|
||
Based on [ZF-Commons/zfc-rbac](https://github.com/ZF-Commons/zfc-rbac) v3.x. | ||
|
||
If you are looking for the Laminas version | ||
of zfc-rbac v2, please use [LM-Commons/LmcRbacMvc](https://github.com/LM-Commons/LmcRbacMvc). | ||
|
||
## Support | ||
|
||
- File issues at https://github.com/LM-Commons/LmcRbac/issues. | ||
- Ask questions in the [LM-Commons Slack](https://join.slack.com/t/lm-commons/shared_invite/zt-2gankt2wj-FTS45hp1W~JEj1tWvDsUHQ) chat. |
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,149 @@ | ||
// @ts-check | ||
// `@type` JSDoc annotations allow editor autocompletion and type checking | ||
// (when paired with `@ts-check`). | ||
// There are various equivalent ways to declare your Docusaurus config. | ||
// See: https://docusaurus.io/docs/api/docusaurus-config | ||
|
||
import {themes as prismThemes} from 'prism-react-renderer'; | ||
|
||
/** @type {import('@docusaurus/types').Config} */ | ||
const config = { | ||
title: 'LmcRbac', | ||
tagline: 'LmcUser is a user registration and authentication module for Laminas. LmcUser provides the foundations for adding user authentication and registration to your Laminas site.', | ||
favicon: 'img/favicon.ico', | ||
|
||
// Set the production url of your site here | ||
url: 'https://lm-commons.github.io', | ||
// Set the /<baseUrl>/ pathname under which your site is served | ||
// For GitHub pages deployment, it is often '/<projectName>/' | ||
baseUrl: '/LmcRbac/', | ||
|
||
// GitHub pages deployment config. | ||
// If you aren't using GitHub pages, you don't need these. | ||
organizationName: 'lm-commons', | ||
projectName: 'LmcRbac', | ||
trailingSlash: false, | ||
|
||
onBrokenLinks: 'throw', | ||
onBrokenMarkdownLinks: 'warn', | ||
|
||
// Even if you don't use internationalization, you can use this field to set | ||
// useful metadata like html lang. For example, if your site is Chinese, you | ||
// may want to replace "en" with "zh-Hans". | ||
i18n: { | ||
defaultLocale: 'en', | ||
locales: ['en'], | ||
}, | ||
|
||
presets: [ | ||
[ | ||
'classic', | ||
/** @type {import('@docusaurus/preset-classic').Options} */ | ||
({ | ||
docs: { | ||
sidebarPath: './sidebars.js', | ||
// Please change this to your repo. | ||
// Remove this to remove the "edit this page" links. | ||
editUrl: | ||
'https://github.com/lm-commons/lmcrbac/tree/master/docs/', | ||
}, | ||
blog: { | ||
showReadingTime: true, | ||
// Please change this to your repo. | ||
// Remove this to remove the "edit this page" links. | ||
editUrl: | ||
'https://github.com/lm-commons/lmcrbac/tree/master/docs/', | ||
}, | ||
theme: { | ||
customCss: './src/css/custom.css', | ||
}, | ||
}), | ||
], | ||
], | ||
|
||
themeConfig: | ||
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */ | ||
({ | ||
// Replace with your project's social card | ||
image: 'img/LMC-social-card.png', | ||
navbar: { | ||
title: 'LmcRbac', | ||
logo: { | ||
alt: 'LM-Commons Logo', | ||
src: 'img/LMC-logo.png', | ||
}, | ||
items: [ | ||
{ | ||
type: 'docSidebar', | ||
sidebarId: 'documentationSidebar', | ||
position: 'left', | ||
label: 'Documentation', | ||
}, | ||
{to: '/blog', label: 'Blog', position: 'left'}, | ||
{ | ||
href: 'https://lm-commons.github.io', | ||
label: 'LM-Commons', | ||
position: 'right', | ||
}, | ||
{ | ||
href: 'https://github.com/lm-commons/lmcrbac', | ||
label: 'GitHub', | ||
position: 'right', | ||
}, | ||
], | ||
}, | ||
footer: { | ||
style: 'dark', | ||
links: [ | ||
{ | ||
title: 'Docs', | ||
items: [ | ||
{ | ||
label: 'Documentation', | ||
to: '/docs/introduction', | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'Community', | ||
items: [ | ||
{ | ||
label: 'Slack', | ||
href: 'https://join.slack.com/t/lm-commons/shared_invite/zt-2gankt2wj-FTS45hp1W~JEj1tWvDsUHQ', | ||
}, | ||
], | ||
}, | ||
{ | ||
title: 'More', | ||
items: [ | ||
{ | ||
label: 'Blog', | ||
to: '/blog', | ||
}, | ||
{ | ||
label: 'GitHub', | ||
href: 'https://github.com/lm-commons/lmcrbac', | ||
}, | ||
], | ||
}, | ||
], | ||
copyright: `Copyright © ${new Date().getFullYear()} LM-Commons Organization. Built with Docusaurus.`, | ||
}, | ||
prism: { | ||
theme: prismThemes.github, | ||
darkTheme: prismThemes.dracula, | ||
additionalLanguages: ['bash', 'json', 'php'] | ||
}, | ||
}), | ||
headTags: [ | ||
{ | ||
tagName: 'meta', | ||
attributes: { | ||
name: 'keywords', | ||
content: 'php, LmcUser, Laminas MVC, authentication' | ||
} | ||
} | ||
], | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.