In order to create the list of anchor tags dynamically, I used wordpress’s ‘get_pages’ function. Here is a copy of the code I used in order to achieve an un-ordered list of the pages in my site.
<ul>
<?php $args = array('sort_column' => 'menu_order');
$pages = get_pages($args);
foreach ($pages as $pagg) : setup_postdata($post);?>
<li><a href="#<?php echo(get_the_title($pagg->ID));?>"class="panel"><?php echo(get_the_title($pagg->ID));?></a></li>
<?php endforeach; ?>
</ul>
Hopefully this helps.
– Anthony