Getting Started
This section walks you through everything you need to get your first documentation site published on SharePoint with bdoctor.
Prerequisites
Section titled “Prerequisites”Before you can publish your first page, make sure the following is in place:
- Node.js 22.13.0 or higher on your machine or build agent.
- Permissions in your tenant to create an Azure Entra ID app registration, and an administrator who can grant admin consent to it.
- A SharePoint Online site where your documentation gets published. You pass its URL with the
--urloption, or store it in thebdoctor.jsonfile. - The matching Better Doctor Markdown SPFx solution, deployed and available to that site. Installing the CLI alone is not enough; follow the web part deployment and migration guide.
Install bdoctor
Section titled “Install bdoctor”Install bdoctor globally. Pick the stable release, or the next release to try out the latest changes before they are published.
Using npm:
npm i -g @woznet/better-doctorUsing yarn:
yarn global add @woznet/better-doctorUsing npm:
npm i -g @woznet/better-doctor@nextUsing yarn:
yarn global add @woznet/better-doctor@nextTo quickly get started, we provided a sample repository which allows you to test out all the functionalities of Better Doctor.
Set up certificate authentication
Section titled “Set up certificate authentication”bdoctor does not ship with an application of its own, so before you can publish anything you bring your own Azure Entra ID app registration and authenticate with its certificate:
- Create an app registration in the Azure Portal.
- Add the Sites.FullControl.All application permission from SharePoint, and grant admin consent for your tenant.
- Generate a certificate, upload it to the app registration, and convert it to the
PKCSformat so you can pass it tobdoctor.
The certificate authentication section walks you through each of these steps with the required commands and screenshots.
Prepare the custom renderer
Section titled “Prepare the custom renderer”An authorized administrator must deploy the Better Doctor Markdown solution separately.
It replaces the built-in Markdown control as the normal publishing target.
Better Doctor checks availability before mutations in a page-publishing run, even if
you pass --skipPrecheck.
Publish your first pages
Section titled “Publish your first pages”Once bdoctor, the custom renderer, and certificate authentication are in place:
-
Create the folder structure and the
bdoctor.jsonfile in your project:Terminal window bdoctor init --url <url> --appId <appId> --tenant <tenant> -
Write your content as Markdown files in the source folder (
./srcby default). Check the pages section for the front matter each page supports. -
Check what the next publishing run will do:
Terminal window bdoctor status -
Publish your content to SharePoint:
Terminal window bdoctor publish --certificate ./cert.pfx
Keep authoring in your repository. The web part’s edit-mode preview/export does not save content back to source; HTML compatibility content is read-only there.
Next steps
Section titled “Next steps”- Content: write your pages, build the navigation, and reuse snippets with partials and shortcodes.
- CLI: all the commands
bdoctoroffers. - Configuration: every command argument and
bdoctor.jsonsetting. - CI/CD: publish your documentation automatically from Azure DevOps or GitHub Actions.