Rails RESTfull API Documentation - ruby-on-rails-3

im searching for a Documentation Framework that supports the following features:
Generated from Code Comments
Searchable
Styling customizable
NTH: Linked references (If i reference a class somewhere class name should be linked to class documentation)
I want to use it to document an RESTfull API i'm working on
I know about YARDoc, but would be nice to gather some alternatives

Matt Silverman created a pretty comprehensive lists of what is available out there now for gen'ing docs from code.
http://www.mattsilverman.com/2013/02/tools-to-generate-beautiful-api-documentation.html

Apart from YARD, you can generate RDOC project documentation using the following rake task:
rake doc:app
After this, your docs will be located in the doc/app folder and can be viewed by opening the index.html file in your browser. It will include the (currently probably generic) doc/README_FOR_APP file.
Hope this helps :)

Related

Intellij - Find path to src directory

I am creating an IntelliJ plugin and I am using JavaParser for one of my features. My plugin will allow users to click a gutter icon next to a method and automatically navigate to the tests associated with that method.
To achieve this, temporerily I have used the line:
typeSolver.add(new JavaParserTypeSolver(new File("/home/webby/IdeaProjects/project00/src/")));
My problem is that I need to pass the source folder of the given module into this type solver. Is there any way I can find the source folder programmatically? Perhaps from an actionEvent?
I have tried things along the lines of the following:
actionEvent.getData(PlatformDataKeys.PROJECT).getBasePath()
This gives me: '/home/webby/IdeaProjects/project00/' but I'm struggling to see how I can get the source folder? I feel there should be a fairly straight forward way of doing this using IntelliJ's SDK but I have not found anything in the documentation or anywhere else online.
Any and all solutions welcome!
Many Thanks,
James
You can use
ModuleRootManager.getInstance(module).getSourceRoots()
to access sources roots of a module. Refer to IntelliJ SDK Docs for details.
BTW IntelliJ IDEA provides special API to syntax trees of Java files, it works more efficiently and better integrates with other IDE features than external JavaParsers.
And it's better to ask questions about IntelliJ IDEA API on a special forum.

Xcode - Document Based Application (Document Bundle)

I'm trying to find a somewhat more comprehensive writeup, or an example to refer to regarding a Document Based Application which saves it's contents to a document bundle rather than a single file.
A good example of what I mean by a document bundle is how Pages saves it's documents i.e.
Document Name.myextension\
directory1\
somefile.ext
somefile2.ext
directory2\
directory3\
file1.png
file2.png
As we know apples documentation, although extensive, can, at the best of times be somewhat daunting to work with :-/
Any help would be appreciated!
Thanks
Ade
Take a look at the following Stack Overflow question:
NSDocument to hold a complete folder?
If the answer to that question isn't detailed enough, you can read the following article on file packages:
Working with Cocoa File Packages
Regarding Apple's documentation, the relevant classes to look at are NSFileWrapper, NSData, and NSDocument.

Semantic Media Wiki (SMW) - Is it possible to nest property / value definitions?

I'm using Semantic Media Wiki in conjunction with the Lingo Extension and the Semantic Glossary Extension to build a glossary. Often definitions of a term include links to other terms. For example: Computer - A calculating machine which uses a -CPU- to execute calculations. The definition includes a link to the term 'CPU'.
Now I wonder: Is it possible to nest a link to a wiki page inside a property / value definition?
I tried the following without success:
A [[Glossary-term::Computer]] is a
[[Glossary-Definition::calculating machine
which uses a [[CPU]] to execute calculations.]]
Does anybody know how to reach this structure?
Thanks for your ideas an suggestions!
I found the solution through the SMW mailing list citing SMW Configuration Page :
You can use
A [[Glossary-term::Computer]] is a
[[Glossary-Definition::calculating machine
which uses a [[CPU]] to execute calculations.]]
but you have to add the following to your LocalSettings.php in the MediaWiki root:
$smwgLinksInValues=true;

Laravel 4 and dojo toolkit AMD implementation how to?

is anyone ever tried implementing the dojo toolkit AMD with laravel 4, or could anyone please point me to a simple sample.
just a simple AMD implemetation on laravel?
What asset manager or the default is ok. how to use it with dojo?
Please help. thanks
For 1. I suggest you may try this Laravel 4 bootstrap suite it gives you RequireJS implementation out of the box.
For 2. You can use dojo with any asset manager you want, or even without it (although it is not a good way) - just by putting its .js files in your /public directory and including them as you do in usual html from inside your view templates. If you are using Blade templates make sure the template syntax is not colliding with your js syntax. If it is, then use #include of .php file with your js code section in your .blade.php view template.
Asset manager gives you a more elegant and correct way of doing the same thing. It maybe extremely useful if you are dealing with LESS or Coffee things to be compiled into regular JS and styles.
If you want advanced asset manager I would suggest your to look at /CodeSleeve/asset-pipeline on github - it's one of many asset managers for Laravel, but one the few keeping alive (take a look at basset or laravel-grunt options on github for instance).
Asset Pipeline makes a good job making asset management similar to the one in Rails. Here is an article on how and why to use it: http://culttt.com/2013/11/04/add-asset-pipeline-laravel-4/

dojo js library + jsdoc -> how to document the code?

I'd love to ask you how do the guys developing dojo create the documentation?
From nightly builds you can get the uncompressed js files with all the comments, and I'm sure there is some kind documenting script that will generate some html or xml out of it.
I guess they use jsdoc as this can be found in their utils folder, but I have no idea on how to use it. jsDoc toolkit uses different /**commenting**/ notations than the original dojo files.
Thanks for all your help
It's all done with a custom PHP parser and Drupal. If you look in util/docscripts/README and util/jsdoc/INSTALL you can get all the gory details about how to generate the docs.
It's different than jsdoc-toolkit or JSDoc (as youv'e discovered).
FWIW, I'm using jsdoc-toolkit as it's much easier to generate static HTML and there's lots of documentation about the tags on the google code page.
Also, just to be clear, I don't develop dojo itself. I just use it a lot at work.
There are two parts to the "dojo jsdoc" process. There is a parser, written in PHP, which generates xml and/or json of the entirety of listed namespaces (defined in util/docscripts/modules, so you can add your own namespaces. There are basic usage instructions atop the file "generate.php") and a Drupal part called "jsdoc" which installs as a drupal module/plugin/whatever.
The Drupal aspect of it is just Dojo's basic view of this data. A well-crafted XSLT or something to iterate over the json and produce html would work just the same, though neither of these are provided by default (would love a contribution!). I shy away from the Drupal bit myself, though it has been running on api.dojotoolkit.org for some time now.
The doc parser is exposed so that you may use its inspection capabilities to write your own custom output as well. I use it to generate the Komodo .cix code completion in a [rather sloppy] PHP file util/docscripts/makeCix.php, which dumps information as found into an XML doc crafted to match the spec there. This could be modified to generate any kind of output you chose with a little finagling.
The doc syntax is all defined on the style guideline page:
http://dojotoolkit.org/reference-guide/developer/styleguide.html