Did you always want to learn ConTeXt, but did not know where to start? I have written a git-based tutorial that should help you get started.
The idea of the tutorial is to start with an empty document, and add features one-by-one. Each git commit corresponds to one small change in the document, and includes pointers to the documentation corresponding to that change. Read Use this tutorial as follows:
- Clone the git repository:
git clone git://github.com/adityam/context-slides-example.git cd context-slides-example - Get git-walk (requires ruby)
wget https://raw.github.com/augustl/binbin/master/git-walk chmod +x git-walk - Checkout the first commit
git checkout init - Open the two files,
slides.texandexample.texin the editor. - Read the log message, compile
example.texand view the result.git log -n 1 context example.tex evince example.pdf & - Go to next commit and repeat step 5.
git walk next
(Alternatively, instead of using git-walk, you can use a GUI tool to incrementally checkout the commits one by one, compile example.tex at each step, and view the result).
A very useful tutorial, kudos for putting it together!
I found it a bit tricky to see what changed from commit to commit, and got tired of invoking git log over and over, so I put these commands in a script gitnext:
cp -f slides.tex slides.tex.old cp -f example.tex example.old git walk next git log > git.log context example.texThat worked nicely (except some bug in git-walk means the last six commits are added all at once): I had six small documents open together — slides.tex, slides.tex.old, example.tex, example.tex.old, git.log, and example.pdf — and one command to run to update them all.
I agree that traversing the commit tree is a bit of a pain. Your solution is a reasonable compromise.
Unfortunately, this replaced a small problem (getting a start with ConTeXt) by a much bigger one (getting a start with git) for me.
This is wonderful … everything going smoothly-ish (on Ubuntu 10.04) until:
lox% git walk next
git: ‘walk’ is not a git command. See ‘git –help’.
Did you mean this?
blame
lox%
lox% git –help
usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]
[-p|--paginate|--no-pager] [--no-replace-objects]
[--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]
[--help] COMMAND [ARGS]
The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
fetch Download objects and refs from another repository
grep Print lines matching a pattern
init Create an empty git repository or reinitialize an existing one
log Show commit logs
merge Join two or more development histories together
mv Move or rename a file, a directory, or a symlink
pull Fetch from and merge with another repository or a local branch
push Update remote refs along with associated objects
rebase Forward-port local commits to the updated upstream head
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
show Show various types of objects
status Show the working tree status
tag Create, list, delete or verify a tag object signed with GPG
See ‘git help COMMAND’ for more information on a specific command.
No, you need to download git-walk, a ruby program, from the link above.
Thanks. I’d done that, but seems I need “./git-walk next” not “git walk next”.
lox% ./git-walk next
Previous HEAD position was a227fd5… Skeleton files for creating slides
HEAD is now at 8018197… Change papersize to S4
You need git-walk in your PATH. I was assuming that . in in the PATH.
Your code listing says: git walk next (step 6) that doesn`t work, it has to be git-walk next, the command is misspelled.
By default, when you use
git name, git searches for an executable namedgit-nameand runs them. (This is how all the git commands were initially implemented). If the current directory is in the PATH, the above would work fine.