I’d like to sync my theme’s README.markdown into a page on my site and would love to be able to only have to update that text a single time — namely, when I commit my code up to BitBucket. I have my theme doing hg pull -u
on a regular basis, so the code stays fresh and the README will get updated every time I make a change to the source, but my WordPress page containing the README then needs to get updated by hand.
(I’m using Mark Jaquith’s Markdown on Save to do the MD->HTML dance.)
Any thoughts?
I achieved that using WP-Cron capabilities.
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 doinghg pull -u
.You may parse the markdown file and show the contents in the page with some method, say with shortcode. When you update the file, it’ll automatically updated. Cause, it’ll be parsing the markdown file and serving the HTML automatically.