docs: Add TOC template logic for ARC docs am: 99aacfe834
am: 12636da2e0

Change-Id: I883c32143d28a635932a30f9a97f4c5c2997a7d4