我一直在阅读Rstudio Markdown教程,试图找出如何在.rmd文件中对我的代码进行语法高亮显示,但无法弄清楚。谁知道怎么做?我现在的输出目标是.html,但如果需要可以改变。谢谢!
我尝试过的一小段代码片段。页面文本工作正常,但代码不突出显示:
---
title: Eve Historical Market Analysis
author:
date: 12/3/18
output:
prettydoc::html_pretty:
theme: cayman
highlight: github
---
```
library(rmarkdown) #used for syntax highlighting in this document
library(shiny)
```
#read in file of item ids from website and parse
```
url = "http://eve-files.com/chribba/typeid.txt"
df = read_fwf(url, fwf_empty(url), skip = 2)
colnames = read_table(url, n_max = 1)
names(df) = names(colnames)