def shorten_ref(ref, add_to_ref):
    """Shorten references."""
    link = ':ref:{}'.format(ref.split(':ref:')[1].split(':')[0])
    linkr = link.split('<')[1].split('>')[0]
    short = '.. |{}_{}| replace:: {}'.format(add_to_ref, linkr.split('-')[-
        1], link)
    print(short.split('|')[1])
    return short
