syntax-highlighting

Utilizing emacs' or vim's syntax highlighter for command-line program?

我是研究僧i 提交于 2019-12-20 10:56:00
问题 I have a command-line program that spews JSON and YAML. By default it detects if pygments (pygmentize) is available and if it does, pass the output throught it to get a nice colorized output. However, pygments is not installed by default on most computers that this program will run on. But most computers will have either emacs or vim, however, does. Is there a way to get one of these editors to syntax-highlight some text using ANSI escape sequences and then output it again? 回答1: as the editor

How to show syntax errors in an eclipse editor plugin

こ雲淡風輕ζ 提交于 2019-12-20 09:25:22
问题 How can I indicate syntax errors (e.g. an illegal sequence of tokens) in an eclipse editor plugin just like in the eclipse Java editor, i.e. by red wriggly underlines, a red marker on the scrollbar that you can jump to, and an explanatory message when you hover over either one? I'm writing an eclipse editor plugin for a custom file format (specifically, the "snake file format" of the Shark3D game engine). I have implemented a scanner to get syntax highlighting, and an outline. For the

How To Format A Block of Code Within a Presentation? [closed]

大兔子大兔子 提交于 2019-12-20 08:17:27
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I am preparing a presentation using Google Slides, though I can also work on the presentation within Open Office that will include code snippets. Is there any easy way to perform basic syntax highlighting on the code snippets with either Google Docs or Open Office Presenter? Edit: Since I believe that I can find

To have R chunk in line with text using knitr

冷暖自知 提交于 2019-12-20 05:57:16
问题 How to have R code (R chunk) inline with my text? Example: Please install the package by using install.packages("ISwR") whereby, install.packages("ISwR") is automatically highlighted as R chunk using knitr? In other words, I would like to have R code at the same line with my text. 回答1: Following a suggestion from Yihui, \documentclass{article} <<setup, include=FALSE>>= knit_hooks$set(inline = function(x) { if (is.numeric(x)) return(knitr:::format_sci(x, 'latex')) knitr:::hi_latex(x) }) @

To have R chunk in line with text using knitr

天大地大妈咪最大 提交于 2019-12-20 05:57:10
问题 How to have R code (R chunk) inline with my text? Example: Please install the package by using install.packages("ISwR") whereby, install.packages("ISwR") is automatically highlighted as R chunk using knitr? In other words, I would like to have R code at the same line with my text. 回答1: Following a suggestion from Yihui, \documentclass{article} <<setup, include=FALSE>>= knit_hooks$set(inline = function(x) { if (is.numeric(x)) return(knitr:::format_sci(x, 'latex')) knitr:::hi_latex(x) }) @

IPython change input cell syntax highlighting logic for entire session

戏子无情 提交于 2019-12-20 03:57:12
问题 You can use extensions or display helpers in IPython to make whatever syntax highlighting you'd like on output cells. For some special cell magics, like %%javascript you can also see the input cell itself is rendered with that language's natural syntax highlighting. How can you cause every input cell to be displayed with some chosen, non-Python syntax highlighting (regardless of any magics used on a cell, regardless of whether the cell embodies Python code, some other language). In my case I

Problems with Xcode Syntax Highlighting

浪尽此生 提交于 2019-12-20 03:19:55
问题 In Xcode 3.2.1 I have this problem where it stops highlighting Objects in purple, and such. For example: In that example, NSAutoreleasePool, pool, img, size, width and height should be highlighted, however, they are not. Here is a screenshot of what that looks like. Anyone know how to fix this? Edit: Also, code sense isn't showing correct options. 回答1: Xcode is often glitchy for me in similar ways. Restarting xcode often clears up the issue. Also, sometimes a missing semi-colon or curly brace

Is there a free code to html syntax highlighter written in C#? [closed]

我的未来我决定 提交于 2019-12-19 04:41:07
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 months ago . Is there a free code to html syntax highlighter written in C#? I am looking for something I can host in an .net mvc app 回答1: New answer These days I just use highlightjs which works perfectly well with C#. Old answer While I haven't open-sourced it yet, you'd be welcome to the formatter I use for the C# in

Customize syntax highlighting colors of data types and variables for typescript in Visual Studio Code

微笑、不失礼 提交于 2019-12-19 03:36:38
问题 I would like customize syntax highlighting colors for typescript. I use Visual Studio Code 1.16 and custom theme (Actual) Obsidian. I try use featues editor.tokenColorCustomizations. Here is my custom user settings. { "editor.fontSize": 20, "workbench.colorTheme": "(Actual) Obsidian", "editor.tokenColorCustomizations": { "functions": "#F1F1F1", "keywords": "#8EC160", "types": "#87CEEB", "numbers": "#F1F1F1", "variables": "#F1F1F1", "textMateRules": [ ] } } I don’t know how can I select a

highlight.js does not work with Angular 2

一个人想着一个人 提交于 2019-12-18 22:57:51
问题 I am trying to add syntax highlighting to my application using highlight.js but it doesn't seem to work with Angular 2. Could you please let me know what I might be doing incorrectly? Here is the Plnkr: https://plnkr.co/edit/G3NFFPGXKyc9mV1a6ufJ?p=preview This is the component import {Component} from 'angular2/core'; @Component({ selector: "my-app", template: ` Hello! <pre> <code class="html"> <html> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html> </code> </pre> `