Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/realkarthiknair/code-to-md

Create a single md file from a directory full of code files
https://github.com/realkarthiknair/code-to-md

automation generator github markdown markdown-generator md python python-3 python3

Last synced: 2 months ago
JSON representation

Create a single md file from a directory full of code files

Awesome Lists containing this project

README

        

# **Code-to-md**

*inspired from [code_to_md](https://github.com/Dinex-dev/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**

### **1. Why?**

#### To generate a file like [this](https://github.com/realKarthikNair/Learning-C-Lang/blob/main/Learning_C/F.%20Loops/1.%20For%20loops/programs0/readme.md) from a directory filled with programs.

### **2. How to set-up**

Method 1: Clone the repo

git clone https://github.com/realKarthikNair/Code-to-md
cd Code-to-md

Method 2: [Download zip](https://github.com/realKarthikNair/Code-to-md/archive/refs/heads/main.zip) and extract it

### **3. Usage**

./code-to-md.py -idir -e -odir -o

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 \ as code dir and \ 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 \/programs/ and the default output directory is \/

> I personally have this script placed at /usr/local/bin so that I can use it from anywhere

> Okay so that's it: Enjoy!

### **4. How to reach me?**








### Incase you want to buy me a coffee...

Coindrop.to me