-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
[Proposal] Docusarus NodeJS api #4841
Copy link
Copy link
Open
Labels
apprenticeIssues that are good candidates to be handled by a Docusaurus apprentice / traineeIssues that are good candidates to be handled by a Docusaurus apprentice / traineeproposalThis issue is a proposal, usually non-trivial changeThis issue is a proposal, usually non-trivial change
Milestone
Metadata
Metadata
Assignees
Labels
apprenticeIssues that are good candidates to be handled by a Docusaurus apprentice / traineeIssues that are good candidates to be handled by a Docusaurus apprentice / traineeproposalThis issue is a proposal, usually non-trivial changeThis issue is a proposal, usually non-trivial change
Type
Fields
Give feedbackNo fields configured for issues without a type.
🚀 Feature
Expose (some) docusaurus functionality through a NodeJS api.
Have you read the Contributing Guidelines on issues?
Yes
Motivation
At my work I have implemented an automated documentation flow using docusaurus,
react-docgen,react-docgen-typescriptand file-watchers.We are aiming maintain a good DX in writing documents, so we implemented a flow that uses chokidar to watch multiple project's files (Files in our component library repository, our mobile repo, our main application repo, etc) and generate a bunch of
.mdfiles that then docusuarus renders.However, there is ATM not an "official" way to programmatically start/stop a docusaurus process.
Pitch
ATM our solution is to reach inside docusaurus core
Unsure on the API exactly, but Ideally we would expose a method that would essentially return a a wrapper around
WebpackDevServer's.listenand.closemethods, so expose specific controls over it and not return the whole devServer.docusaurus/packages/docusaurus/src/commands/start.ts
Line 215 in 3548686
A rough schema of what I have in mind