syntax-highlighting

HTML5 rich-text inside textarea

China☆狼群 提交于 2019-11-29 06:18:27
I heard that the new HTML5 will add rich text capability to textareas (it will make them more flexible), so you can do stuff like code syntax highlighting editors without very nasty javascript (like creating iframes and stuff). Is this true? Are there browsers with support for it yet? And where can I find some API? Are you looking for Aloha Editor ? It's using the new contenteditable attribute to add a WYSIWYG editor to any div you choose. Look at the demos . NO - jQuery If what you where looking for (the same as me) is NO-jquery tools (pure HTML/CSS + basic JS), then some of the best options

Use Syntax Highlighter on AJAX loaded content

强颜欢笑 提交于 2019-11-29 06:13:54
问题 How can I use Alex Gorbatchev`s Syntax Highlighter on content loaded after 'window' emits 'load' event? I am trying this way: $.ajax({ url: file, success: function(data) { $('.fileName').text(file); $('#fileSource > pre').text(data); SyntaxHighlighter.all(); } }); ... but it is not working. I need to mention that the ajax call can occure at any time after the page loads. Regards 回答1: - SyntaxHighlighter.all() binds window load. So if you want to highlight element when the page loads, then use

Vim inconsistently syntax highlighting bash files

♀尐吖头ヾ 提交于 2019-11-29 06:12:05
问题 When I open some bash script files with vim it sometimes identifies them as conf files, that's okay, I can just correct that by setting the filetype to sh with :setf sh . That great, except I've noticed that this doesn't fix things entirely: Notice that shopt is properly highlighted on the left, but not on the right, where I manually set the filetype to sh . This means that when a file is identified as bash or sh by vim, it sets the filetype to sh but then does some extra steps that I'm not

Add syntax highlighting to .less-files in NetBeans

风格不统一 提交于 2019-11-29 05:06:22
问题 I want to have files with a .less extension use the CSS syntax highlighting in NetBeans, and I don't have any clue how to do this. I found a rather time consuming way to do this (http://netbeans.dzone.com/tips/quickstart-guide-language-supp), but it hit me that it must be easier way to do this. Anyone knows? 回答1: a module which adds full less highlighting support can be downloaded from the following page: http://plugins.netbeans.org/plugin/32782/lesscss-module i tested the module with

Knitr inline chunk options (no evaluation) or just render highlighted code

社会主义新天地 提交于 2019-11-29 03:47:56
I cannot find information on whether it is possible to specify options for inline chunks in knitr. I've just tried specifying them, as in the regular chunk, but this gives an error. What I need is to include R code with highlighting in a PDF, but without evaluating it. This can only happen with inline chunks due to the format of the context. Or perhaps there is another way to include highlighted code. To provide an example, I need something in the lines of: Some text about something with `r eval=FALSE 1+1` inside the sentence. This particular syntax gives: Error in parse(text = code, keep

How do I make my own method similar to String.Format using Composite Formatting in C#

南楼画角 提交于 2019-11-29 03:00:48
I like how String.Format uses arguments to inject variables in to the string it is formatting. This is called Composite Formating and is discussed by MSDN here . I want this functionality with my logging facade: string foo = "fancy"; string bar = "message"; log.Debug("My {0} log {1}.", foo, bar) My ILoggerFacade has the following method signature: void Debug<T>(T message, params Object[] args); And, I know I can implement this quite simply: ILog m_Log = \\some logging implementation public void Debug<T>(T message, params Object[] args) { m_Log.Debug(String.Format(message, args)); } However, in

Where can I change the Asp.net MVC 3 Razor syntax highlighting in VS10?

别来无恙 提交于 2019-11-29 02:59:40
I searched Tools > Options, but where in VS10 can I turn off or change the default highlighting for the new Razor view on the @nuggets in ASP.NET MVC 3? Andrew Stanton-Nurse Razor only adds one entry to Fonts & Colors, "Razor Code". That controls the background color given to Razor Code nuggets. The rest of the colors are the same as the C#/VB colors. The "@" character itself and Razor keywords like "model" and "section" use the same color as the ASPX "<%" tag ("HTML Server-Side Script", thanks to another Andrew for digging up the specific entry). If you'd rather we had separate entries for

Highlighting unmatched brackets in vim

烂漫一生 提交于 2019-11-29 02:51:11
问题 I'm getting burned repeatedly by unmatched parentheses while writing python code in vim. I like how they're handled for C code - vim highlights in red all of the curly braces following the unmatched paren. I looked at the c.vim syntax file briefly to try to understand it, but the section that handles bracket errors is very complex. Can anyone explain how that code works and suggest how I might write something similar for python code? Example C code with unmatched parens: int main(void { /*

How do I implement Rouge syntax highlighting in Rails?

依然范特西╮ 提交于 2019-11-29 02:48:54
问题 There are a bunch of tutorials floating around, but they seem to be incomplete or not fully current or don't fully work for me. This is what I have done. Gemfile: gem 'rouge' gem 'redcarpet' Then I created a config/initializer/rouge.rb : require 'rouge/plugins/redcarpet' Then I created a file called app/assets/stylesheets/rouge.css.erb <%= Rouge::Themes::Github.render(:scope => '.highlight') %> Then in my app/helpers/application_helper.rb , I added this: module ApplicationHelper class HTML <

Eclipse: syntax highlighting disappeared for one of my files

蓝咒 提交于 2019-11-29 02:32:44
问题 I was trying to close unused files in Eclipse and accidentally made something wrong. Now I can't see syntax highlighting for one of my files. Here are two screenshots - on the first you can see file, where highlighting is broken, and on the second everything is fine: Highlighting doesn't work for this file only. Extension of this file is correct. I tried to look through all menu buttons carefully, but this attempt failed, I suppose Eclipse is hard enough for newbie. Of course, I tried to find