Turn your Salesforce Visualforce code into instant, AI-powered documentation.
A powerful Node.js-based tool that automatically generates clean, Markdown-formatted documentation for Salesforce Visualforce pages and Apex controllers.
Perfect for Salesforce developers, consultants, and companies maintaining legacy Visualforce systems who want to save time, improve maintainability, and modernize their codebase.
- Extracts Visualforce components such as
apex:page,apex:form,apex:inputField, andapex:commandButton - Detects controllers, extensions, and
recordSetVarreferences - Parses Apex classes for methods and properties
- ⚡ Enhanced extraction of
apex:pageBlock,apex:pageBlockSection, andapex:pageBlockSectionItem - Generates clean, developer-friendly Markdown files using Handlebars templates
- Instantly generate accurate Visualforce documentation
- Improve project maintainability and team collaboration
- Keep your documentation always in sync with your Apex code
- 💡Help older companies with legacy Visualforce code understand, maintain, and modernize their Salesforce projects faster
If you’re a Salesforce developer or consultant, this tool helps you:
- Instantly generate accurate Visualforce documentation
- Improve project maintainability and team collaboration
- Keep your documentation always in sync with your Apex code
git clone https://github.com/M-A-Gharr/visualforce-doc-generator.git
cd visualforce-doc-generator
npm installBefore running the project, you need to set up your environment and add your own Visualforce pages and Apex classes.
- Add Your Visualforce and Apex Files
After installing dependencies, place your own files inside the demo project:
-
Place your Visualforce pages inside: visualforce-demo/src/pages
-
Place your Apex controller classes inside: visualforce-demo/src/classes
Example folder structure:
visualforce-doc-generator/
├── visualforce-demo/
│ ├── src/
│ ├── pages/
│ │ ├── MyPage.page
│ └── classes/
│ ├── MyController.cls
│
├── ...
├── index.js
├── .env
└── package.json
-
Add Your OpenAI API Key
- Copy the example environment file:
cp .env.example .env
-
Open .env and replace the placeholder value with your actual OpenAI API key:
OPENAI_API_KEY=sk-your-key-here
-
Save the file.
-
Start the generator:
npm start
The generator will parse your Visualforce files, then output Markdown documentation in the /docs folder.
/docs
├── VisualforcePages.md
├── ApexClasses.md
└── Summary.mdSalesforce, Visualforce, Apex, Documentation Generator, Markdown, Node.js, Salesforce Developer Tool
- Node.js
- Handlebars.js
- JavaScript (ES6)
- Salesforce Visualforce
- Apex
This project was inspired by the Cloudity and the ideas shared by TAHA BASRI.
Special thanks to the SFDX-Hardis team for their open-source contributions to the Salesforce developer community.
Contributions, feedback, and suggestions are welcome!
If you’re part of the SFDX-Hardis or Cloudity teams and want to integrate or extend this project, feel free to open an issue or pull request.
Mohamed Amine GHARRAB – https://github.com/M-A-Gharr/visualforce-ai-doc-generator