slidie-mv: Slide renumbering tool

The slidie-mv command can be used to reorder slides by renumbering them.

Reordering slides

The following example illustrates how two slides could be renumbered to move them later in a show:

$ slidie-mv 100-foo.svg 200-bar.svg --after 300-baz.svg

The result would be that the slides 100-foo.svg and 100-bar.svg would be given new numerical prefixes like 400-foo.svg and 500-bar.svg.

As well as --after <slide> you can also use --before <slide>, --start or --end to specify the destination.

Whenever possible slidie-mv will attempt to rename as few files as possible. Only when necessary will slides which aren’t actively being moved be renamed.

Note

slidie-mv will attempt to infer the numbering pattern in use. That is, it will guess the ‘normal’ gap between slide numbers and the number of digits to zero-pad to.

Inserting new slides

slidie-mv can also suggest new slide numbers to use to insert new slides into your presentation using --insert <count>, for example:

$ slidie-mv --insert 1 --after 300-foo.svg
400

In the example above, slidie-mv suggested we asign our new slide the number 400.

Creating gaps

For example say we have two slides 300-foo.svg and 301-bar.svg and we want to move a slide in between them, Slidie will have to rename not just the moved slide but also either 300-foo.svg or 301-bar.svg (and potentially any further immediate adjacent slides).

The slidie-mv command will determine which files to rename, prioritising keeping the number of files renamed to a minimum (to keep version control history cleaner) and maximise the spacing of the resulting numbers (to maximise the chances of gaps existing in the future).

Renumbering all slides

You can renumber all slides to produce a clean numbering scheme using the following idiom:

$ slidie-mv *.svg --start

Managing slides in Git

If your slides are being tracked by Git, slidie-mv will attempt to use git mv to rename files. You can disable this behaviour using the --no-git-mv argument.

Argument reference

usage: slidie-mv [-h] [--insert [count]]
                 (--before slide | --after slide | --start | --end)
                 [--no-git-mv] [--allow-negative] [--dry-run]
                 [slide ...]

Reorder (i.e. renumber) slides within a show.

positional arguments:
  slide                 One or more slides to be moved. These slides will be
                        reinserted in the same relative order into the
                        sequence regardless of the order they are specified
                        here.

options:
  -h, --help            show this help message and exit
  --insert [count], -i [count]
                        Print count new slide numbers in the specified
                        position, moving existing slides as necessary to make
                        space. If not specified, count defaults to 1.
  --before slide        Move the specified slides immediately before this
                        slide.
  --after slide         Move the specified slides immediately after this
                        slide.
  --start               Move the specified slides to the start of the show.
  --end                 Move the specified slides to the end of the show.
  --no-git-mv, -G       By default this tool will attempt to use `git mv` to
                        rename files, falling back on ordinary file moving if
                        this fails (e.g. because we're not in a git repo or
                        the file is not in the repository). If --no-git/-G is
                        given, `git mv` will not be used.
  --allow-negative, -n  If given, slides may be assigned negative numbers.
                        This option is automatically enabled if any existing
                        slide which is not being moved has a negative number.
  --dry-run             If given, outputs the renumberings to be applied but
                        does not move any files.