问题标签 [redcarpet]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ruby-on-rails - Redcarpet/Bluecloth 不允许标题?
有没有办法使用 Redcarpet 或 Bluecloth,这样当它插入降价时它不会产生任何标题?
例如:
产量:
标题 1
标题 1(首选)
和:
产量:
标题 2
标题 2(首选)
ruby - 如何将扩展传递给 Redcarpet Nanoc 过滤器
我正在尝试使用他们的:redcarpet
过滤器过滤 Nanoc 3 中的内容。我的代码如下所示(来自规则文件):
我想将选项传递:fenced_code_blocks
给 redcarpet 扩展,以便我可以突出显示语法。我找不到如何执行此操作的示例。https://github.com/tanoku/redcarpet描述了使用 redcarpet 时如何执行此操作。Nanoc 的文档表明我可以通过选项http://nanoc.stoneship.org/docs/api/3.2/Nanoc3/Filters/Redcarpet.html但我没有尝试过。
以下是一些不起作用的事情:
其中很多看起来不像是真正的红宝石,而且只是在黑暗中刺伤。我实际上不知道规则文件中发生了什么样的 DSL 魔法。任何帮助表示赞赏。
ruby-on-rails-3 - 红毯 2.0.1
我正在关注本教程,但它一直在说“Redcarpet:Module 的未定义方法‘新’”。我的 Gemfile 中有 gem "redcarpet"。失败的代码:
syntax-highlighting - Syntax highlighting markdown code blocks in Jekyll (without using liquid tags)
It seems like syntax highlighting in Jekyll is limited to using liquid tags and pygments like so:
But I've imported my existing blog from wordpress and it was written in markdown (using markdown code blocks) and I don't want to have to go through each post and fix the code blocks. Also, I want to keep my posts in pure markdown format in case I ever need to switch blogging platforms again.
I switched my Jekyll parser to redcarpet
with the hope that I could use this markdown syntax:
But it doesn't seem to work. It just wraps it in a normal code
block. Any ideas?
github - 如何将 github 风格的 Markdown 转换为 HTML?
我知道 github 已经发布了用于将 markdown 转换为 HTML 的 Redcarpet gem,但据我所知,它不支持(或识别)Github 风格的 markdown,例如
javascript
var x = 1;
任何人都知道是否有 gem(或 redcarpet 的某种方式)来处理 github 风格的语法,特别是我对语法突出显示感兴趣。
谢谢。
ruby-on-rails - ruby 可以在 markdown 中渲染吗?Ruby on Rails 应用程序
是否可以在我的 Ruby on Rails 应用程序的 markdown 中使用 ruby?我正在使用 RedCarpet gem,我的应用程序控制器中有以下内容。
这是联系人的架构
所以我有联系信息可以使用,有没有办法告诉降价渲染器将 <%= @contact.phone %> 渲染为 @contact.phone 的值而不是纯文本?或者我需要使用其他东西然后降价吗?
编辑1:
在此处渲染降价:
app/helpers/application_helper.rb
应用程序/视图/站点/show.html.erb
编辑2:
这是我的解决方案,谢谢。我将您的代码集成到我的标记助手中,这似乎到目前为止有效。
ruby - 代码块中的 Markdown 换行符
使用 Redcarpet,当我在降价中包含以下内容时,它不尊重任何换行符或缩进。我在行尾尝试了两个空格。代码之间的额外行。似乎没有任何效果。
我懂了:
以下是红地毯设置:
我需要做什么才能使行正确中断并保留缩进,就像这里或 GitHub 上的一样?
更新- 源代码如下:
ruby-on-rails - 红地毯和中间人::with_toc_data
我想知道如何将 Redcarpet 的:with_toc_data选项用于 Markdown 与Middleman(基于 Sinatra 的静态站点生成器)一起使用。
我们当前的config.rb:
这不起作用:
非常感谢任何帮助!
sinatra - Redcarpet 的 Sinatra 渲染和传递渲染选项
我正在使用 Sinatra,而 Sinatra 使用 Tilt 进行模板渲染。
默认情况下,Redcarpet 有许多渲染扩展。如何通过 Sinatra 的#render
方法使用其中一些扩展?
我需要渲染带有:gh_codeblock
扩展名的降价文件。