2013-06-12 41 views
8

我想發佈如下基本博客文章: (Example blog post)使用我的R降價文件。將R降價文件發佈爲博客文章

但我想發佈它在Wordpress(而不是wordpress.com)。

  • 最有希望的解決方案似乎是Yihui's function。我試過 ,但得到了很多錯誤並停止嘗試。我使用Windows,似乎Yihui的knit2wp函數在Linux中穩定運行。 (我從他的網頁中的評論之一中扣除此)
  • 以下帖子並沒有幫助:this,this
  • 我試圖發佈我在github中的降價(this) 在Jerom Anglim's blog post(非常豐富的博客文章BTW)中提到。無法弄清楚如何將github文件嵌入到Wordpess中。
  • 我認爲我的整個博客移動到Jekyll作爲one very good example,但它 似乎是非常艱鉅的改變整個博客結構。

沒有解決方案爲我工作。我放棄。複製和粘貼代碼和格式是非常低效的。我無法正確對齊我的r輸出。
有沒有其他的方式,我沒有偶然發現並可能解決(或緩解)我的問題?
在此先感謝您的回覆。

+0

+1因爲我感覺你的痛苦......我也嘗試了很多選擇。我結束了使用'ruhoh',到目前爲止不後悔。我寫了一篇關於[這裏]的博客文章(http://christophj.github.io/replicating/tutorial/how-to-set-up-a-new-blog-with-ruhoh-on-github/)。但是,這又是Jekyll的衍生品,所以你也需要改變整個博客結構。 –

+0

你可能會覺得這很有用:https://github.com/johnjosephhorton/md2blog –

+0

你最終做了什麼? –

回答

0

您是否嘗試過「Pretty R語法突出顯示器」(http://www.inside-r.org/pretty-r/tool)?它可能是一個很好的臨時修復,直到你有其他工作。

此代碼:

y <- 1:10 
plot(y) 

被變成了這樣:

`<div style="overflow:auto;"><div class="geshifilter"><pre class="r geshifilter-R" style="font-family:monospace;">y <span style="">&lt;-</span> <span style="color: #cc66cc;">1</span><span style="">:</span><span style="color: #cc66cc;">10</span> 
<a href="http://inside-r.org/r-doc/graphics/plot"><span style="color: #003399; font-weight: bold;">plot</span></a><span style="color: #009900;">&#40;</span>y<span style="color: #009900;">&#41;</span></pre></div></div><p><a href="http://www.inside-r.org/pretty-r" title="Created by Pretty R at inside-R.org">Created by Pretty R at inside-R.org</a></p>` 

,當在你的HTML嵌入,顯示是這樣的:

Ÿ< - 1:10

plot ( y )

Created by Pretty R at inside-R.org