Atom text editor - highlight line based on regex - atom-editor

Atom is a hackable text editor but I can't find a way to hack it to my needs.
On PC I use Notepad++ and its custom highlighting engine to view very large log files with visual cues to assist me.
I want to be able to highlight individual lines in Atom based on their contents: say the line contains "warning" I want it to be orange or "error" - red.

Atom is build on web technologies, so you can use JavaScript and CSS to alter its behaviour. If, for instance, you type "Warning" into a plain-text document and open the Developer Tools, you will see it is rendered as plain HTML:
<span class="text plain">
<span class="meta paragraph text">Warning</span>
</span>
Unfortunately, there are currently no CSS selectors for the text inside a tag-pair, so you would have to create a plugin, or package, in JavaScript/Coffeescript. How to CSS: select element based on inner HTML) provides a good starting point.
Use JavaScript to detect all instances of “Warning” inside the HTML of the editor view, then add a class. You can then use CSS to highlight the line.
Alternatively, you could probably create custom grammar for your log file.

Related

Package for showing all possible CSS values in Sublime Text 2?

With the basic Sublime Text 2 build, I am getting CSS value autocompletion only when I type the first letter of the value, as seen in the image below.
However, I've been watching the Tuts HTML+CSS web tutorials (here is an example video), and his Sublime Text build shows all possible CSS for a given attribute. Below is a screenshot from the linked example video.
My question is what setting or package allows for the display of all possible CSS values for a given attribute?
No additional packages or specific settings were needed to solve this issue. The Ctrl/Cmd+Space keyboard shortcut natively displays all possible completions.
Try different plugins through Package Control.
Specifically trying these may work for you:
CSS Completions
Emmet CSS Snippets
CSS Extended Completions (requires ctrl/cmd + space)
There is no package needed in Sublime Text 2 to display all possible completions, e.g. all possible values for a CSS property, but LaceLafontaine's answer is no longer current. Cmd+Space doesn't work on Macs, partially because it's a shortcut for a spotlight search.
Currently the shortcut to display the completions in OSX is Ctrl+Space. I believe it's the same for both Mac and PC. The issue was discussed here: https://github.com/processing/processing/issues/2699
Linux Users
For me it worked when I config using this:
"auto_complete_triggers":
[
{
"characters": ": ",
"selector": "source.css",
},
],
And then you use Space as trigger.
There is an additional space before every value, but Minify or HTML-CSS-JS Prettify will delete all these spaces

Keep Drupal content HTML in a uglified state

When I am adjusting content, I click on the source I want the html to be in an uglified state, so it is easier to naivagte, without having to copy and paste the html into HTMLLint, then into Sublime Text (at least once for editing, but definitely in ST2 if I plan on doing several iterations of edits), and then back into the RTF body area.
How do you get it to show the source in an indented view like this:
Maybe also how do you just edit the content in HTML format only? Any Module?
How do you get it to show the source in an indented view
Well, you can't unless it is built into the Rich Text Editor module that you have installed. CK Editor, for example, does indent the HTML nicely.
how do you just edit the content in HTML format only? Any Module?
If you want to edit the content without the Rich Text Editor, you may
disable that particular module admin/config/modules
or make plain text your default by going to admin/config/content/formats and dragging 'Plain Text' to the top of the list.

SDL Tridion 2011: Rich Text Editor Configuration to produce specific markup

I have a requirement to produce mark up like the following for an image within the SDL Tridion Rich text editor:
<div class="imagemasksmall">
<img src="tcm:2-123-16" alt="My amazing image" />
</div>
My initial thought was to use the FormatAreaStyles.css file to add a class like div.imagemasksmall { }, however this only seems to be available if I add the div in the mark up.
Is there a way to allow an editor to produce the above markup without having to write the code manually?
If all you need is a DIV with the "imagemasksmall" class and an image inside, you can do that in 3 steps (as you have already added the style to FormatAreaStyles.css):
Insert the image
Change the Section Type drop-down to "Generic container (div)"
Change the Style drop-down to "imagemasksmall"
If you want to reduce the number of manual steps needed for it, you will probably have to write an extension that does those steps for the user.

There is some way to ignore the css style on copy?

Example:
<p style="color:blue; font-family:Consolas">blue text</p>
The user select the text, copy and paste (wysiwyg, word, etc). And the text comes without blue color and consolas font?
From browser to browser = simple content to wysiwyg
From browser to word
There's a manual with keywords that can be used on content.
The users usually copy the keywords directly from manual and paste in the editor. So the editor assumes the style of the manual. And that's what I don't want.
I can disable the select or change the tags of keywords to input and style it, but exists a easy way?
This is a native OS/software feature. This is not something you can control via js/html.
You can however build a function via javascript that copies that text to clipboard.
Or search for the native feature in your options to turn it off.
This is default in all the windows operating systems. when ever you select the text the blue color will occur in select area. manually we never change the color. i think this answer very usefull to you.....

CSS for specific text on Confluence

I am wondering if there is a way to use custom css for some specific text on my confluence page (not using embedded HTML).
Sorry this is an old question, but for the sake of people who search for an answer to this question: you can use span or div macros and use the custom css to apply whatever style you want to their contents.
If necessary, you could create custom div and span classes to allow for multiple styles to be applied to selections of text.
EDIT: Here is an example of the wikimarkup you could use to do this
{div:class=customCss|style=float:left; margin-right:50px}
Custom text in a div
{div}
So you can either use the div class and apply a style in the custom css for the confluence space, or you can use an inline style for the div.
You can do this ...
{composition-setup}import.css=/download/attachments/123456789/custom.css
{composition-setup}
That's if you've stored a custom.css file as an attachement. You'd obviously need to replace 123456789 with the actual attachment number.
You can also link CSS on an external site (with an absolute URL), but if you have any automatic URL formatting, that tends to mess it up everytime you change the document.
I use a User Macro that renders the $body in HTML. Then I can put whatever HTML tags I want in the wiki page within the user macro tag.
There could be a way to reach what you want to reach, but there is some information missing (from you). What confluence allows is the following:
If you have admin rights to the confluence wiki space, you could add there a custom style sheet that applies to all wiki pages. Else you could follow the answer of Mus.
Then you should analyse the wiki page in source form. So load a wiki page you want to style, and look at the source of that wiki page in your browser. Depending on your browser, this may be CTRL-U or something similar. Here in chrome, the page menu says View page source.
Try to find the defining selector for your wiki text you want to style in some form. A reasonable hack could be:
Find a wiki style that is not used by others. I have experimented with ~subscript~.
Find the HTML tags that are built by using that style. In my example, it was <sub>subscript</sub>.
Use your custom style sheet to style text of that style.
However, this may change the text where the style is used for its original sense :-(
You can specify custom CSS in your Confluence page via the div and span macros.
In recent Confluence versions (4.0 and later), you can do this as follows:
Type {div} or {span}. On typing the closing brace }, auto-complete will convert the text to a macro.
Left-click on the frame of the macro and select the Edit button
Enter the custom CSS into the Style field and close the dialog
Enter your text into the macro frame. It will then have the style you specified.

Resources