docs: def checkversion(version, REFVERSION=FOLIAVERSION):
      """Checks FoLiA version, returns 1 if the document is newer than the library, -1 if it is older, 0 if it is equal"""
      try:
          for refversion, docversion in zip([int(x) for x in REFVERSION.split('.')], [int(x) for x in version.split('.')]):
              if docversion > refversion:
                  return 1 #doc is newer than library
              elif docversion < refversion:
                  return -1 #doc is older than library
          return 0 #versions are equal
      except ValueError:
          raise ValueError("Unable to parse document FoLiA version, invalid syntax")