And easily host them on GitHub pages without downloading any more software!
- Download or clone this repo and add it to your path.
- Add docstrings to your functions (see here for information on formatting docstrings, or use the files in this repo as an example).
- Navigate to the root directory and run
matlab2githubfrom the Command Window (or runmatlab2github(TARGET_DIRECTORY)). - Markdown files will be output in
./docs. These are ready to be pushed to GitHub, and you can easily deploy them using GitHub pages.
See here for an example of how output is rendered on GitHub.
This function converts the "docstring" (the first comment in the .m file) into (GitHub® Flavored) Markdown. This function combines the functionality of MATLAB®'s inbuilt PUBLISH and EXPORT functions, as well as some syntax derived from markdown and GitHub Flavored Markdown. For example, use asterisks for bold (*bold*) text (MATLAB); underscores for italic (_italic_) text (MATLAB); 1 or 2 dollar signs for inline or block equations like inline code (markdown).
Currently, the outputs from matlab2github are best suited to simple GitHub Pages templates. For example, the website associated with this repo was auto-generated from the docstrings in the MATLAB functions and the just-the-docs template. See here for information on setting up a page in this manner.