def chan_path_from_rel_path(rel_path, channeldir):
    """
    Convert `rel_path` form os.walk tuple format to a tuple of directories and
    subdirectories, starting with the `channeldir` folder, e.g.,::

        >>> chan_path_from_rel_path('content/open_stax_zip/Open Stax/Math/Elementary',
                                'content/open_stax_zip/Open Stax')
        'Open Stax/Math/Elementary'
    """
    rel_path_parts = rel_path.split(os.path.sep)
    dirs_before_channeldir = channeldir.split(os.path.sep)[:-1]
    channel_chan_path = []  # path relative to channel root, inclusive
    for idx, part in enumerate(rel_path_parts):
        if idx < len(dirs_before_channeldir) and dirs_before_channeldir[idx]==part:
            continue
        else:
            channel_chan_path.append(part)
    chan_path = os.path.join(*channel_chan_path)
    return chan_path
Convert `rel_path` form os.walk tuple format to a tuple of directories and
    subdirectories, starting with the `channeldir` folder, e.g.,::

        >>> chan_path_from_rel_path('content/open_stax_zip/Open Stax/Math/Elementary',
                                'content/open_stax_zip/Open Stax')
        'Open Stax/Math/Elementary'