我正在IJulia中设置一个自定义样式表。
file = open("style.css") # A .css file in the same folder as this notebook file
style = readall(file) # Read the file
HTML("$style") # Output as HTML
错误:
UndefVarError: readall not defined
Stacktrace:
[1] top-level scope at In[6]:3
我知道您在询问如何将整个文件读取到String
。方法如下:
style = open("style.css") do f
read(f, String)
end
注意,这假设style.css
是UTF-8编码的(使用纯ASCII编码也可以(