The code in the original question was on the right track. The code below was taken from the linked tutorial. Basically all I had to do was create a template file in my plugin (I just copied some code from single.php from my main theme to use as a guide into:
dirname( __FILE__ ) . '/staff-template.php'
Then when the template_redirect is run it displays that template. This assumes, of course, that libstaff is set as a query var.
function cp_libstaff_rewrite_catch_libstaff() {
global $wp_query;
// if this is not a request for json or a singular object then bail
if ( ! isset( $wp_query->query_vars['libstaff'] ) || ! is_singular() )
return;
// include custom template
include dirname( __FILE__ ) . '/staff-template.php';
exit;
}
add_action( 'template_redirect', 'cp_libstaff_rewrite_catch_libstaff' );
Tutorial link:
https://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/