Skip to content

Commit

Permalink
fix: add initial documentation with typedoc (langchain-ai#16)
Browse files Browse the repository at this point in the history
* fix: add initial documentation with typedoc

* feat: add docusaurus (langchain-ai#17)

* feat: add docusaurus

* fix: update docs

* Cleanup docs (langchain-ai#19)

* Create Guides category, sort out sidebars

* remove generated files

* Set up ghpages deployment

* Change deployment method

* Temporarily make it run on any push

* Fix api docs broken links, clean up the api docs output a bit

* Revert "Temporarily make it run on any push"

This reverts commit 423c156.

---------

Co-authored-by: Nuno Campos <[email protected]>

* Harrison/add getting started (langchain-ai#20)

* fix: add initial documentation with typedoc

* feat: add docusaurus

* fix: update docs

* Create Guides category, sort out sidebars

* remove generated files

* Set up ghpages deployment

* Change deployment method

* Temporarily make it run on any push

* feat: add docusaurus (langchain-ai#17)

* feat: add docusaurus

* fix: update docs

* Cleanup docs (langchain-ai#19)

* Create Guides category, sort out sidebars

* remove generated files

* Set up ghpages deployment

* Change deployment method

* Temporarily make it run on any push

* Fix api docs broken links, clean up the api docs output a bit

* Revert "Temporarily make it run on any push"

This reverts commit 423c156.

---------

Co-authored-by: Nuno Campos <[email protected]>

* cr

* cr

* cr

* cr

* cr

* fix: remove max-len lint rule

* cr

---------

Co-authored-by: Sean Sullivan <[email protected]>
Co-authored-by: Nuno Campos <[email protected]>
Co-authored-by: Sean Sullivan <[email protected]>

* cr

---------

Co-authored-by: Nuno Campos <[email protected]>
Co-authored-by: Harrison Chase <[email protected]>
  • Loading branch information
3 people authored Feb 17, 2023
1 parent a716f90 commit f02042d
Show file tree
Hide file tree
Showing 97 changed files with 13,604 additions and 2,481 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build website
run: yarn workspace docs build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: "./docs/build"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ yarn-error.log
!.yarn/releases
!.yarn/sdks
!.yarn/versions

langchain/docs/

.DS_Store
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ Please fill out [this form](https://forms.gle/57d8AmXBYp8PP8tZA) and we'll set u

## Quick Install

`yarn add langchain.js --ignore-optional`
`yarn add langchain`

**Note**: You should also make sure you have `moduleResolution` set to `nodenext` in your
`tsconfig.json` if you're using ESM modules and would like to import from subpaths of langchain like

```typescript
import { OpenAI } from 'langchain.js/llms';
import { OpenAI } from 'langchain/llms';
```

## 🤔 What is this?
Expand Down
66 changes: 66 additions & 0 deletions docs/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/

const OFF = 0;
const WARNING = 1;
const ERROR = 2;

module.exports = {
root: true,
env: {
browser: true,
commonjs: true,
jest: true,
node: true,
},
parser: '@babel/eslint-parser',
parserOptions: {
allowImportExportEverywhere: true,
},
extends: ['airbnb', 'prettier'],
plugins: ['react-hooks', 'header'],
rules: {
// Ignore certain webpack alias because it can't be resolved
'import/no-unresolved': [
ERROR,
{ignore: ['^@theme', '^@docusaurus', '^@generated']},
],
'import/extensions': OFF,
'header/header': [
ERROR,
'block',

[
'*',
' * Copyright (c) Meta Platforms, Inc. and affiliates.',
' *',
' * This source code is licensed under the MIT license found in the',
' * LICENSE file in the root directory of this source tree.',
' *',
// Unfortunately eslint-plugin-header doesn't support optional lines.
// If you want to enforce your website JS files to have @flow or @format,
// modify these lines accordingly.
{
pattern: '.* @format',
},
' ',
],
],
'react/jsx-filename-extension': OFF,
'react-hooks/rules-of-hooks': ERROR,
'react/prop-types': OFF, // PropTypes aren't used much these days.
'react/function-component-definition': [
WARNING,
{
namedComponents: 'function-declaration',
unnamedComponents: 'arrow-function',
},
],
},
};
24 changes: 24 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader
docs/api

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# ESLint
.eslintcache
3 changes: 3 additions & 0 deletions docs/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
build
.docusaurus
9 changes: 9 additions & 0 deletions docs/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"arrowParens": "always",
"bracketSameLine": true,
"bracketSpacing": false,
"printWidth": 80,
"proseWrap": "never",
"singleQuote": true,
"trailingComma": "all"
}
13 changes: 13 additions & 0 deletions docs/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

module.exports = {
plugins: ['stylelint-copyright'],
rules: {
'docusaurus/copyright-header': true,
},
};
49 changes: 49 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Website

This website is built using [Docusaurus 2](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.

### Continuous Integration

Some common defaults for linting/formatting have been set for you. If you integrate your project with an open source Continuous Integration system (e.g. Travis CI, CircleCI), you may check for issues using the following command.

```
$ yarn ci
```
12 changes: 12 additions & 0 deletions docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/

module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
Loading

0 comments on commit f02042d

Please sign in to comment.