ramnathv / poirot

Reproducible Blogging with R Markdown
http://ramnathv.github.com/poirotBlog
32 stars 19 forks source link

update only one Rmd file #24

Open stla opened 10 years ago

stla commented 10 years ago

Hello, Is there a way to run something like blogify() without knitting all Rmd files ?

ramnathv commented 10 years ago

This has been something on my mind all the time. Essentially, I want to break the blogification process into a sequence of three steps.

  1. Knit Files.
  2. Parse Files.
  3. Render Blog.

I was thinking of using a makefile for each step, so that blogifying will only run the bare minimum steps to update the blog. So for example, if an md file is not older than an Rmd file, then Step 1 need not be run.

I have still not been able to find time to implement this, but hope to get to it soon, since it is a feature I need as well :)

zhenglei-gao commented 10 years ago

Is it possible to have some function like new_page() and new_post(), so that the user actully knows what has been changed and just knit the article and render the blog accordingly?

ramnathv commented 10 years ago

I am not sure I understand. What would the output of a new_page() and new_post() function be? The goal I have outlined above is to make this seamless for the user, so that the user is free to make whatever changes they want and Poirot/Makefile will automatically do the minimum set of tasks to update the page. I am open to ideas/suggestions.

zhenglei-gao commented 10 years ago

I proposed that because those Jekyll based blogs usually have a source folder to contain the .md files. What I have in mind is to have new_page() create a .Rmd file in some /sources/pages/ and new_post() to create under /sources/posts/.

Next step will have a knit_post() or knit_page() to generate the html.

Then there should be a render_post() or render_page() to move the newly generated html files to the right place and update the index.html file.

I am not sure about this since it is not that seamless. It is not in one function like blogify(). This is my simple thinking of easing the whole development process.

ramnathv commented 10 years ago

Your thinking echoes what I had in mind as well. The only difference is that I want the user to always run only a single function blogify, which will update only the files that have changed. In the process of doing this, I might end up writing the functions that you mentioned in your comment.

zhenglei-gao commented 10 years ago

Looking forward to the new blogify then!