Varying-Vagrant-Vagrants / VVV

An open source Vagrant configuration for developing with WordPress
https://varyingvagrantvagrants.org
MIT License
4.54k stars 847 forks source link

Create docs on the site for bashdocs #2320

Open tomjn opened 3 years ago

tomjn commented 3 years ago

The work in #2319 needs to be exposed on the main site, we should plan out a reference section

tomjn commented 3 years ago

ShDoc doesn't provide a way to prepend with the structure Jekyll needs to create docs, so I wrote this shell function:

vvv_process_jekyll_shelldoc() {
    MDFILE="${1}"
    echo -e "---\ncategory: 10. Function Reference\ntitle: ${DOCFILE}\ndescription: Shellscript documentation for ${DOCFILE}\n---\n\n$(shdoc < $DOCFILE)" > $MDFILE
}

It prepends a header structure with the category etc, and takes the shell file to process as a parameter, e.g. vvv_process_jekyll_shelldoc provision/provision-site.sh, resulting in a doc ready for the .org site. It does need some adjustments though: