syntax-highlighting

Maven javadoc - how to include centralized resources

ⅰ亾dé卋堺 提交于 2019-12-04 13:18:24
问题 I'm trying to include centralized resources (e.g. image files, js files) into my Maven generated javadoc. Such centralized resources would come from a dependency. (in my case I would like to always include certain resources, Javascript files, that allows to do nice syntax highlighting of example code inside Javadoc, and also to use a special stylesheet) There's substantial information on how to do this if you include your resources locally with your project. That's not what I want as I need

Define a syntax region which depends on the indentation level

﹥>﹥吖頭↗ 提交于 2019-12-04 13:00:26
I'm trying to built a lighter syntax file for reStructuredText in Vim. In rst, literal blocks start when "::" is encountered at the end of a line: I'll show you some code:: if foo = bar then do_something() end Literal blocks end when indentation level is lowered. But, literal blocks can be inside other structures that are indented but not literal: .. important:: Some code for you inside this ".. important" directive:: Code comes here Back to normal text, but it is indented with respect to ".. important". So, the problem is: how to make a region that detects the indentation? I did that with the

How to enable Mathematica syntax highlighting for MediaWiki using extension “SyntaxHighlight GeSHi”?

时光毁灭记忆、已成空白 提交于 2019-12-04 12:58:49
I'd like to syntax highlight Mathematica code on a MediaWiki site. I've already installed the MediaWiki extension SyntaxHighlight GeSHi and verified that it works for other languages. I tried simply putting a Mathematica langauge data file mathematica.php into MediaWiki's extension path wiki/extensions/SyntaxHighlight_GeSHi/geshi , however it didn't correctly highlight a Mathematica code block such as: <syntaxhighlight lang="Mathematica"> (* this is a comment *) List[Sin[x], Cos[x], Tan[x]]; </syntaxhighlight> Any ideas? I do not see Mathematica listed as a supported language at http://qbnz

Syntax highlight for Sass is not working in Vim

淺唱寂寞╮ 提交于 2019-12-04 12:16:37
I just downloaded a Vim plugin for Sass syntax highlight. The instructions say: install details put it into syntax directory and add sass filetype au! BufRead,BufNewFile *.sass setfiletype sass in your filetype.vim I already placed sass.vim in vimfiles/syntax/ (using windows). And created a filetype.vim file with the code above ( au! Buf... ) in all the following directories: vimfiles/ vimfiles/ftdetect vimfiles/ftplugins but no one worked (I even typed the au! Buf... code in my vimrc). My .sass files still looking like this: alt text http://img193.imageshack.us/img193/4791/sassi.png any

Emacs Python-mode syntax highlighting

北城余情 提交于 2019-12-04 11:28:25
问题 I have GNU Emacs 23 (package emacs23 ) installed on an Ubuntu 10.04 desktop machine and package emacs23-nox installed on an Ubuntu 10.04 headless server (no X installed). Both installations have the same ~/.emacs file. I run Emacs with -nw on both computers. I don't have python-mode installed on either machine as my understanding is that this is included in Emacs 23. On the desktop machine, comments in Python (starting with # ) are highlighted in red. On the server, comments appear in plain

VSCode configure syntax highlighting to match a style guide

落爺英雄遲暮 提交于 2019-12-04 11:26:35
How do I change the syntax highlighting in VSCode so that it adheres to a particular style guide? For example, I want to adhere to the Google C++ style guide where member variables are written as some_member_variable_ . When I use this convention, VSCode does not color that name differently from standard text. But I have some code that uses the mSomeMemberVariable convention, and that does get colored differently than other text. Is there a way to configure this better? TL;DR >There is no easy way to apply Google style syntax highlighting unless you find an existing cpp Textmate grammar file

emacs AUCTeX macros fontification

你。 提交于 2019-12-04 11:12:05
I recently started using the excellent package xargs that provides \newcommandx . It shares a syntax similar to the default \newcommand . I would like font-lock to reflect this. I did (custom-set-variables '(font-latex-user-keyword-classes (quote (("cx" ("newcommandx" "*|{\\[[{") (:family "font-lock-type-face") command))))) But this fontifies just the command name itself, not its body ( \newcommand fontifies the body with 'font-lock-function-name-face , which in my case is bold). I want \newcommandx to fontify its body with 'font-lock-function-name-face . To summarize the question: how to make

How to turn off errors/warnings in Eclipse due to OpenCL/CUDA syntax?

China☆狼群 提交于 2019-12-04 10:48:04
I am using Eclipse as an editor for OpenCL and I turned on syntax highlighting for *.cl files to behave like C++ code. It works great, but all my code is underlined as syntax errors. Is there a way that I can have my syntax highlighting and turn off the errors/warnings just for my *.cl files? First, the Eclipse syntax highlighter is programmed to the grammar of C and C++, and not OpenCL, so it is unaware of the syntactic extensions of OpenCL, such as New keywords New data types I suggest that the new keywords can be conditionally defined to nothing e.g. #define __kernel #define __global and

Dynamic Syntax Highlighting with AngularJS and Highlight.js

↘锁芯ラ 提交于 2019-12-04 10:40:30
问题 I am building a site that illustrates common application vulnerabilities such as SQL Injection. I am using AngularJS and highlight.js to create interactive examples. How can I make both AngularJS and highlight.js update my code snippets? Example This Fiddle demonstrates how entering ' OR 1=1 -- in the Email field could change the intended behavior of the query if the user's input is not validated or sanitized. SELECT * FROM dbo.Users WHERE Email='{{email}}' AND Password='{{password}}' When a

How to highlight percentage sign “%” for fortran code in emacs?

∥☆過路亽.° 提交于 2019-12-04 10:01:20
How can I highlight in Emacs the percentage sign "%" for accessing members of a type? Yossarian Add the following to your .emacs : (font-lock-add-keywords 'f90-mode '(("%" . font-lock-keyword-face))) This highlights % in the same colour as keywords like if , then , call , etc. There are a load of predefined faces listed in the manual , or you can specify a face manually . 来源: https://stackoverflow.com/questions/26631578/how-to-highlight-percentage-sign-for-fortran-code-in-emacs