Highlighting a home made langage in Sublime Text 2 - sublimetext2

Is it possible to define special lexer for highlighting file using a personal langage, a DSL ?
Any clue is welcome and if this need to play with Python, this is not a problem...

Here's a nice tutorial that should get you started: official doc about highlighting.

Related

How can I add programming code to my website similar to what appears in any text editor or stackoverflow?

eg python code
import os
def main:
print("Hello, Stackers")
[To be shown as this image in webpage][1]
Is there any template that does the styling for itself?
Note: I know how to use pre and code tags also checked Wordpress, So anything other than that.
Thankyou for answers.
You can do this like you said without syntax highlighting using <code>, <pre> or <samp>, see this SO answer for the explanation of them. However, if you want some fancy colors, you have to use a js library. Some nice ones I've found:
highlight.js
Prism.js
SHJS
Rainbow
Note: all of these are not live - means edits of the code would break the highlighting. As example for an editor CodeMirror is a good solution.
I hope I could help you. Have a nice day :)

How to use Markdown plugin for Sublime Text 2?

I'm going to learn the language Markdown to quickly and easily write articles for my website under Wordpress.
To do this, I installed under the Sublime Text 2 plugin Markdown Editing. All delivered normally. Then I create a new document in the editor and assign it a syntax Markdown.
But what to do next? How should I save this file? What do I need to compile the file from the markdown in html? I have not found a good description of how to work with this plugin and how to get ready html-file from the file markup markdown.
Tell me, please.
Apps
For learning Markdown I think Sublime Text may be overkill; it's powerful but adds a lot of complexity. It's a great tool but it isn't where I would start.
Instead I would recommend learning Markdown with simpler writing app like Byword or Mou for Mac, MarkPad for Windows or Editorially for the web.
Still want to use Sublime Text? I'd highly recommend checking out Federico Viticci's article on Sublime Text and Markdown, some of it is Mac specific but since Sublime Text is a cross-platform tool most of what he mentions is as well, it will definitely help you get started.
One of the key things to note is that Markdown Editing isn't an all-in-one tool, it's mostly focused on writing and editing Markdown (See my update below). It's still best to pair it with other Markdown related tools for doing things like converting to HTML.
There's also a little more information on Markdown Editing on Brett Terpstra's site (Brett created it). Here's the introduction post, Brett's pretty responsive so if you have any questions try leaving a comment or contacting him directly.
Saving
Regardless of the editor you use you have a lot of options for saving. Markdown is just plain text so you can save the file as .txt or just about whatever you want. The most popular conventions are .txt, .md, and .markdown. I use .md most of the time.
Converting to HTML
Here again you have a ton of choices. Most text editors that have been designed for Markdown will let you copy or export what you've written as HTML. I usually use the fantastic Marked 2 app which is editor agnostic but it's Mac only. In Sublime Text there are plenty of Markdown converters out there, just search Package Control for Markdown.
If you want the most flexibility possible Pandoc does a whole lot more than just HTML. I use the Pandoc Sublime Text extension.
Another alternative would be to use a Markdown plugin in WordPress so you don't even need to convert it to HTML, just copy and paste it into your WordPress post editor. I haven't used WordPress recently enough to recommend one specifically but I know there are some very solid options there.
Finally, Byword has an optional WordPress extension you can buy if that appeals to you.
Learning Markdown
One last note, there are some great resources out there for learning the language itself. The spec is certainly comprehensive but can be a little intimidating. Lifehacker has a decent introduction but the resource I always recommend is the book Markdown by David Sparks & Eddie Smith. It does focus on Mac and iOS tools but the language is the same everywhere, still if Apple tools and screenshots are a problem best to try something else.
I hope that helps!
Update: MarkdownEditing
Looks like my information was a bit out of date regarding the MarkdownEditing package. It does do a little more than just improving markdown writing or editing now and it's development path is now to make it a fully comprehensive Markdown package.
Thanks to Brett for making it a community project and Ali Ayas heading up the project now. Further details on Brett's blog here.

Is there any powerful html editor on Mac os?

Visual Studio is so powerful and convenient as HTML,CSS and JS editor.
After typing div,it automatically types /div for me.Espresso can do this as well, but it just doesn't types the TAP or space*4 automatically,that's awful!
So, is there any web editor on Mac as powerful as Visual Stdio.Thanks!
By the way, vs2013 Pro is free for students.
There are many good editors for HTML, CSS and JS for Mac like Espresso, Coda 2, TextMate.
But I personally prefer Sublime Text + Emmet combination.
Emmet Documentation
Check this link also for some of the features of Emmet.
Why don't you take a look at Sublime Text, TextMate or Coda 2?
You may find TypeMetal productive for HTML content authoring. It makes the easy stuff easy, while providing unrestricted access to HTML's full element set. TypeMetal produces streamlined, professional-grade markup, while enabling you to work with fully styled content in a keyboard-shortcut-rich environment. You can find links to a free demo build and the complete online user guide here. (I designed and developed TypeMetal to be the "missing HTML editor" I've long wished for -- hope you'll enjoy it too!)
You can try learning and customizing vim ( = !

Objective C formatting for blogging

I blog on Wordpress, is there any tool to upload the Objective C code in a formatted manner to my blog. I googled to find more on this..but was not of much help.
Check out Wordpress for iOS. The Wordpress app is open source, so you can rummage through the code.
Are you asking about formatting the code in blog posts? If so you can use a syntex highlihging library like syntaxhighlighter.
Edit: There is also a wordpress plugin that will do syntex highligting: http://wordpress.org/extend/plugins/wp-syntax/
There are several syntax highlighter plugins for Wordpress, but not all of them support Objective-C. I just found one that does: The name is "Auto SyntaxHighlighter".
The website of the plugin doesn't mention Objective-C, but the plugin does.
When you write your article in the visual editor in Wordpress, there will be an icon for adding source code. There you can choose the language (e. g. "Objective-C").
In the visual editor, you cannot see all the nice bells and whistles of the added source code, but if you click "preview", you will see the nice syntax highlighting, etc.

Good free html editor with shortcuts for <p>'s

Hi can anyone recommend a good free html editor.
I want something that will let me wrap sections of code in <p> tags with a shortcut for example. It would make my life easier.
I'm a developer so I want something where I'll be writing most of the html by hand.
Thanks for the help,
Alex
Visual Web Developer 2010 Express is just great for beginners, and has this functionality.
Netbeans has this functionality. It works with many languages including HTML. Get it from http://netbeans.org/ Its free
In Emacs' html-mode you're typing along, hit C-c RET, type your paragraph, hit C-c / to close the paragraph, and keep on hacking.
You can find this tip, and many more, here.
you can use Bluefish. This is a free software text editor. The "Auto tag closing" is include in the software : http://bluefish.openoffice.nl/manual/ch07s02.html
Official website : http://bluefish.openoffice.nl/
Hope it will help you!
Very simple, but with shortcuts for the most common XHTML blocks: Rejbrand Text Editor.
You press Alt+Enter to insert <p></p>; any selection will be included inside the tags. Ctrl+Enter inserts <br />, Ctrl+I inserts <li></li> etc. Ctrl+n inserts <hn></hn>.
Programmer's Notepad 2 gives you the easiness you're asking for, plus it also writes for ALL other programming languages with syntax highlighting to ALL and it adds the closing tags of HTML for you and all the optimizing stuff. Plus it is FREE. It also is VERY portable being only 2.4 megabytes! You can download it from here:
Programmers Notepad Download Latest Version