Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

Commit 926bc8e

Browse files
committed
docs(core): add mkdocs for documentation site (#10)
added and configured mkdocs for documentation site added and configured typedoc for exporting api references as markdown files inside mkdocs's docs_dir added `ci.yml` in github workflow to deploy documentation site on every push to master branch. GH-9
1 parent 874209e commit 926bc8e

File tree

13 files changed

+299
-14
lines changed

13 files changed

+299
-14
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ coverage/
44
.eslintrc.js
55
.cz-config.js
66
commitlint.config.js
7+
docs/
8+
site/

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: ci
2+
on:
3+
push:
4+
branches:
5+
- master
6+
permissions:
7+
contents: write
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-python@v4
14+
with:
15+
python-version: 3.x
16+
- name: Setup Node
17+
uses: actions/setup-node@v3.6.0
18+
with:
19+
node-version: '18.x'
20+
- name: Bootstrap
21+
run: npm ci
22+
- name: Install mkdocs deps/plugins
23+
run: |
24+
pip install mkdocs-material
25+
pip install mkdocs-include-markdown-plugin
26+
- name: Create the docs directory locally in CI
27+
run: npx typedoc
28+
- name: Deploy 🚀
29+
run: mkdocs gh-deploy --force

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,11 @@ typings/
6363
# Cache used by TypeScript's incremental build
6464
*.tsbuildinfo
6565

66-
/src/sequelize/usercrud.sequelize.repository.base.ts
66+
/src/sequelize/usercrud.sequelize.repository.base.ts
67+
68+
# site contains compiled html files, we don't need them because mkdocs-deploy
69+
# can freshly recreate them
70+
/site
71+
72+
# api-reference
73+
/docs/api-reference

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
dist
22
*.json
3+
docs
4+
site

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
[![LoopBack](<https://github.com/loopbackio/loopback-next/raw/master/docs/site/imgs/branding/Powered-by-LoopBack-Badge-(blue)-@2x.png>)](http://loopback.io/)
44

5+
<!-- docs-index-start -->
6+
57
This is a loopback4 extension that provides Sequelize's query builder at repository level in any loopback 4 application. It has zero learning curve as it follows similar interface as `DefaultCrudRepository`. For relational databases, Sequelize is a popular ORM of choice.
68

79
For pending features, refer to the [Limitations](#limitations) section below.
@@ -30,13 +32,15 @@ npm install --save oracledb # Oracle Database
3032

3133
> You can watch a video overview of this extension by [clicking here](https://youtu.be/ZrUxIk63oRc).
3234
35+
<!-- tutorial-start -->
36+
3337
Both newly developed and existing projects can benefit from the extension by simply changing the parent classes in the target Data Source and Repositories.
3438

3539
### Step 1: Configure DataSource
3640

3741
Change the parent class from `juggler.DataSource` to `SequelizeDataSource` like below.
3842

39-
```ts
43+
```ts title="pg.datasource.ts"
4044
// ...
4145
import {SequelizeDataSource} from 'loopback4-sequelize';
4246

@@ -52,7 +56,7 @@ export class PgDataSource
5256

5357
Change the parent class from `DefaultCrudRepository` to `SequelizeCrudRepository` like below.
5458

55-
```ts
59+
```ts title="your.repository.ts"
5660
// ...
5761
import {SequelizeCrudRepository} from 'loopback4-sequelize';
5862

@@ -104,6 +108,8 @@ An example of the filter object might look like this to fetch the books who cont
104108
}
105109
```
106110

111+
<!-- tutorial-end -->
112+
107113
## Debug strings reference
108114

109115
There are three built-in debug strings available in this extension to aid in debugging. To learn more about how to use them, see [this page](https://loopback.io/doc/en/lb4/Setting-debug-strings.html).
@@ -163,3 +169,5 @@ Code of conduct guidelines [here](https://github.com/sourcefuse/loopback4-sequel
163169
## License
164170

165171
[MIT](https://github.com/sourcefuse/loopback4-sequelize/blob/master/LICENSE)
172+
173+
<!-- docs-index-end -->

docs/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Overview
3+
---
4+
5+
{%
6+
include-markdown "../README.md"
7+
start="<!-- docs-index-start -->"
8+
end='<!-- docs-index-end -->'
9+
%}

docs/tutorial/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Basics
2+
3+
{%
4+
include-markdown "../../README.md"
5+
start="<!-- tutorial-start -->"
6+
end='<!-- tutorial-end -->'
7+
%}

mkdocs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
site_name: Loopback4 Sequelize
2+
3+
theme:
4+
name: material
5+
features:
6+
- content.code.copy
7+
palette:
8+
- scheme: default
9+
toggle:
10+
icon: material/brightness-7
11+
name: Switch to dark mode
12+
- scheme: slate
13+
toggle:
14+
icon: material/brightness-4
15+
name: Switch to light mode
16+
17+
docs_dir: docs
18+
19+
markdown_extensions:
20+
- tables
21+
- pymdownx.highlight:
22+
anchor_linenums: true
23+
- pymdownx.inlinehilite
24+
- pymdownx.snippets
25+
- pymdownx.superfences
26+
27+
extra:
28+
generator: false
29+
social:
30+
- icon: fontawesome/brands/github
31+
link: https://github.com/sourcefuse/loopback4-sequelize
32+
33+
plugins:
34+
- search
35+
- include-markdown
36+
37+
repo_name: sourcefuse/loopback4-sequelize
38+
repo_url: https://github.com/sourcefuse/loopback4-sequelize
39+
40+
copyright: |
41+
&copy; 2023 <a href="https://github.com/sourcefuse/loopback4-microservice-catalog" target="_blank" rel="noopener">Sourceloop</a>

0 commit comments

Comments
 (0)