Skip to content

Commit

Permalink
Add JS hosted documentation (#1678)
Browse files Browse the repository at this point in the history
* Add JS hosted documentation

* Update .github/workflows/docs.yml

* Update .github/workflows/docs.yml

---------

Co-authored-by: Clémentine <clementine@meilisearch.com>
  • Loading branch information
amit-ksh and curquiza authored Jul 24, 2024
1 parent 71dcebe commit 3506ce2
Show file tree
Hide file tree
Showing 9 changed files with 681 additions and 3 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ dist
# @TODO: I'm not sure what's going on here, we're importing
# in JS file from TS files, better left ignored for now
/playgrounds
/docs
27 changes: 27 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build documentation

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: yarn install

- name: Generate Documentation
run: yarn build:docs

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
force_orphan: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ typings/
# Output of 'npm pack'
*.tgz

# Generated Docs
docs/

# Yarn Integrity file
.yarn-integrity

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

## 📖 Documentation

This readme contains all the documentation you need to start using this Meilisearch SDK.
This readme and [Meilisearch JS documentation website](https://meilisearch.github.io/meilisearch-js/) contains all the information you need to start using this Meilisearch SDK.

For general information on how to use Meilisearch—such as our API reference, tutorials, guides, and in-depth articles—refer to our [main documentation website](https://www.meilisearch.com/docs/).

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"clear_jest": "jest --clearCache",
"cleanup": "shx rm -rf dist/",
"build": "yarn cleanup && rollup -c && rollup -c --environment NODE_ENV:production",
"build:docs": "typedoc",
"watch": "yarn cleanup && rollup -c --watch",
"postbuild": "yarn size && yarn typingsheader",
"test": "yarn clear_jest && jest --runInBand --verbose",
Expand Down Expand Up @@ -105,6 +106,7 @@
"rollup-plugin-typescript2": "^0.35.0",
"shx": "^0.3.2",
"ts-jest": "^29.1.1",
"typedoc": "^0.25.13",
"typescript": "^5.3.3"
}
}
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"target": "es2022",
"lib": ["ESNext", "dom"],
"strict": true,
"noImplicitReturns": true
}
"noImplicitReturns": true,
},
"include": ["src"],
}
31 changes: 31 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "Meilisearch JS",
"entryPoints": ["./src"],
"out": "./docs",
"customCss": "./typedoc/style.css",
"groupOrder": [
"References",
"Modules",
"Namespaces",
"Enumerations",
"Enumeration Members",
"Classes",
"Interfaces",
"Type Aliases",
"Constructors",
"Properties",
"Variables",
"Functions",
"Accessors",
"Methods"
],
"navigation": {
"includeCategories": true,
"includeGroups": true
},
"navigationLinks": {
"Docs": "https://www.meilisearch.com/docs",
"GitHub": "https://github.com/meilisearch/meilisearch-js"
},
"githubPages": true
}
Loading

0 comments on commit 3506ce2

Please sign in to comment.