Check for document parent

Signed-off-by: Ian Macalinao <me@ian.pw>