Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit 7a11a78

Browse files
committed
Change mermaid diagrams to their png versions for the PDF builder
1 parent 2371ec4 commit 7a11a78

File tree

3 files changed

+103
-26
lines changed

3 files changed

+103
-26
lines changed

src/vcs/basics.txt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,18 @@ Remember that each file in your working directory can be in one of two states:
9696
Untracked basically means that Git sees a file you didn't have in
9797
a previous snapshot (commit), and which hasn't been yet staged.
9898

99-
.. mermaid:: /../assets/mermaid/git/lifecycle.mmd
100-
:align: center
101-
:caption: The lifecycle of the status of repo's files
99+
.. only:: html
100+
101+
.. mermaid:: /../assets/mermaid/git/lifecycle.mmd
102+
:align: center
103+
:caption: The lifecycle of the status of repo's files
104+
105+
.. only:: latex
106+
107+
.. figure:: /../assets/mermaid/git/lifecycle.mmd.png
108+
:align: center
109+
110+
The lifecycle of the status of repo's files
102111

103112
Checking out status of the file(s)
104113
----------------------------------

src/vcs/branch.txt

Lines changed: 84 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,18 @@ zero parents for the initial commit, one parent for a normal commit,
2121
and multiple parents for a commit that results from a merge of two or more
2222
branches.
2323

24-
.. mermaid:: /../assets/mermaid/git/commits.mmd
25-
:align: center
26-
:caption: Commits tree
24+
.. only:: html
25+
26+
.. mermaid:: /../assets/mermaid/git/commits.mmd
27+
:align: center
28+
:caption: Commits tree
29+
30+
.. only:: latex
31+
32+
.. figure:: /../assets/mermaid/git/commits.mmd.png
33+
:align: center
34+
35+
Commits tree
2736

2837
A branch in Git is simply a lightweight movable pointer to one of these
2938
commits. The default branch name in Git is master. As you start making commits,
@@ -156,9 +165,18 @@ last commit on ``master`` branch, Git simply moves the pointer forward.
156165
Changes from ``feature/issue53`` are now in the snapshot of the commit pointed
157166
to by the ``master`` branch.
158167

159-
.. mermaid:: /../assets/mermaid/git/merge-1.mmd
160-
:align: center
161-
:caption: Fast-forward merge
168+
.. only:: html
169+
170+
.. mermaid:: /../assets/mermaid/git/merge-1.mmd
171+
:align: center
172+
:caption: Fast-forward merge
173+
174+
.. only:: latex
175+
176+
.. figure:: /../assets/mermaid/git/merge-1.mmd.png
177+
:align: center
178+
179+
Fast-forward merge
162180

163181
Now, lets assume another developer started working on ``feature/issue54`` at
164182
the same time. And there are few commits on this feature branch. Suppose,
@@ -188,9 +206,18 @@ that results from this three-way merge and automatically creates a new commit
188206
that points to it. This is referred to as a *merge commit*, and is a special in
189207
that it has more than one parent.
190208

191-
.. mermaid:: /../assets/mermaid/git/merge-2.mmd
192-
:align: center
193-
:caption: Merge commit
209+
.. only:: html
210+
211+
.. mermaid:: /../assets/mermaid/git/merge-2.mmd
212+
:align: center
213+
:caption: Merge commit
214+
215+
.. only:: latex
216+
217+
.. figure:: /../assets/mermaid/git/merge-2.mmd.png
218+
:align: center
219+
220+
Merge commit
194221

195222
Merge conflicts
196223
---------------
@@ -271,9 +298,18 @@ the ``merge`` and the ``rebase``.
271298
Earlier, there was an example of diverged work and commits made on two
272299
different branches.
273300

274-
.. mermaid:: /../assets/mermaid/git/rebase-1.mmd
275-
:align: center
276-
:caption: Before rebase
301+
.. only:: html
302+
303+
.. mermaid:: /../assets/mermaid/git/rebase-1.mmd
304+
:align: center
305+
:caption: Before rebase
306+
307+
.. only:: latex
308+
309+
.. figure:: /../assets/mermaid/git/merge-2.mmd.png
310+
:align: center
311+
312+
Merge commit
277313

278314
The easiest way to integrate the branches, as we've already covered, is
279315
the ``merge`` command. It performs a three-way merge between the two latest
@@ -298,9 +334,18 @@ those diffs to temporary files, resetting the current branch to the same
298334
commit as the branch you are rebasing onto, and finally applying each change
299335
in turn.
300336

301-
.. mermaid:: /../assets/mermaid/git/rebase-2.mmd
302-
:align: center
303-
:caption: After rebase
337+
.. only:: html
338+
339+
.. mermaid:: /../assets/mermaid/git/rebase-2.mmd
340+
:align: center
341+
:caption: After rebase
342+
343+
.. only:: latex
344+
345+
.. figure:: /../assets/mermaid/git/rebase-2.mmd.png
346+
:align: center
347+
348+
After rebase
304349

305350
.. note::
306351
Other maintainers prefer to rebase (or cherry-pick) contributed work on
@@ -318,9 +363,18 @@ of commits on a topic branch and you want to integrate only one of them,
318363
or if you only have one commit on a topic branch and you'd prefer to
319364
cherry-pick it rather than run rebase.
320365

321-
.. mermaid:: /../assets/mermaid/git/cherry-pick.mmd
322-
:align: center
323-
:caption: Cherry-pick a commit
366+
.. only:: html
367+
368+
.. mermaid:: /../assets/mermaid/git/cherry-pick.mmd
369+
:align: center
370+
:caption: Cherry-pick a commit
371+
372+
.. only:: latex
373+
374+
.. figure:: /../assets/mermaid/git/cherry-pick.mmd.png
375+
:align: center
376+
377+
Cherry-pick a commit
324378

325379
::
326380

@@ -368,6 +422,15 @@ new features and bug fixes are integrated smoothly before being released.
368422
This strategy is particularly useful for projects with regular releases and
369423
a team working on multiple features concurrently.
370424

371-
.. mermaid:: /../assets/mermaid/git/gitflow.mmd
372-
:align: center
373-
:caption: GitFlow diagram
425+
.. only:: html
426+
427+
.. mermaid:: /../assets/mermaid/git/gitflow.mmd
428+
:align: center
429+
:caption: GitFlow diagram
430+
431+
.. only:: latex
432+
433+
.. figure:: /../assets/mermaid/git/gitflow.mmd.png
434+
:align: center
435+
436+
GitFlow diagram

src/vcs/intro.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,15 @@ Git has three main states that your files can reside in:
6868
to go into your next commit snapshot.
6969
- Committed means that the data is safely stored in your local database.
7070

71-
.. mermaid:: /../assets/mermaid/git/states.mmd
72-
:align: center
71+
.. only:: html
72+
73+
.. mermaid:: /../assets/mermaid/git/states.mmd
74+
:align: center
7375

76+
.. only:: latex
7477

78+
.. figure:: /../assets/mermaid/git/states.mmd.png
79+
:align: center
7580

7681
The basic Git workflow goes something like this:
7782

0 commit comments

Comments
 (0)