• This repository has been archived on 12/Feb/2022
  • Stars
    star
    229
  • Rank 174,666 (Top 4 %)
  • Language
    Java
  • License
    BSD 3-Clause "New...
  • Created almost 10 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The latest java source for ApexDoc, a tool to document your Salesforce Apex classes.

This project and repository are no longer maintained by Salesforce.org

ApexDoc

ApexDoc is a java app that you can use to document your Salesforce Apex classes. You tell ApexDoc where your class files are, and it will generate a set of static HTML pages that fully document each class, including its properties and methods. Each static HTML page will include an expandable menu on its left hand side, that shows a 2-level tree structure of all of your classes. Command line parameters allow you to control many aspects of ApexDoc, such as providing your own banner HTML for the pages to use.

Credits

ApexDoc was originally created by Aslam Bari (http://techsahre.blogspot.com/2011/01/apexdoc-salesforce-code-documentation.html). It was then taken and extended by David Habib, at Groundwire, in 2011. It has subsequently been enhanced by David Habib of the Salesforce Foundation in late 2014 for use with Nonprofit Success Pack (https://github.com/SalesforceFoundation/Cumulus). We are unable to offer direct support of reported issues or incorporate enhancement requests at this time, however pull requests are welcome.

Command Line Parameters

parameter description
-s source_directory The folder location which contains your apex .cls classes.
-t target_directory The folder location where documentation will be generated to.
-g source_url A URL where the source is hosted (so ApexDoc can provide links to your source). Optional.
-h home_page The full path to an html file that contains the contents for the home page's content area. Optional.
-a banner_page The full path to an html file that contains the content for the banner section of each generated page. Optional.
-p scope A semicolon separated list of scopes to document. Defaults to 'global;public;webService'. Optional.

Usage

Copy apexdoc.jar file to your local machine, somewhere on your path. Each release tag in gitHub has the matching apexdoc.jar attached to it. Make sure that java is on your path. Invoke ApexDoc like this example:

java -jar apexdoc.jar
    -s '/Users/dhabib/Workspaces/Force.com IDE/Cumulus3/src/classes'
    -t '/Users/dhabib/Dropbox/Cumulus/ApexDoc'
    -p 'global;public;private;testmethod;webService'
    -h '/Users/dhabib/Dropbox/Cumulus/ApexDoc/homepage.htm'
    -a '/Users/dhabib/Dropbox/Cumulus/ApexDoc/projectheader.htm'
    -g 'http://github.com/SalesforceFoundation/Cumulus/blob/dev/src/classes/'

Documenting Class Files

ApexDoc scans each class file, and looks for comment blocks with special keywords to identify the documentation to include for a given class, property, or method. The comment blocks must always begin with /** (or additional *'s) and can cover multiple lines. Each line must start with * (or whitespace and then *). The comment block ends with */. Special tokens are called out with @token.

Class Comments

Located in the lines above the class declaration. The special tokens are all optional.

token description
@author the author of the class
@date the date the class was first implemented
@group a group to display this class under, in the menu hierarchy
@group-content a relative path to a static html file that provides content about the group
@description one or more lines that provide an overview of the class

Example

/**
* @author Salesforce.com Foundation
* @date 2014
*
* @group Accounts
* @group-content ../../ApexDocContent/Accounts.htm
*
* @description Trigger Handler on Accounts that handles ensuring the correct system flags are set on
* our special accounts (Household, One-to-One), and also detects changes on Household Account that requires
* name updating.
*/
public with sharing class ACCT_Accounts_TDTM extends TDTM_Runnable {

Property Comments

Located in the lines above a property. The special tokens are all optional.

token description
@description one or more lines that describe the property

Example

    /*******************************************************************************************************
    * @description specifies whether state and country picklists are enabled in this org.
    * returns true if enabled.
    */
    public static Boolean isStateCountryPicklistsEnabled {
        get {

Method Comments

In order for ApexDoc to identify class methods, the method line must contain an explicit scope (global, public, private, testMethod, webService). The comment block is located in the lines above a method. The special tokens are all optional.

token description
@description one or more lines that provide an overview of the method
@param param name a description of what the parameter does
@return a description of the return value from the method
@example Example code usage. This will be wrapped in tags to preserve whitespace
Example
    /*******************************************************************************************************
    * @description Returns field describe data
    * @param objectName the name of the object to look up
    * @param fieldName the name of the field to look up
    * @return the describe field result for the given field
    * @example
    * Account a = new Account();
    */
    public static Schema.DescribeFieldResult getFieldDescribe(String objectName, String fieldName) {

More Repositories

1

NPSP

The current version of the Salesforce.org Nonprofit Success Pack
Apex
623
star
2

EDA

Education Data Architecture
Apex
222
star
3

bootstrap-sf1

Bootstrap theme for Salesforce1
CSS
112
star
4

Volunteers-for-Salesforce

Volunteers for Salesforce managed package
Apex
91
star
5

visualforce-typeahead

A flexible typeahead component for use on Visualforce pages. Uses the typeahead.js library from Twitter.
Apex
73
star
6

salesforce-streaming-client

A Salesforce streaming API client for python, built on salesforce-requests-oauthlib and python-bayeux.
Python
30
star
7

Households

The Households package of the Nonprofit Success Pack
Apex
26
star
8

OutboundFundsModule

The Outbound Funds app is a community developed and maintained Open Source Commons project. It is a customizable foundation for managing funds awarded by your organization, like grants, scholarships or internal funding.
Apex
26
star
9

Contacts_and_Organizations

Contacts and Organizations Package of the Nonprofit Success Pack
Apex
25
star
10

PMM

Program Management Module (PMM)
Apex
23
star
11

Relationships

Nonprofit Success Pack Relationships Package
Apex
22
star
12

gem

Gift Entry Manager
Apex
18
star
13

python-bayeux

A bayeux client for python. Built on gevent and requests.
Python
15
star
14

Recurring_Donations

Recurring Donations Package of the Nonprofit Success Pack
Apex
14
star
15

Affiliations

Nonprofit Success Pack Affiliations Package
Shell
13
star
16

apex-guidestar

Salesforce.com Apex integration with the Guidestar API - supports search, detail, and charity check for Guidestar's extensive database of nonprofit organizations
Apex
12
star
17

salesforce-sonar-plugin

Incorporates the results of PMD's Apex scans into SonarQube
Java
12
star
18

k12-architecture-kit

K12 Data Architecture
Apex
11
star
19

kanban-board-rpt

Salesforce Development Remote Programming Test (RPT) focused on LWC
JavaScript
9
star
20

simple-salesforce-dx-buildpack

A more stripped down buildpack for Salesforce DX intended for apps that need the CLI only
Shell
8
star
21

salesforce-requests-oauthlib

An extension to requests-oauthlib to specifically support calls to Salesforce APIs.
Python
8
star
22

OutboundFundsModuleNPSP

Apex
6
star
23

SAL-CumulusCI

A repository containing the CumulusCI configuration of SAL for use by implementers or ISVs
Apex
6
star
24

NPSP-SignupOrg

Contains all non-packaged, non-default metadata that is provided in the NPSP Trial signup via http://www.salesforcefoundation.org/tryitnow
5
star
25

sfdo-doc-styles

This will likely eventually be rolled into another repo. For now, used to proto the doc styles for external users.
HTML
5
star
26

Grants-Management-Installers

Install Grants Management
2
star
27

SAL-Implementation-Template

Python
2
star
28

ProductLicenses

Product Licenses for Products without a Public Github Repository
2
star
29

c64-salesforce-demo

For the Dreamforce 2017 session titled "New Life for a Commodore 64: An Old-Is-New-Again Salesforce Client"
Python
1
star
30

apex-volunteermatch

Volunteermatch API Integration for force.com / Salesforce, written in Apex - supports searching the extensive Volunteermatch database for organizations and volunteer opportunities
Apex
1
star
31

DonorReport

Apex
1
star
32

.github

Shared workflows and templates used across SalesforceFoundation repositories.
1
star