I've gotten really used to the features StackOverflow provides while writing technical posts. My favorite features are the
4 spaces which you can use to indent a <pre> style code block
And the backticks you can use to format code inline, and also the automatic color syntax highlighting.
I believe the code highlighting is done via google's 'code prettify' but I'm not sure about the other formatting. It's just so easy!
How can I use this formatting on my blog?
I believe StackOverflow uses pagedown. The documentation seems to sum it up pretty well with examples, including a demo.
Related
I am a web designer trying to improve... These last few days I had decided to study Haml and SCSS and other things, but I just discovered Markdown and now I don't understand the difference between Markdown and Haml. Do they serve the same purpose? Which of the two is better? I've read they can be combined... Maybe should I learn both tools?
Thanks in advance.
Markdown
From Markdown's syntax page.
Markdown’s syntax is intended for one purpose: to be used as a format
for writing for the web.
Markdown is not a replacement for HTML, or even close to it. ...
It is useful for writing purposes only. A fitting example is Stackoverflow. You can easily format your questions to include some basics such as a list, a header or a quote.
HAML
HAML on the other hand is used for developing websites. It provides everything HTML does in a cleaner way. This includes all HTML attributes (such as ID's & classes) and embedded Ruby code. They have a great tutorial to get a brief overview.
My experience with HAML has been great. It's clearer and simpler to use than normal HTML. I'd definitely give it a try ;)
I'd like to create an IDE for a language and I'm wondering how to implement some features. In particular syntax highlighting and content assist are troubling as they must work even when editor content is not valid (when user is typing syntax hightlight should not disappear just because parser fails).
I am wondering how to approach this problem (and others as well). I've found this: How does code completion work? with a description of a solution to this problem, but it's rather brief.
I can come up with a way to implement all features I want at some point, but I'm not the first one and someone has done it already ;) (and reading source code of Eclipse is not that easy)
So, my real question is there a book discussing problems related with creating IDE? A detailed article discussing how to parse invalid code? Any source of information I should see?
Ah, and by IDE I don't mean a new application, just a set of plugins for eclipse.
The following link will help you further..
Syntax Highlighting:Fast Colored TextBox for Syntax Highlighting
an OpenSource IDE:SharpDevelop
an eBook How to create IDE:[Dissecting a C# Application: Inside SharpDevelop]
Yesterday, Dave DeLong answered a question of mine. It wasn't the answer I was looking for, but in the question he mentioned an alternative way of generating doxygen-style documentation for Objective-C.
Before I could really look into it, someone (maybe Dave himself) noticed the answer didn't match the question that well and removed it. *poof* gone was the link to that documentation tool.
I can't remember the name, but I'm fairly certain it's neither HeaderDoc nor Doxygen itself.
Dave, you out there? What was that link again?
I'm clearly not Dave DeLong, but I'd use appledoc, it's pretty darn awesome!
Developer Page quote:
appledoc is command line tool that helps Objective-C developers generate
Apple-like source code documentation
from specially formatted source code
comments. It's designed to take as
readable source code comments as
possible for the input and use
comments as well as surrounding source
code to generate visually appealing
documentation in the form of HTML as
well as fully indexed and browsable
Xcode documentation set. Although
there are several tools that can
create HTML documentation for
Objective-C, all of those know to me
fall short in meeting the minimum of
goals described below.
Human readable source code appledoc is designed to keep source
code comments as readable as possible
even within your source code editor.
Cross references to objects and members Creating cross references to
classes, categories or protocols is
straightforward and automated as much
as possible.
Apple-like source code HTML documentation Generate appealing
HTML documentation with the same style
as Apple's.
Xcode documentation set creation Generate and install fully indexed and
browsable Xcode documentation sets.
Documentation set can also be
automatically installed to Xcode.
Single tool from sorce code to doc set Single tool to drive generation
from source code parsing to
documentation set installation
Easily customizable output appledoc gives you a lot of command
line switches so you can parameterize
output. If this is not enough, you can
change any or all of the template
files to suit your needs.
100% Objective-C implementation The whole appledoc is written in
Objective-C, so you can easily change
it using familiar language and tools.
This also make debugging much simpler
and effective.
I'm planning to do a Cocoa app that requires code syntax to be colored (in all common languages). Instead of writing my own code highlighter/parser, are there any pre-made solutions available?
Thanks
You might be able to use something like Geshi, but there're also the resources listed here: http://www.cocoadev.com/index.pl?SyntaxHighlighting
Edit
More links:
Syntax Highlighting in Cocoa TextView? Experiences? Suggestions? Ideas?
http://parsekit.com/okudakit/
An excellent solution is Uli Kusterer's UKSyntaxColoredTextDocument. It is fast and has several built-in syntax parsers. It's easy to add new languages.
It's free for non-commercial use and very cheap if you want it for a commercial app.
You can also use the JavaScript library SyntaxHighlighter and embed it into a WebView into your app.
After quite a bit of research trying to solve a similar problem, the simplest approach I found by far is to use a JavaScript library for syntax highlighting combined with a WebView. Spending time writing a syntax highlighter, a fairly complex task, is probably not what you'd want to spend time on.
I settled on using the popular CodeMirror and wrote an open source wrapper for Cocoa: https://github.com/swisspol/CodeMirrorView. You can use similar approaches to wrap other JavaScript based code editors in Cocoa apps.
You can use highlight that is used in QLColorCode :) (however, it's not a Framework that you include in your code, but a command-line utility)
EDIT: Ah yeah, use Geshi, it's probably better :D
I have to maintain a portion of Access 2003 VBA code, which is not my primary programming language, and while I'm pretty solid on doing regular stuff, I would still like to have a pure spec of the language syntax.. It just saves a lot of time compared to reading tons of stupid tutorials that tell me what a for loop is.
Is there any resource on the VBA syntax ? I would be happy to have it as formal as possible, probably something like BNF. I couldnt find an official spec on it.
Check out VBA Language Specification (PDF) on MSDN.
The Official reference is Microsoft docs