rdiscount

jekyll not generating _posts

ε祈祈猫儿з 提交于 2020-01-16 01:01:12
问题 I'm have trouble getting jekyll to convert a post in _posts directory to html. It generates index.md correctly, but doesn't generate anything for posts. When I add 'source: _posts' then it converts the post, but doesn't convert index.md. As far as I can tell, 'source' should either be not added to _config.yml to should point to '.' My directory structure is pretty standard: $ find .|fgrep -v bootstrap . ./index.md ./_config.yml ./_drafts ./_includes ./_includes/footer.html ./_includes/header

RDiscount :generate_toc with Sinatra

强颜欢笑 提交于 2020-01-04 09:11:11
问题 So I have sinatra setup with Rdiscount to render a markdown file with a HAML layout. This all works but I want RDiscount to generate a table of contents based on the headers in my haml file. I've tried setting it in the sinatra configuration. set :markdown, :generate_toc => true but that doesn't seem to work. I've also tried doing it when I render the markdown like so: markdown :PAGENAMEHERE, :layout => :'layouts/PAGENAMEHERE', :generate_toc => true which also doesn't work. Is this even

Are numbered headings in Markdown / Rdiscount possible?

﹥>﹥吖頭↗ 提交于 2019-12-20 08:27:49
问题 I'm trying to produce html with section / subsection headings resembling the following: My top-level topic 1.1 My first subtopic 1.2 Another subtopic 1.2.1 A sub-subtopic Another top-level topic Are there any implementations of Markdown capable of producing these kinds of numbered section headings? Thanks in advance. 回答1: Yes, try Pandoc. This works for me: pandoc --number-sections < test.md > out.html (Source) Markdown to produce the numbered outline you mention in the original post looks

Syntax highlighting with CodeRay and Markdown (RDiscount) in a Rails 3 application

会有一股神秘感。 提交于 2019-12-06 05:09:23
问题 I'm trying to add some syntax highlighting to my blog that currently uses RDiscount. I am converting the Markdown to HTML with RDiscount then parsing the HTML code blocks with CodeRay to add syntax highlighting. This is what I have so far: class Post < ActiveRecord::Base before_save :render_body def render_body self.rendered_body = coderay(markdown(self.body)) end def markdown(text) RDiscount.new(text).to_html end def coderay(text) text.gsub(/\<code( lang="(.+?)")?\>(.+?)\<\/code\>/m) do

How can I use rdiscount on Heroku?

对着背影说爱祢 提交于 2019-12-05 16:34:12
问题 I am trying to push a small test app to Heroku. Here is the App and the Gem file: App: require 'sinatra' require 'haml' require 'rdiscount' set :markdown, :layout_engine => :haml, :layout => :layout get '/' do haml :index end get '/blog' do markdown :test end Gemfile: source :rubygems gem 'sinatra' gem 'thin' gem 'haml' gem 'rdiscount' Before pushing to Heroku I run bundle install . But pushing to Heroku fails when trying to install the rdiscount gem: -----> Ruby/Rack app detected ----->

haml with markdown claims rdiscount not found

依然范特西╮ 提交于 2019-12-04 13:42:23
问题 I've specified gem 'haml' gem 'rdiscount' in my Gemfile and ran bundle install The relevant code is .welcome-message :markdown Welcome **#{current_user.email}** When I access the page I get Can't run Markdown filter; required 'rdiscount' or 'peg_markdown' or 'maruku' or 'bluecloth', but none were found I'm using rails 3.0.5, what am I missing? 回答1: Turns out I'm an idiot. All that was needed was to restart the server. Carry on everyone. 来源: https://stackoverflow.com/questions/5424504/haml

Syntax highlighting with CodeRay and Markdown (RDiscount) in a Rails 3 application

拟墨画扇 提交于 2019-12-04 10:15:30
I'm trying to add some syntax highlighting to my blog that currently uses RDiscount. I am converting the Markdown to HTML with RDiscount then parsing the HTML code blocks with CodeRay to add syntax highlighting. This is what I have so far: class Post < ActiveRecord::Base before_save :render_body def render_body self.rendered_body = coderay(markdown(self.body)) end def markdown(text) RDiscount.new(text).to_html end def coderay(text) text.gsub(/\<code( lang="(.+?)")?\>(.+?)\<\/code\>/m) do CodeRay.scan($3, $2).div(:css => :class) end end end And in my view: <%= raw @post.rendered_body %> Using

haml with markdown claims rdiscount not found

荒凉一梦 提交于 2019-12-03 09:12:18
I've specified gem 'haml' gem 'rdiscount' in my Gemfile and ran bundle install The relevant code is .welcome-message :markdown Welcome **#{current_user.email}** When I access the page I get Can't run Markdown filter; required 'rdiscount' or 'peg_markdown' or 'maruku' or 'bluecloth', but none were found I'm using rails 3.0.5, what am I missing? Turns out I'm an idiot. All that was needed was to restart the server. Carry on everyone. 来源: https://stackoverflow.com/questions/5424504/haml-with-markdown-claims-rdiscount-not-found

Are numbered headings in Markdown / Rdiscount possible?

纵饮孤独 提交于 2019-12-02 17:15:14
I'm trying to produce html with section / subsection headings resembling the following: My top-level topic 1.1 My first subtopic 1.2 Another subtopic 1.2.1 A sub-subtopic Another top-level topic Are there any implementations of Markdown capable of producing these kinds of numbered section headings? Thanks in advance. Yes, try Pandoc . This works for me: pandoc --number-sections < test.md > out.html ( Source ) Markdown to produce the numbered outline you mention in the original post looks like this: # My top-level topic ## My first subtopic ## Another subtopic ### A sub-subtopic ## Another top