====== How to work with teachpress ====== ===== Template ===== You can find a template for the weekly assignments [[http://teachpress.environmentalinformatics-marburg.de/2014/05/learning-log-template/|here]]. ===== Highlight code syntax ===== In order to publish syntax highlighted code in wordpress, type the following in your post editor view: * Insert: "[code lang=""]" where you want to insert code * Mark the line and assign "preformatted" as paragraph format * In the next line(s), enter your code or paste it as a whole (make sure, that you are still in the "preformatted" section. * Insert: "[/code]" at the end For Python code use "Python" instead of . For R code use "R" instead of . Example for Python: This is some text and now you want to enter code. [code lang="Python"] print "Hello" for i in range[0,10]: print i [/code] This is more text. Everything from "[code lang..." to ".../code]" must be formated as "preformatted" ===== Include Rmd content ===== If you want to add html content created by the R markdown language to teachpress, one option would be the use of the //RWordPress// package. Since this package is (at the time of this writing) not available for the latest R version and to easy things up a little bit, we just go for the copy/paste approach. * Save the knitted html output of your Rmd file on your hard disk * Open the file using a text editor * Copy everything between //// and //// (i.e. everything from line 3 to the end) * Create a new post in teachpress and switch to the text mode of the editor (tab "text" on the upper right side of the text input window" * Paste the content from your HTML file into the window * Adjust your categories as usual and publish it