inspired from code_to_md by @Dinex-dev
Generate a markdown file from a folder of programs, each program numbered with the first comment as title and the rest as code block
To generate a file like this from a directory filled with programs.
Method 1: Clone the repo
git clone https://github.com/realKarthikNair/Code-to-md
cd Code-to-md
Method 2: Download zip and extract it
./code-to-md.py -idir <path-to-code-directory> -e <extension> -odir <md-file-destination> -o <md-filename>
for example,
./code-to-md.py -idir /home/karthik/Temp/python/new/programs/ -e .py -odir /home/karthik/Temp/python/ -o programs.md
To choose <current directory/programs> as code dir and <current directory> as markdown location without any further prompts
./code-to-md.py -d
The script also has a CLI-based interface, so you can even skip entering path as shell arguments
The default code directory is <current working directory>/programs/ and the default output directory is <current working directory>/
I personally have this script placed at /usr/local/bin so that I can use it from anywhere
Okay so that's it: Enjoy!