I have blog and I want to show codes on the sublimetext editor like that also I want to choice language and it changes color according to the language.
How can I do that?
You can use ExportHtml sublime plugin to export syntax highlighted code to html and paste it in your blog.
Perhaps take a look at:
http://code.google.com/p/django-syntax-highlight/
It is not 'embedding SublimeText' as per your question, but seems to provide a library that provides some decent syntax highlighting functionality. It uses http://pygments.org/
Sublime Text 2 is not a Javascript editor - you cannot embed it in webpages.
For edit - what you can embed:
ACE http://ace.ajax.org/
And some more: http://en.wikipedia.org/wiki/Comparison_of_JavaScript-based_source_code_editors
For view - syntax hihglighting
Use Google code prettify http://code.google.com/p/google-code-prettify/
Related
I'm using bookdown to write my math notes, bookdown provide an feature that one can use
```{theorem}
{theorem content}
```
to write theorems and auto numbered.
However, my preview tool does not realize i'm still wring markdown and the preview will look like
Is there any way to solve it?
Quoting cderv in the issue you reported on GitHub:
There is a new way to write this environment using custom blocks syntax. It is in NEWS but not yet documented in the book. Will do soon.
You can use
::: {.theorem #label name="name"}
<any markdown syntax content>
:::
It works for HTML and PDF output.
I don't know what "other preview tool" you are referring but the content inside this block will be markdown, so I think it will be better for your usage.
The new RStudio Visual Markdown editor helps a lot to write and see those divs !
https://blog.rstudio.com/2020/09/30/rstudio-v1-4-preview-visual-markdown-editing/
I remember there was a time that when you type # in R markdown it will immediately transfer to the heading output. Also, when you type **bold** it will immediately show the text in bold. But now I can't find a way to do this.
Is it possible to show the markdown output in the .rmd document? Thanks!
This behaviour will depend on the text editor you use. Some Markdown editors have a "What You See Is What You Get" (or WYSIWYG) philosophy that will do exactly what you describe. You can find examples of WYSIWYG Markdown editors online, I personally have only tried Typora. But as far as I can tell, none of them seem to support Rmarkdown (perhaps someone has made an Rstudio add-in?).
On the other hand, in the early days of knitr, it used to support Lyx (I don't know if it still does), which is maybe closer to what you have in mind? See this post for an example: https://yihui.org/knitr/demo/lyx/
I have searched on the Internet how to do this, but I can't find how.
I need to colour specific words in RichEdit, such as the words false and true.
TRichEdit is not well-suited for syntax highlighting (use something more like SynEdit instead), but it can be done. Basically, you need to highlight the desired text, and then set the selected text's attributes, like color and formatting. You can do that with the TRichEdit::SelStart, TRichEdit::SelLength, and TRichEdit::SelAttributes properties. Or you can use the corresponding Win32 API EM_EXSETSEL and EM_SETCHARFORMAT messages directly.
See Robert Dunn's excellent article on this very topic: "Faster Rich Edit Syntax Highlighting". The Original article first appeared in the C++Builder Journal in October 1999, and is also available for download on Robert's "Yet Another Code Site" website (which is archived on my website).
I am using systemverilog very often.
I am using UltraEdit as text editor. I use also VIM.
Sometimes I have to copy code from some other places and paste it into my code.
It may not be indented properly. It is a difficult task to indent it properly again.
Can anybody suggest any method or tool to do it easily?
Method
Visit EDA Playground
Paste your code into one of the editor windows
Select all text with CTRL-A
Reindent all text with SHIFT-TAB
Some backgroud
There is a Verilog mode for Code Mirror which supports SystemVerilog. CodeMirror is an in-browser text editor written in JavaScript which is used on a number of websites, including EDA Playground.
You could also paste and reindent in the example window here, or you could download it yourself and run it locally.
The verilog mode in Emacs supports indentation, so you can open your file in Emacs (from the command line, run emacs file-name.v, select all by pressing Ctrl+H, then reindent by pressing TAB and save with Ctrl+S.
UltraEdit has command ReIndent Selection at bottom of menu Format.
All lines of a selection of any type of text file can be re-indented (not reformatted, i.e. not inserting line breaks or removing line breaks) with this command as long as
the file is syntax highlighted based on a wordfile (*.uew) suitable for type of text file,
the syntax highlighting wordfile contains appropriate indent/unindent string definitions.
Therefore it is no problem to re-indent code after paste by selecting pasted block and use the command ReIndent Selection with a good syntax highlighting wordfile for SystemVerilog.
The syntax highlighting wordfile currently used for active file can be opened for editing or improvement by clicking on button Open left of language list box preselected according to used syntax highlighting for active file at Advanced - Setttings or Configuration - Editor Display - Syntax Highlighting.
The lines of interest in the wordfile regarding indent/unindent start with
/Indent Strings =
/Unindent Strings =
/Ignore Strings SOL =
More information about those three lines can be found
in help of UltraEdit on page Syntax Highlighting,
in online help on page about wordfiles, and
in user forum topic template for syntax highlighting language wordfile.
A user contributed syntax highlighting wordfile for SystemVerilog can be downloaded from wordfiles page.
Note: As command ReIndent Selection is a basic command for all languages, it is not as smart as tools written to re-indent or even reformat source files written for specific languages with true language intellisense like Artistic Style for C / C++ / C# and Java (also supported built-in by UE).
I use CFEclipse for most of my projects and heavy lifting but sometimes I find the need to do a quick fix on pages outside the project scope that is easier to accomplish in a simple text editor.
I have googled but can't seem to find an answer so either a link to a download or a link to how to build my own would be awesome. thanks.
Update: Brien Malone's answer below along with charlie arehart's comments are what people should use at this point as nppColdFusion is no longer maintained as of 23 Sept 2011.
Disregard
nppColdFusion is actively maintained
In notepadd ++, go to 'Plugins'> 'Plugin Manager'> 'show plugin manager'. 'Coldfusion Lexer' is listed as available plugin
This question is a few years old now, and unfortunately, the accepted answer involving nppColdFusion is no longer valid because the plug-in doesn't work with NP++ after version 5.x.x and is not being maintained. (It stopped working when Notepad++ switched their plug-in hooking mechanism in version 6.x.x)
The Notepad++ site points to a library of nearly every language highlighter available:
http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=User_Defined_Language_Files
ColdFusion (specifically CF9) is listed:
http://notepad-plus.sourceforge.net/commun/userDefinedLang/userDefineLang_CF9.xml
It's not as good as a full plug-in like nppColdFusion, but it is better than pages of black text.
Just a comment about Tony's answer (Aug 22 '14 at 13:00) : he wrote "In notepadd ++, go to 'Plugins'> 'Plugin Manager'> 'show plugin manager'."
However, in ver. 6.8 (maybe since before), there's no "Plugins" menu item on the menu bar. What I had to do is:
1- From the User Defined Language Page
http://docs.notepad-plus-plus.org/index.php?title=User_Defined_Language_Files
Download the ColdFusion User Defined Language file
http://notepad-plus.sourceforge.net/commun/userDefinedLang/userDefineLang_CF9.xml
Into the Notepad++ Folder
2- From the User Defined Language panel, import that file:
Language > Define your language... then press the Import button
ColdFusion will then appear at the bottom of the Language menu item selection list, and NotePad++ will automatically use it for any .CF file you open.
This link might help: http://howardscholz.wordpress.com/2007/06/01/notepad-support-for-coldfusion-8/
Disclaimer: I haven't tried it myself.
I found that nppColdFusion was working well, until I updated NP++ to version 7.6.6. I have tried just about everything to get it working, but to no avail.
I tried Delire Web's solution and it worked perfectly.
The different formatting (font and background colors) takes a bit of getting used to though.