convert document titles from headers to metadata