documentation

Document model attributes with YARD

此生再无相见时 提交于 2019-12-02 22:57:32
I'm using YARD to generate docs for my rails app with makrdown as the script parser. Most of the documentation features just work great right out of the box. However, I'd also like to document the model attributes to one, record the list of available attributes on a model and two, to describe their semantic meaning. I wasn't able to find any special support for this in YARD and I'm basically left with simply listing out the attributes in the class comments. Is there a way to document the dynamically generated model attributes so that they appear in the documentation like standard attributes

How can I configure Sphinx to conditionally exclude some pages?

梦想与她 提交于 2019-12-02 22:13:57
When generating documentation using Sphinx, I would like to be able to generate two versions of my documentation: one including everything, and one with only a particular set of pages. What's the best way of achieving that? I could write a build script that moves files around to achieve this but it would be really nice if there was a way to tell sphinx to exclude or include particular documents during a particular build. mzjn The only and ifconfig directives can be used to apply conditions within pages. There does not seem to be any simple way to use conditions to completely exclude entire

What steps are needed to document `package main` in Godoc?

有些话、适合烂在心里 提交于 2019-12-02 20:53:11
Godoc is a great tool for documenting packages, however it seems to be less useful when it's used against package main . I'll see an output that only displays the notes I've written to myself using //BUG and subdirectories. Godoc only displays exported functions and seems to have no way to display unexported / functions from main. I would find it useful to see a list of functions in main. Since this isn't supported, I tend to shove a list of functions at the top of the package description but this feels like a workaround. Since I have to manually update the list of functions, I often put as

Download Xcode documentation sets manually [closed]

最后都变了- 提交于 2019-12-02 20:50:41
For reasons unknown to me, Xcode fails to download the documentation sets from the server. Is there a way to download these documentation sets manually from a URL and then have Xcode's Core Reference Library unpack them? EDIT: Found what I was looking for: http://learning2code.blogspot.com/2008/05/download-xcode-docsets-to-your-hard.html For Xcode 7.0 and maybe newer versions you should follow these steps to download and install documentation sets manually: At first you should find your proper item in the below link: https://developer.apple.com/library/downloads/docset-index

How do you document unchecked exceptions? [closed]

不问归期 提交于 2019-12-02 20:25:24
Closed . This question is opinion-based. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it can be answered with facts and citations by editing this post . Joshua Bloch in his Effective Java writes : "Use the Javadoc @throws tag to document each unchecked exception that a method can throw, but do not use the throws keyword to include unchecked exceptions in the method declaration. " Well that sounds reasonable indeed, but how to find out, what unchecked exception can my method throw? Let's think of a following class : public class

Combining Sphinx documentation from multiple subprojects: Handling indices, syncing configuration, etc

江枫思渺然 提交于 2019-12-02 20:20:14
We have a multi-module project documented with the (excellent) Sphinx. Our setup is not unlike one described on the mailing list . Overall this works great ! But we have a few questions about doing so: The submodule tables of contents will include index links. At best these will link to the wrong indices. (At worst this seems to trigger a bug in Sphinx, but I'm using the devel version so that's reasonable). Is there a way of generating the index links only for the topmost toctree? Are there best practices for keeping the Sphinx configuration in sync between multiple projects? I could imagine

How to document all exceptions a function might throw?

给你一囗甜甜゛ 提交于 2019-12-02 20:15:42
If you have a public function which may throw an exception which uses other (private or public) helper functions which can also throw exceptions I think you should document what exceptions the public function can throw and this includes exceptions thrown by the helper functions . Something like this (using Doxygen): /** * @throw Exception ... * @throw ExceptionThrownByHelper ... * @throw ExceptionThrownByHelpersHelper ... */ void theFunction() { helperWhichMayThrowException(); } and helperWhichMayThrowException() also calls other functions which may throw exceptions. To do this you can:

Why Doesn't jQuery use JSDoc? [closed]

一曲冷凌霜 提交于 2019-12-02 20:14:00
Or do they and it's just not in the source? I'd really like to get something that will stop js-doc-toolkit from freaking out each time it parses jQuery. It also means I can't properly document any code using jQuery as a dependency without at least putting some boilerplate js-doc blocks, which fail to properly document jQuery's structure. Is there a common solution I'm not aware of? I have tried googling, btw. Nick Craver I'll take a shot in the dark here since I can't speak for the jQuery team of why I wouldn't use JSDoc. JSDoc, at least the last time I checked, didn't have any clean way to

Xcode 8 how to show description of function while typing

笑着哭i 提交于 2019-12-02 19:41:37
How can I show a brief description of a function while typing like the image show below? I've tried many different options all have failed. Option + click works but that's not what I'm looking for. Option 1 /// Testing... /// - returns: false func testing()->Bool{ return false } Option 2 /** Testing option two */ func testing()->Bool{ return false } This issue has been fixed in Xcode 9 If you are looking for the way to document self-created method in swift then this might give you a way out. import Foundation /// 🚲 A two-wheeled, human-powered mode of transportation. class Bicycle { /** Frame

Disable “Documentation Comments” warning for selected files

拈花ヽ惹草 提交于 2019-12-02 19:17:07
Xcode has the ability to check for Documentation Comments issues and report warnings when something is not quite right. For instance, I've added Facebook SDK to my project using CocoaPods. At some point in the file FBError.h there's the following code: /*! @typedef NS_ENUM (NSInteger, FBErrorCategory) @abstract Indicates the Facebook SDK classification for the error @discussion */ Note that the @discussion parameter is empty, and Xcode will generate a warning accordingly: Empty paragraph passed to '@discussion' command However, Facebook SDK is not the only library I've added to my project, and