2
我想先寫一個哲基爾插件,它做的東西就降價文件,並通過內容返回到默認的轉換器如何在自定義轉換後將內容傳遞給jekyll默認轉換器?
例如,
module Jekyll
class RMarkdownConverter < Converter
safe :false
priority :high
def matches(ext)
ext =~ /^\.(md|markdown)$/i
end
def output_ext(ext)
".html"
end
def convert(content)
# do something with content
# then pass it back to default converter
end
end
end
眼下,最接近的是我能得到它
converter = Jekyll::Converters::Markdown::KramdownParser.new(@config)
converter.convert(content)
但所有的高亮代碼正在失去顏色......我懷疑還有其他問題...
我的問題是: 什麼是調用默認轉換器的正確方法?
事實證明https://github.com/navarroj/krampygs解決了我的問題。感謝您的輸入。 –