Auto-generate index on the file

If the package directory has no index file, generate it automatically on the fly.

Follow up on #12