I achieved that using WP-Cron capabilities.
add_action('wp', 'wpse_26170_activation');
function wpse_26170_activation() {
if ( !wp_next_scheduled( 'wpse_26170_update_readme_page' ) ) {
wp_schedule_event( current_time( 'timestamp' ), 'daily', 'wpse_26170_update_readme_page');
}
}
function wpse_26170_update_readme_page() {
$page = array(
'ID' => 767,
'post_content' => Markdown( file_get_contents( 'path/to/readme.markdown' ) )
);
if (
// Filters return true if they existed before you removed them
remove_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' ) &&
remove_filter( 'content_save_pre', 'wp_filter_post_kses' )
) {
$page['post_content'] = wp_kses_post( $page['post_content'] );
}
wp_update_post($page);
}
Now this cron job should run every day updating the page with readme, please note that you have to change ‘ID’ with your page ID and path to the Markdown file.
If you have troubles getting cron to run please read the following post from Nettuts http://wp.tutsplus.com/articles/insights-into-wp-cron-an-introduction-to-scheduling-tasks-in-wordpress/
Also you still need Markdown On Save
plugin because this function uses Markdown class from it.
Actually you can just call the wpse_26170_update_readme_page
functions after doing hg pull -u
.