javascript code formatter and highlighter [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am looking for a jQuery plugin that can take a string of code as input and will apply formatting and Highlights to make the code easily understandable. Just like jsfiddle.net.
As of now I have found many sites like jsbeautifier.org.. But I need a standalone jquery plugin which can process my code
Please help me on this.

9 useful Javascript syntax highilghting scripts. There, I googled it for you. 3 of them are jQuery-based.

i am using codemirror. http://codemirror.net/
its easy and cool.

I use Highlight.Js

If you want to change the syntax in a specific style or just check the style than take a look at code painter
A JavaScript beautifier that can both infer coding style and transform
code to reflect that style. You can also set style preferences
explicitly in a variety of ways.

you can use jstidy for this. and if you are using visual studio, you can directly copy code and paste in to the designer view. it will generates the required styles.

I have checked the pages linked by other answers and found them very lacking.
After a bit of research and scouring the web, I found one that I think clearly is superior to the rest.
Snippit is jQuery based, including "copy" feature (with clipboard plugin), line-numbers, custom styles, etc.
Let me know what you think.

Related

Open source Jquery widget that behaves like the google+ invite textbox [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I was wondering if the hive mind knew of an open source widget (probably a jquery type thing) that behaves like the google plus invite control.
That is, textbox autocomplete, but selected before current choice being typed become their own span in the textbox.
I could do this from scratch but figure I would save some time and see if there was already something like this out there.
This Autosuggest plugin has similar functionality, might be what you're looking for.
Have you looked at jQuery UI's Autocomplete? I think you could make this work without too much extra work.
I know you're asking for jQuery, but if you ever switched libraries (unlikely), or wanted to adapt a current one, take a look at this post; it should be quite easy to adapt MooTools code to jQuery.
And then
I found the jQuery version. This version requires jQuery 1.6.*, but that's as simple as downloading a new release from the jQuery site.

What JavaScript library can you recommend? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I want to use JavaScript on my web page. In particular I would like to have a auto-completer (like stackoverflow use for tags). I also would like to have drop down menus and so on.
I think, for these purposes it make sense to use a JavaScript library (I never did it before). I browsed Internet the first option that I found was jQuery, I also found a list of other libraries.
So, I have a hard time choosing between these libraries and would like to ask your advise. My requirements to the library as as follow:
Of course cross-browser functionality (works on as many browsers as possible).
Easy to use (good documentation with examples + active community).
Possibility to change the code (corresponding copy right + good documentation of the code).
Thank you in advance for any help.
Go for jquery and jquery UI which contains a nice autocomplete plugin. It's a javascript framework which gathered lots of pace, there's an enormous community and it is very likely you will find a plugin for every needs. It is guaranteed to work cross browser and you get a great documentation.

JavaScript based diff utility [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm looking for a diff equivalent written in JavaScript that only returns/prints relevant lines. I don't want both full text displayed next to each other with the differences highlighted, but just want the actual differences (plus some buffer lines to know where the difference is), similar to the output from the linux diff utility.
Does anybody know a javascript function that does this? All differences should be recognized (even changed whitespace). Thanks.
I completely rebuilt the jsdifflib utility for speed. Since my version does not require DOM access it at least 4.5 times faster, and it is also extended to highlight character differences in each line.
http://prettydiff.com/diffview.js
You can test this out with the online tool directly at http://prettydiff.com/
jsdifflib inline mode comparison, try tweaking the context size to display just the desired window of change you want. There's a demo here
There's also google-diff-match-patch from Google
Also available on NPM
npm install diff-match-patch
Mergely is totally worth checking out. CodeMirror-based, client-side only.
Then there's the CodeMirror demo which requires server-side diff computation.
jsdifflib and prettydiff as mentioned in other answers.
Checkout my minimal implementation: https://github.com/Slava/diff.js
Check out CodeMirror. Nuff said.
I dont know much about the diff utility in linux or linux in general, but this might be what you are looking for jsdifflib. You can find a live example there and see if it works for you.
Check out the the wikEd diff JavaScript library. There is also an online tool.
wikEd diff features inline text comparisons with block move highlighting and character/word-based resolution. It is optimized for Wikipedia source text, but works great for any type of text or code. The library code is fully customizable, has Unicode support, is extensively commented, and is in the public domain.
old question i know, but if your doing node work or want something that is compatible with requirejs/commonjs module
I've really liked https://www.npmjs.com/package/diff
console.log(diff.createPatch('some file name.txt', expected, actual));
jsdifflib looks promising - try the demo linked from that page.

Source code annotation tool [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm looking for a tool with which I can annotate source code.
I have some 3rd party source code (JavaScript) I need to understand and I don't want to change it (add inline comments) so that
line numbers can stay intact (for communication with others),
I can avoid accidentally changing something and
my annotations stand out compared to the authors comments.
Normally I would print the whole thing out an scribble on it, but the code is too long for that and I need to share it per email. I would be great if one could do some like that including being able to create "links" between so places in the code, possibly even visually with a lines or arrows.
If you would usually print it (if it were shorter), why not print it to a PDF and then use a PDF viewer that supports comments, like Foxit Reader? :)
I would use email to comment and pastebin to host and highlight #h# lines with links in the email text.
OR
some code-review tool (like codestricker or reviewboard for example)
You can certainly do what you want to with LaTeX and its listings package. But if you are not already a LaTeX user you might think that a hard way to go.
start a github project and post the code there, github includes annotation abilities OOB.
You have difficult requirements. I don't know of such tool. Nevertheless as a more general purpose tool, I can recommend Yui Doc (download here).
I'd build a glamour browser for it. (If spending half a day building it wouldn't be too much).
[edit]
Glamour is a toolkit for building browsers on a model. The model would here consist of the various parts of the file(s) and the comments and attributes you'd like to add. This would allow you to easily navigate through the source and comments, to select only parts with (or without) certain attributes. There is a video and slides. Official page, Source
How about using google wave with syntaxy (http://wave-samples-gallery.appspot.com/about_app?app_id=14008) bot?

Looking for a web based, client side form editor [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm looking for a javascript library (could be based on jQuery) that will implement a client side Form Editor.
The perfect example is something like offered by http://wufoo.com/
You should play with their free version to get the feeling of what I'm trying to find.
Also see this example someone made with jQuery. it is very basic, but a step in the right direction.
Do you know of any jQuery plugin or library that will give me the full functionality of form editing?
I would recommend the awesome ExtJS framework to build such kind of application. Here's an example of what you can do.
ext/formbuilder
Add a form panel, then drop a textbox and so on...dead simple. Ext JS 2.2 and 3.0 (not yet ready) are LGPL and GPL licensed, you have also commercial subscriptions available, I think it worth to have a look at it.
Try the jQuery Form Builder plug-in from Botsko
I had the same problem and wrote one. Github link: SpiffForm.

Categories

Resources