Creating a clean presentation style in 40 commits

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:

  1. Clone the git repository:
    git clone git://github.com/adityam/context-slides-example.git
    cd context-slides-example
  2. Get git-walk (requires ruby)
    wget https://raw.github.com/augustl/binbin/master/git-walk
    chmod +x git-walk
  3. Checkout the first commit
    git checkout init
  4. Open the two files, slides.tex and example.tex in the editor.
  5. Read the log message, compile example.tex and view the result.
    git log -n 1
    context example.tex
    evince example.pdf &
  6. 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).

Advertisements

10 thoughts on “Creating a clean presentation style in 40 commits

  1. 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.tex
    

    That 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.

  2. 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.

        • 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

              • By default, when you use git name, git searches for an executable named git-name and 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.

                • By default the current directory is never in the PATH because it is a security hazzard. however, you could alter you instruction to include your remark above and add a remark to move the git-walk to a directory that is on the PATH, like /usr/local/bin or such.

                  I did not know git worked that way, but I understand now a little better! Thanks.

                  Guus.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s