Notepad++ or netbeans plugin for marking text in html - html

I need a plugin, which can show in another color words in HTML (and PHP) code. For example
<span class='domain'>this is domain</span>
and i need this result
<span class='domain'>this is domain</span>
Is it possible?
And what if I have text and htm in echo?

You can go to Notepad++ and there Settings -> Style Configurations and from left side HTML and then modify the colors the way you like them!

Netbeans also have a customizable html editor that can do this job.
Go
Tools>Option>Font & Color
In the syntax tab select HTML as Language and make the appropriate changes

Related

Add HTML tags to selected text

Sounds simple but I really can't find the answer. I would like to be able to select text and add a tag without typing opening/closing tags manually, because it's a waste of time.
<p> selected text </p>
<ul>
<li> selected text </li>
<li> selected text </li>
...
What comes to my mind are workarounds like Notepad++ (find & replace) or Autohotkey scripts (copy, add tags and paste) + StrokesPlus mouse gestures.
Is there any editor where I could do it quickly with a shortcut? I'm new to HTML and I just want to find the most efficient solutions.
Many editors support this feature and if not, there are mostly extensions you can add for html language support.
In sublime-text for example if you write div then hit the tab-key you get <div></div> with the cursor positioned within the div scope, which makes life way easier.
One other solution that you might find interesting is writing with the template engine Jade. Just have a look its pretty straight forward.
With notepad++
if you want to change some lines as list ( < li > )
Select your text and press CTRL+H (to replace)
write in the first input (find what): (.*)
and in the second input (replace with):
< li >\1< /li >
check in the options: "In selection" and "regular expression"
Finaly click on replace all
You can use emmet with the editors that emmet supports, to create a tag you only need to type the word that you want to create and press Tab.
I love brakets editor; if you´re editing html code it has a live mode to view in real time the changes in your document.

Using TinyMCE as a text editor

TinyMCE is used in one of my projects as it was meant to be used; a WYSIWYG HTML editor.
I created a number of plug-ins for it that inserts certain fragments of text into the HTML and all is working fine. The plug-ins use TinyMCE's createMenuButton to create a menu button and tinyMCE.activeEditor.execCommand('mceInsertContent', ...) to do the inserting.
Now I need to add an editor for plain text in the same project. The text-only editor would also need to be able to insert those same fragments of text into plain <textarea> or <input type="text"> inputs.
Rather than duplicating code, I'd like to re-use the plug-ins written for TinyMCE.
Is there any way to either use TinyMCE as a plain text editor or use just the individual plug-ins?
I'm using TinyMCE 3 and can't upgrade to 4 due to missing essential features.
You could use the editor "as is", but strip the html tags afterwards.

How to display source code with indent in a web page? HTML? CSS?

I want to show some source code with the WebBrowser control on a winform. And I want to decorate the source code with HTML tags, such as color, font, and size. But I found it difficult to display the indent properly.
To be precise, my source code are held in String[], and each String holds the proper indent (space or tab) already. But it seems these kinds of indent are just ignored by the WebBrowser control.
Could someone tell me how to?
I like to paste my code in a Gist and then display it that way. Github will recognize the code and format it accordingly.
If you're going to be doing it often you could try markdown.
Or use a one-off formatter like Syntax Highlighter.
The <pre> element (using <code> elements with appropriate class names to mark up the parts you want to syntax highlight)
<pre><code class="javascript"><code class="keyword">function</code> <code class="name">foo</code>()…
You might want to look into this JavaScript library to highlight and format your code. http://code.google.com/p/syntaxhighlighter/
Or you can check out a service like this - http://pygments.appspot.com/ or this - http://hilite.me/

Surround selection with html tag

Is there any eclipse shortcut/trick/plugin/whatever that will allow me to select a section of text and surround it with an arbitrary html/xml tag when using the html editor.
Something like this textmate video
EDIT: not sure If my Eclipse setup is the same as yours, but...
I have the HTML Editor installed, and if I switch to the Java perspective, I can use Edit -> Quick Fix and then choose Surround with new element to get exactly the effect in your video. (On a Mac, the shortcut for this is ⌘1).
Hope this is helpful.
In the C++ editor, you can try Source -> Surround With... -> Configure Templates to add the tag you want.
The following works and allows for entering random/arbitrary tags:
Select the desired text that you want wrap.
Go to 'Edit > Quick Fix' or press 'Ctrl + 1'.
In the new menu that appears select 'Surround with new element'
However there is an annoyance, please upvote Bug 494169

Syntax coloring of html files in eclipse

We use a custom cgi solution, which makes use of %-tags in html-files:
<% keyword some.stuff() %>
Does anyone know an easy way to get syntax coloring in eclipse for these tags?
HTML syntax coloring settings are in:
Preferences-Web-HTML files-Syntax coloring
Just change and apply your changes, and take a look at the preview window below to see what part is changed.
The reason I don't list the specific location of the setting you want, is that I cannot figure out what kind of code you are writing in your project. HTML files can contain a variety type of contents, like java code in .jsp and javascript, so you may have to check other syntax coloring settings related to the type of code you use. For example, .jsp syntax coloring settings are in:
Preferences-Web-JSP files-Syntax coloring
But the effect can show in a html file.
You can search syntax coloring in Eclipse Preferences window to get a full list of such settings.
My best bet would be Eclipse Colorer plug-in. It is a very elegant plugin based on extensive Colorer library.