writes markdown to target