https://github.com/kevinzg/sourcecodex
A program to convert source code repos to epubs
https://github.com/kevinzg/sourcecodex
epub source-code-reading
Last synced: 11 months ago
JSON representation
A program to convert source code repos to epubs
- Host: GitHub
- URL: https://github.com/kevinzg/sourcecodex
- Owner: kevinzg
- License: mit
- Created: 2023-03-23T02:21:16.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-23T02:22:12.000Z (almost 3 years ago)
- Last Synced: 2025-01-29T18:46:57.101Z (about 1 year ago)
- Topics: epub, source-code-reading
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SourceCodex
A program to convert source code repos to epubs.
## Features
- Syntax highlighting
## Examples
The program receives as input the filenames to include:
```bash
$ fd -e go | sourcecodex
```
Here's another example with more filters and files sorted by last commit date:
```bash
$ git ls-tree -r --name-only HEAD \
| grep -E '\.ts$' \
| grep -v -E '(^test|__test__|\.test\.\w+$|\.d\.ts$)' \
| xargs -I{} git log -1 --format='%at {}' -- {} \
| sort -n -r \
| cut -d ' ' -f2- \
| sourcecodex -title "Cool project" -author "Cool author" -output "source.epub"
```
## To-do
- Add links between files (like a dependency graph)
- Add an index for symbols, with links to its definition, and references
- Link symbols in the code to their entry on the index
- Sort files with a recommended reading order
- Autoformat code for a better ebook reading experience
- Add line numbers
- Generate a cover