https://github.com/pykong/code2markdown
Exports all source code of a directory to a markdown file. Adds a filetree as well.
https://github.com/pykong/code2markdown
Last synced: about 1 year ago
JSON representation
Exports all source code of a directory to a markdown file. Adds a filetree as well.
- Host: GitHub
- URL: https://github.com/pykong/code2markdown
- Owner: pykong
- License: mit
- Created: 2020-09-14T11:41:56.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-09T21:55:03.000Z (over 5 years ago)
- Last Synced: 2025-02-01T21:43:27.865Z (over 1 year ago)
- Language: Python
- Size: 14.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# code2markdown
Exports all source code of a directory to a markdown file. Adds a filetree as well.
## Ẁhat can it do?
Export the contents of a files in a dir to markdown code blocks.
This can be used for example as a helper for written assignments when the
contents need to be included as a text export.
## Requirements
1. Linux. Currently only runs on linux due to executing the `tree` command.
(Respective code portion can be removed.)
2. Python 3.6+
## Install
1. Download this project.
2. Install dependencies: `pip install -r requirements.txt`
## Usage
```sh
python ./code_export.py /path/to/my/project/
```
## Create a file tree
A tree of the directory is also prepended.
## Ignore files and dirs
Files and dirs can also be ignore via gitignore style patterns provided in
a `patterns.list` file. (Note that pattern might not affect the tree creation.)