JavaScript edit-inplace-holders which work with Wiki sources - javascript

I'd like to dynamicly parse in text wiki-content.
I found JsWiki but its in beta form, and looks like with no community even developers). Any other?

It depends what you mean by wiki content. There are many wiki frameworks just as there are many formats for wiki text. If you're looking for something that parses mediawiki content, such as wikipedia, there's a good list of parsers here. Some are Javascript based and I've had a good experience with one of them, InstaView.
It may be that you're just looking for a form of simple markup, in which case you could try using a library like ShowDown instead.

You could use the Ra-Ajax InPlaceEdit for such things if you're on ASP.NET. It doesn't have automated built in wiki parsing, but it allows for adding up any control you wish including LinkButtons and Literals which you can then build up with the HTML you want yourself...

There is another beautiful Javascript (only) based wiki editor. I just loved the idea itself. Check it out TiddlyWiki

Related

How do I parse entire Common Crawl database using node?

I want to get as many html files from Common Crawl database as possible. I'm quite lost on how to do it, and don't even know how to start. I've seen many people doing it in python, but I don't know how to adequate the code to javascript. I found this package: https://www.npmjs.com/package/commoncrawl
But this package can only search, and not parse through every single website of the database.
Also, I want the raw html data from the websites only, and a way to get the link of the website. Shouldn't be that hard.
The commoncrawl package looks like it is used for navigating their CDX indexes.
If you want the underlying HTML itself, you need to be inspecting the WARC files. Consider using something like node-warc.
I wrote a blog post that introduces the WARC format and provides examples on how to fetch and search HTML from the Common Crawl in Node, Java, Go and Python. You can find the Node code on Github here. Hope that helps!

pdf.js analog for Word Documents

I am searching for a JavaScript library that is similar to pdf.js but allows the viewing of Word Documents (.doc and .docx)
Are there any?
UPDATE:
There is an interesting library called DOCX.js
But I'm searching for something more advanced.
I doubt it. Behind pdf.js stands Mozilla, so it isn't a weekend project.
There are options to let LibreOffice run in the browser, but I have no first-hand experience with it. Apparently, some cloud projects like NextCloud use it, though.
Then you have Google Docs to import the Word file and let it be displayed there, but there is no way to embed that easily or even host the code yourself. (Also, as I understand it, there are transformations to the Word file on the server involved.)
And after all, if you compare the PDF spec with the OpenXML (aka .docx) spec, it becomes quite clear, that a fully compliant viewer will be a complex beast, to say the least.
I just found out ViewerJS, but it only supports OpenDocument formats. It's not what you were looking for, but may be worth a shot, specially if you can find a way to convert odt to doc (this question might help).
At a glance, it looks like Flexpaper can be used to this effect, but it's effectively using a server-side version of open office to convert the document into images that can be viewed on the web. This'll work in a pinch, but certainly lacks the quality of pdf.js.
You can use ViewerJS and JOD Converter (http://www.artofsolving.com/opensource/jodconverter.html) together to achieve requirement. First you can convert office documents to open office or pdf format using above converter. Then you can show those documents with the help of either pdf.js or ViewerJS
Native Documents (in which I have an interest) makes an embeddable viewer/editor for Word documents. There's an online demo where you can try your own document.

CKEditor and Wiki Markup (A Custom Data Processor?)

I am looking for a non-HTML Rich text editing solution.
Since I do not want to allow users to post HTML code from fear of various XSS reasons I implemented a Wiki Markup solution using MarkItUp which works great.
However, there is a loud demand for a real WYSIWYG Rich Text editing.
I found out that CKEditor can support external Custom Data Processors that theoretically can have it work with any markup language.
However, I couldn't find any implementation of such a Custom Processor...
Does anyone knows of such implementation (Wiki Markup or others: MarkDown, BBCode, etc.)?
Does anyone know of any other solution to the situation?
I would prefer a client side only solution but an Ajax based converter using a .Net based converter is also acceptable.
Thanks!
A basic BBCode plugin is available in the CKEditor package: http://nightly.ckeditor.com/latest/ckeditor/_samples/bbcode.html

JavaScript equivalent of C indent

There is a GNU indent for styling C sources, are there any equivalents for JavaScript?
I want it to have options for coding style, indention style, etc. just like indent.
I will be using it for a pretty large project on *NIX platform, so I will not like Windows-only utilities or online tools.
I haven't used it, but I bookmarked js-beautify a while back, and a quick check seems to indicate it might satisfy your requirements. (And, being written in JavaScript, you probably can improve on it easily.)
You have a few options:
jsbeautifier
Google Closure Linter
Google Closure Compiler Service (w/ pretty printing option)
Some editors also do this for you:
Emacs
vi(m)
Eclipse
...
EDITS:
Another online tool, JavaScript Indent claims it uses Indent in the background itself. Maybe the author would share the settings. Not so great, but a start.
the JS Beautifier page also mentions that a Python version if being developed as we speak. Let's check again later. In the meantime you can use it with Rhino as mentioned on their page.
Finally, there are already a few SO questions answering this which you can find by searching (some of the results point to formatters to display code online, which is a different thing, though you could use that as well):
Best Source Code Formatter for JavaScript
Formatting JavaScript source code
There's jsBeautifier, which can be run from the command line via Rhino in a Java-enabled environment or run via V8 (or a couple of others, check out the github page). Apparently they're working on a Python command-line version.
Apparently someone's made a start (at least) on updating indent itself to understand JavaScript. The joy of open source! Even if incomplete, the syntaxes are so similar... (No, apparently it's just a web page front-end to indent — not helpful at all.) So rephrasing: I wonder how hard it would be to modify indent to support JavaScript? The syntaxes are so similar...
There is Javascript Tidy, which uses the browser itself to reformat Javascript code. So the results depend on the browser you use.
You cannot determine the style, but once the Javascript has been reformatted to a standard format, it's easier to modify the sourcecode to match your own style.
libjavascript-beautifier-perl package has got /usr/bin/js_beautify, which does the trick for me.

how to add text to openwysiwig editor by javascript code outside openwysiwig

I've got page to edit some html code from db, to do that I use openwysiwig http://www.openwebware.com/wysiwyg/demo.shtml which hosts over textarea, functions implemented in editor to insert images and hyperlinks aren't quite suitable for me, so I need to find some piece of code which help me to change/insert text to that area from outside the editor itself.
I've tried to find a solution but I could't find anything valuable; I've only learned that openwysiwig creates iframe over host textarea or something like that; besides that nothing what would solve my problem.
Dunno why FCKEditor got down~voted but it most certainly can do what you need. It has a very usable javascript API which allows you to insert elements into the editor area fairly easily. it integrates well with a wide variety of server tech also and includes a well designed plugin architecture for expansion. Has a lot of support and sample code, and I've used it in tricky ajax-driven environments and am very happy with its capabilities. I can't find any usable Javascript api documents for openwysiwyg. You should be able to get FCK up and running in under an hour I would think
This isn't very helpful perhaps, but something like tinymce or fckeditor is much better documented. I suggest changing.

Categories

Resources