Skip to content

Salesforce Documentation Generator plugin for sfdx

License

Notifications You must be signed in to change notification settings

MariaApAb/sfdocs-sfdx-plugin

 
 

Repository files navigation

sfdocs-sfdx-plugin

Salesforce Documentation Generator plugin for sfdx

Version Downloads/week License

Overview

Check the Documentation

Generate documentation given the source content of your project.

Content will be generated in the following structure:

docs/ # root folder defined by <outputdir> flag
  force-app/ # one folder per package in the sfdx-project
    profiles/ # folder per MetadataTypeInfo 
      Admin.md # md file per element
      MyCustomProfile.md
    objects/
      Account.md
      CustomObject.md
    <metadata-type>/
      <element>.md
  awesome-app/ # my second package in the project
    objects/
      ...
  ...

This will bring the possibility to publish or import this content in public/private documentation pages for your own project.

Supported Metadata Types

  • Objects
  • Profiles
  • Permission Sets

Refer to the Metadata Types documentation to request new Metadata Types to support. Make sure is covered in the Source Tracking column of Metadata Coverage Report

How to install & commands

$ sfdx plugins:install sfdocs-sfdx-plugin
$ npm install -g sfdocs-sfdx-plugin
$ sfdx COMMAND
running command...
$ sfdx (-v|--version|version)
sfdocs-sfdx-plugin/0.1.0 win32-x64 node-v12.14.1
$ sfdx --help [COMMAND]
USAGE
  $ sfdx COMMAND
...
$ npm install -g sfdocs-sfdx-plugin
$ sfdx COMMAND
running command...
$ sfdx (-v|--version|version)
sfdocs-sfdx-plugin/0.1.0 linux-x64 node-v14.16.0
$ sfdx --help [COMMAND]
USAGE
  $ sfdx COMMAND
...

sfdx sfdocs:generate [-d <filepath>] [-r markdown|json] [-p <array>] [-i <array>] [--reset] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

generates documentation

generates documentation

USAGE
  $ sfdx sfdocs:generate [-d <filepath>] [-r markdown|json] [-p <array>] [-i <array>] [--reset] [--json] [--loglevel 
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --outputdir=outputdir                                                         [default: docs] directory to store
                                                                                    the documentation files

  -i, --ignoretypes=ignoretypes                                                     list of metadata type infos to
                                                                                    ignore. valid values are metadata
                                                                                    type info names or folder names
                                                                                    (CustomApplication or applications,
                                                                                    CustomObject or objects)

  -p, --packages=packages                                                           list of package names to generate
                                                                                    documentation, leave it empty to
                                                                                    generate from all existing packages

  -r, --resultformat=(markdown|json)                                                [default: markdown] result format
                                                                                    stored in the outputdir; --json flag
                                                                                    overrides this parameter

  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --reset                                                                           remove existing target docs folder

EXAMPLE
  $ sfdx sfdocs:generate --resultformat markdown --outputdir site

See code: lib/commands/sfdocs/generate.js

sfdx sfdocs:generate [-d <filepath>] [-r markdown|json] [-p <array>] [-i <array>] [--reset] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

generates documentation

generates documentation

USAGE
  $ sfdx sfdocs:generate [-d <filepath>] [-r markdown|json] [-p <array>] [-i <array>] [--reset] [--json] [--loglevel 
  trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

OPTIONS
  -d, --outputdir=outputdir                                                         [default: docs] directory to store
                                                                                    the documentation files

  -i, --ignoretypes=ignoretypes                                                     list of metadata type infos to
                                                                                    ignore. valid values are metadata
                                                                                    type info names or folder names
                                                                                    (CustomApplication or applications,
                                                                                    CustomObject or objects)

  -p, --packages=packages                                                           list of package names to generate
                                                                                    documentation, leave it empty to
                                                                                    generate from all existing packages

  -r, --resultformat=(markdown|json)                                                [default: markdown] result format
                                                                                    stored in the outputdir; --json flag
                                                                                    overrides this parameter

  --json                                                                            format output as json

  --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)  [default: warn] logging level for
                                                                                    this command invocation

  --reset                                                                           remove existing target docs folder

EXAMPLE
  $ sfdx sfdocs:generate --resultformat markdown --outputdir site

See code: lib/commands/sfdocs/generate.js

Debugging your plugin

We recommend using the Visual Studio Code (VS Code) IDE for your plugin development. Included in the .vscode directory of this plugin is a launch.json config file, which allows you to attach a debugger to the node process when running your commands.

To debug the sfdocs:generate command:

  1. Start the inspector

If you linked your plugin to the sfdx cli, call your command with the dev-suspend switch:

$ sfdx sfdocs:generate -u myOrg@example.com --dev-suspend

Alternatively, to call your command using the bin/run script, set the NODE_OPTIONS environment variable to --inspect-brk when starting the debugger:

$ NODE_OPTIONS=--inspect-brk bin/run sfdocs:generate -u myOrg@example.com
  1. Set some breakpoints in your command code
  2. Click on the Debug icon in the Activity Bar on the side of VS Code to open up the Debug view.
  3. In the upper left hand corner of VS Code, verify that the "Attach to Remote" launch configuration has been chosen.
  4. Hit the green play button to the left of the "Attach to Remote" launch configuration window. The debugger should now be suspended on the first line of the program.
  5. Hit the green play button at the top middle of VS Code (this play button will be to the right of the play button that you clicked in step #5). Congrats, you are debugging!

About

Salesforce Documentation Generator plugin for sfdx

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%