Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the most git-friendly documentation format?

Tags:

git

We use .docx and .odt for our "human-centric" documentation, but these formats are pretty much the worst you can do to a git repository.

Is there some git-friendly format that offers basic word-processor functionality and contains everything in one file?

like image 510
Robby75 Avatar asked Jun 15 '16 15:06

Robby75


People also ask

What is the diff format in Git?

This format lists the commits in the range like git-submodule summary does. When --submodule=diff is specified, the diff format is used. This format shows an inline diff of the changes in the submodule contents between the commit range. Defaults to diff.submodule or the short format if the config option is unset.

Is it possible to use plain XML file format in Git?

You can also use libreOffice/open-office-spreadsheet-non-zip-xml-fileformat "*.fods" which is plain xml. @glenatron s comment applies to this format, too. The standard open ofice spreadsheet format "*.ods" is zipped xml and not so suitable for git (similar to @Egryan/@emuddudley answer). I would like to avoid XML.

What is the difference between GIT-Rev-list and git-diff?

The resulting set of commits is the symmetric difference between the two operands. The following two commands are equivalent: The command takes options applicable to the git-rev-list [1] command to control what is shown and how, and options applicable to the git-diff [1] command to control how the changes each commit introduces are shown.

Should I use Markdown or Git for my Documents?

If we create our documents in Markdown, then using Git will look quite natural. And that would be fine if not for our second condition: “as a result, you want to have a document in a certain format, having corporate style attributes, and created according to a certain template” (and we agreed at the beginning that it would be MS Word).


2 Answers

There are many formats that are text friendly. For example:

  • Markdown, HTML, and XML as already indicated in the comments. These files can't contain images on their own, but you can put a reference to an image (for example in the same directory or in a resource subdirectory, such as [GitHub Logo](/images/logo.png) with markdown or <img src="images/logo.png"> in html). It's not so handy as with copy/paste in a docx or odt, but it's git friendly, especially if the pictures don't change too often
  • Rich Text Format (RTF) is supported by many word processing packages. It allows embedded pictures and is stored in a text friendly format (the binary pictures are embedded in a text encoding).
like image 66
Christophe Avatar answered Sep 21 '22 19:09

Christophe


Short: use *.odt (LibreOffice Writer) and ReZipDoc (GPLv3) (disclaimer: I maintain it)


Explanation:

Quite some binary formats - among them docx (MS Word) and odt (LibreOffice Writer) - are just ZIP files that contain text- and binary-files. Using git filters, you can re-zip these without compression, which makes them much easier to compress for git, saving a lot of space in git history. This also leaves them in quite diff friendly format, without using an extra diff workflow. Still, most editing software has no problem using these files instead of the compressed ones. The main downside: Each person working on the repo has to install the filter(s)

The ReZipDoc (GPLv3) tool is made for this workflow; it contains a git filter.

The more and bigger binary files (like images) you use within your documents, and the less often they change, the more space you will save each time the text parts of your documents change, compared to not using a filter like this.

I must say though, that technically speaking, and also personally, I would also recommend Markdown over such a solution. There are already nice GUI editors available for it.

like image 43
hoijui Avatar answered Sep 18 '22 19:09

hoijui