I'm using Redcarpet as markdown tool and coderay for syntax highlighting in my rails app. What I want is a preview of what is being written in markdown format before posting it in database. A far better option is a live preview of what's being written like stackoveflow. I know there are many other options but is there any way to stick with redcarpet and coderay and still having a preview of my post with syntax highlighting? Most of the preview options skip the syntax highlighting portion, they even can't detect codes! At least detecting that portion as a code will do. I just need a preview of my post before publishing it. How can I achieve that? I am not interested in using any WYSIWYG editor either!
Markdown live preview like stackoverflow for redcarpet on rails
1.4k Views Asked by Shuvro At
1
There are 1 best solutions below
Related Questions in RUBY-ON-RAILS
- Rails HABTM: Select everything a that a record 'has'
- Best way to make an HABTM association via console
- dynamically create an ical / ics file from a rails model
- Ruby destroy is not working? Or objects still present?
- NoMethodError: undefined method `update_average_rating' for nil:NilClass
- Select results where joined table contains records with an attribute, but without another
- Showing posts only created when boolean was true
- Ruby on rails and HAML - Print a hash with background color
- How can I monitor an endpoint's status with Ruby?
- How to create dynamic pages without form_for helper in Rails?
- Rails 4.2 jQuery loads only after refresh
- "Access Denied" - User's Permissions to S3 Bucket
- ActiveRecord, Rails 4: has_many :through with scoped conditions failure
- Rails - formatting a list of options
- Rails - Ajax do not work properly on production server
Related Questions in MARKDOWN
- Jekyll: Using liquid tags in .md files
- Pandoc - HTML to Markdown not processing nested unordered lists correctly
- why Special characters apostrophe and others shows like this ’, in HTMl file
- —- " added in HTML when converting MarkDown file to HTML using Jekyll tool
- Mathematics not working when converting from LaTeX to docx (through markdown) using pandoc
- Grouping MarkDown elements in to DIV element or Custom html tag
- How to document all npm dependencies from package.json into README.md
- Can I render and display Markdown from Github into MEAN stack website dynamically?
- How to use Python filter with Pandoc to convert md with tikz to html on Windows 8.1
- How to modify the line width of ipython notebook markdown cell
- suppress console output in r markdown, but keep plot
- Jekyll: Liquid Capture and Markdownify Tag Issues
- Nested bullets with code blocks in markdown for Github
- Three-level nested list in kramdown
- Extracting URL and anchor text from Markdown using Python
Related Questions in REDCARPET
- Prevent injection attack form Redcarpet gem in rails
- Jekyll and Redcarpet (plus dependencies)
- How to detect code language for markdown?
- Not able to get line breaks using redcarpet
- Convert Jekyll posts with Redcarpet
- Has anyone figured out how to embed video using the Redcarpet gem for Markdown in Rails 3.2?
- How to Display Brackets Correctly in Code in User Comments?
- How to use rails method in .js.erb and pass it javascript argument?
- Syntax highlighting in jekyll using redcarpet
- Jekyll + redcarpet line numbers
- Using ERB in Markdown with Redcarpet in Rails 7.1
- Sinatra render and passing rendering options for Redcarpet
- Underscore issues: Jekyll + redcarpet == Github flavored markdown?
- Redcarpet Markdown gem: instantiating the Markdown object only once & reusing it between parses
- simple formatting/parsing in markdown for blockquotes
Related Questions in CODERAY
- How to select a different theme/style for CodeRay syntax highlighting Ruby code?
- coderay solarized
- Deploying to Heroku: CodeRay is not Precompiled - How to remove?
- using Coderay with a html.erb file
- How can I use RedCarpet without CodeRay to implement markdown in my blogs?
- How to integrate redcloth with coderay
- Is there a VB.NET plugin for CodeRay (or any VB.NET syntax highlighting)?
- Code Syntax Highlighting with coderay
- How to add line breaks to Redmine markdown in code highlighting?
- Getting the list of available languages
- How to mark search phrase in syntax highlighted markdown code?
- How do I get Haml to stop from evaluating #{var} values inside <pre> <code> tags?
- RVM Errno::EACCESS pry pry-doc
- Markdown live preview like stackoverflow for redcarpet on rails
- Can Coderay re-indent C (or C-like) code?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Your options are either to stick with Redcarpet and use Ajax or to switch to a javascript based markdown processor like: https://github.com/evilstreak/markdown-js and a javascript based syntax highlighter such as: https://github.com/google/code-prettify
With your current setup you'd have to send the markdown to the server via Ajax, process it with Redcarpet then send it back to the browser and inject it into a preview area. This will be much slower and more taxing on your server when traffic goes up. I wouldn't recommend it.
Switch to the js based markdown processor and syntax highlighter so you can do it all in the browser.