Alex Cohen
Alex Cohen

Reputation: 6206

How to convert git repo into word document?

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?

Upvotes: 1

Views: 2277

Answers (1)

VonC
VonC

Reputation: 1324737

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

Upvotes: 2

Related Questions