docs/README.md
This website is built using Docusaurus 3, a modern static website generator.
$ npm install
$ npm run 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.
$ npm run build
This command generates static content into the build directory and can be served using any static contents hosting service, including npm run serve.
To embed source files directly in the docs, use raw-loader to import the file as a string and pass it to the native CodeBlock component.
import CodeBlock from "@theme/CodeBlock";
import customComponent from "!!raw-loader!@langflow/src/lfx/src/lfx/custom/custom_component/custom_component.py";
<CodeBlock language="python" title="CustomComponent metadata (from codebase)">
{customComponent}
</CodeBlock>
The versioning configuration is found in docusaurus.config.js.
Versioning example for release version 1.9.x on top of 1.8.x:
1.8.x, the current version.1.9.x, create a branch and run npm run docs:version -- 1.9.0 to snapshot the current docs.docusaurus.config.js to include the 1.9.0 release:docs: {
lastVersion: '1.9.0',
versions: {
'1.9.0': {
label: '1.9.x',
path: '1.9.0',
},
'1.8.0': {
label: '1.8.x',
path: '1.8.0',
},
},
},
npm run build
npm run serve
2.0.x when you begin working on it, then when ready to release, run npm run docs:version -- 2.0.0, update docusaurus.config.js with labels using .x notation, and merge to main.lastVersion = the most recent released version (shown as "latest" in the UI).See the Docusaurus docs for more info.
docusaurus.config.js.docs/versioned_docs/ and docs/versioned_sidebars/ directories.docs/versions.json.Using SSH:
$ USE_SSH=true npm run deploy
Not using SSH:
$ GIT_USER=<Your GitHub username> npm run 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.