I'm working on a thesis and need to paste all my code from the project into the appendix of the paper. The code is currently stored in a git repository. Is there an easy way to do this without copying and pasting the code from every single file in the repository into individual code blocks?
Asked
Active
Viewed 1,270 times
0
-
Can you not link them to your repo online? – evolutionxbox Nov 19 '18 at 01:06
1 Answers
1
It is best to include only a link, or, with Latex, a gitinfo2 tag (a precise reference to a commit)
You would then only copy-paste in your annex only the relevant extract of your Git repo code.
But if you must, you can transform a source code into an html with syntax highlighting colors using ansi2html
.
And then for each file, convert it to a word document with pandoc
You can apply that to the list of files in your repository:
git ls-tree -r master --name-only

VonC
- 1,262,500
- 529
- 4,410
- 5,250