documentation

How to embed a Rust macro variable into documentation?

雨燕双飞 提交于 2019-11-27 19:29:17
问题 I'd like to use a macro variable in the macro-generated documentation: macro_rules! impl_foo { ($name:ident) => { /// Returns a new `$name`. fn myfoo() -> $name { } }; } However, the variable won't be substituted. I also tried using the #[doc] attribute: macro_rules! impl_foo { ($name:ident) => { #[doc = concat!("Returns a new `", $name, "`.")] fn myfoo() -> $name { } }; } This one even fails to parse: unexpected token: 'concat' 回答1: This can be done using a recursive macro: macro_rules! impl

Where to document functions in C or C++? [closed]

别说谁变了你拦得住时间么 提交于 2019-11-27 19:16:48
I have a C program with multiple files, so I have, for example, stuff.c which implements a few functions, and stuff.h with the function prototypes. How should I go about documenting the functions in comments? Should I have all the docs in the header file, all the docs in the .c file, or duplicate the docs for both? I like the latter approach, but then I run into problems where I'll update the docs on one of them and not the other (usually the one where I make the first modification, i.e. if I modify the header file first, then its comments will reflect that, but if I update the implementation,

How to use Python to programmatically generate part of Sphinx documentation

被刻印的时光 ゝ 提交于 2019-11-27 19:05:29
I am using Sphinx to generate the documentation for a project of mine. In this project, I describe a list of available commands in a yaml file which, once loaded, results in a dictionary in the form {command-name : command-description} for example: commands = {"copy" : "Copy the highlighted text in the clipboard", "paste" : "Paste the clipboard text to cursor location", ...} What I would like to know, is if there is a method in sphinx to load the yaml file during the make html cycle, translate the python dictionary in some reStructuredText format (e.g. a definition list ) and include in my

How to localize the documentation of a .NET library [closed]

房东的猫 提交于 2019-11-27 19:00:20
I have an open-source project ( here ) whose documentation is currently in French. The documentation is generated from XML comments in code, using Sandcastle. Now I would like to translate the documentation to English and provide documentation in both languages, but I don't really know where to start... Do I need to extract the XML comments from the code and put them in a separate file? If yes, are there any tools to automate the process? I'm using Sandcastle Help File Builder to build the documentation; do I need to create a separate project to build the doc in English, or can it be done from

How to document magic (_call and _callStatic) methods for IDEs

五迷三道 提交于 2019-11-27 17:39:45
After many happy years coding in notepad++ and sublime, I've been advised to give a PHP IDE a go. I'm trying out phpStorm and it seems nice. The code completion and documentation is a great feature but isn't working out for me when magic methods are used. Is there a work around to get phpStorm to understand what's going on in magic methods? Our situation is something like this: abstract class a { public static function __callStatic($method,$args) { if(strpos($method,"get_by_") === 0) { //do stuff } elseif(strpos($method,"get_first_by_") === 0) { //do stuff } elseif($method == "get_all") { //do

Documentation-generator for Objective-C? [closed]

孤者浪人 提交于 2019-11-27 17:23:26
Is there a generally-accepted documentation generator for Objective-C (similar to RDoc for Ruby)? I've seen Doxygen and ObjcDoc, and am wondering which is most widely used. Barry Wark Doxygen is probably the most widely used option. Because it's not just for ObjC (doxygen supports many other languages), the development is lively and the community quite strong. HeaderDoc (now an open source project), by comparison appears to have largely stagnated. HeaderDoc only produces HTML output, while doxygen also produces PDF, LaTeX and many other output forms besides HTML. Even Apple seems to recommend

How to document thrown exceptions in c#/.net [closed]

核能气质少年 提交于 2019-11-27 16:50:56
I am currently writing a small framework that will be used internally by other developers within the company. I want to provide good Intellisense information, but I am not sure how to document thrown exceptions. In the following example: public void MyMethod1() { MyMethod2(); // also may throw InvalidOperationException } public void MyMethod2() { System.IO.File.Open(somepath...); // this may throw FileNotFoundException // also may throw DivideByZeroException } I know the markup for documenting exceptions is: /// <exception cref="SomeException">when things go wrong.</exception> What I don't

RESTful API Documentation [closed]

风格不统一 提交于 2019-11-27 16:38:28
I'm going to design a RESTful API soon, thus I need to describe it in order to enable other people to start implementing clients using it. I've looked around a bit, but unfortunately, I've not found any standardized form of describing web-based RESTful services. What I'am looking for is something like JavaDoc, although it don't have to be generated out of any sort of code. I'm also not talking about something like WADL, I rather want to have some human-readable documentation I can hand out. Due to the nature of RESTful web-based services, it should be quite easy to standardize a documentation.

subversion python bindings documentation? [closed]

谁说胖子不能爱 提交于 2019-11-27 16:21:28
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . Where can I find a good introduction to using the subversion python bindings? I found one section in the svnbook that talks about it; and some basic examples from 1.3. Is there something a bit more thorough and up-to-date? 回答1: Just wanted to add a little clarification here. Thanks to the above two answers (

Doxygen: hiding private/protected method…and tips [closed]

筅森魡賤 提交于 2019-11-27 16:02:49
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I am using Doxygen to generate documentation for our API, written in C#. However, it exposes private/protected members. Is there a way to hide those? I figured out how to hide files: EXCLUDE = List of file names Yet, I need more granularity and thus shield users from unnecessary API noise. A sample Doxygen file