Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

macro

collectfiles

Collect file information from directory or ZIP archive

Recursively scans a directory or ZIP file and creates a dataset containing detailed information about all files and subdirectories found. Extracts file metadata and path information.

Parameters

Output Dataset Variables

VariableDescription
pathFull path to the file
baseBase directory path
nameFile or directory name
folderParent folder name
fileshortFilename without extension
extFile extension
is_dirFlag indicating if entry is a directory (1) or file (0)
depthRecursion depth level

Usage Example

%collectFiles(
    targetLocation=/path/to/package, 
    maxDepth=5, 
    listDataSet=work.myfiles
);

generatemd

Generate markdown documentation files from source code

Extracts documentation from source code comments and generates markdown files. Supports multiple documentation depth levels for flexible organization.

Parameters

Output

DepthOutput Format
0Single <packagename>.md or <docname> file
1Separate files per type (macro.md, function.md, etc.)
2Individual files per source file
-1Files organized by source directory structure

Usage Example

%generateMD(
    fileList=work.myfiles,
    depth=1,
    docsLocation=/path/to/docs,
    startPtn="\/\*-+ HELP START -+\*\/",
    endPtn="\/\*-+ HELP END -+\*\/"
);

packagedoc

Main macro for generating source files for SAS package documentation

Primary entry point for generating source of comprehensive documentation for SAS packages following the SAS Packages Framework (SPF) structure. Supports Jupyterbook(MyST) and Sphinx for documentation engines.

Parameters

Usage Examples

Basic SPF documentation:

%packageDoc(
    filesLocation=/path/to/package,
    docsLocation=/path/to/docs
);

Sphinx documentation with custom theme:

%packageDoc(
    filesLocation=/path/to/package,
    docsLocation=/path/to/docs,
    docDepth=1,
    engine=Sphinx,
    newConf=1,
    docTheme=sphinx_rtd_theme,
    sphinxExt=napoleon
);

MyST/Jupyter Book documentation:

%packageDoc(
    filesLocation=/path/to/package,
    docsLocation=/path/to/docs,
    engine=MyST
);