Factor out writing the examples to the index
Factor out writing the examples to the index

This lets us just get data from the function instead of having to jiggle
the index.

libgit2/docurium,libgit2/docurium,kostyll/docurium,kostyll/docurium,libgit2/docurium,kostyll/docurium