|
Macros for SAS Application Developers
https://github.com/sasjs/core |
Create a Markdown Table from a dataset. More...
Go to the source code of this file.
A markdown table is a simple table representation for use in documents written in markdown format.
An online generator is available here: https://www.tablesgenerator.com/markdown_tables
This structure is also used by the Macro Core library for documenting input/ output datasets, as well as the sasjs/cli tool for documenting inputs/outputs for web services.
We take the standard definition one step further by embedding the informat in the table header row, like so:
|var1:$32|var2:best.|var3:date9.| |---|---|---| |some text|42|01JAN1960| |blah|1|31DEC1999|
Which resolves to:
| var1:$32 | var2:best. | var3:date9. |
|---|---|---|
| some text | 42 | 01JAN1960 |
| blah | 1 | 31DEC1999 |
Usage:
%mp_ds2md(sashelp.class)
| [in] | libds | the library / dataset to create or read from. |
| [out] | outref= | (mdtable) Fileref to contain the markdown |
| [out] | showlog= | (YES) Set to NO to avoid printing markdown to the log |
Definition in file mp_ds2md.sas.