documentation

What's the difference on docstrings with triple SINGLE quotes and triple DOUBLE quotes?

夙愿已清 提交于 2019-11-30 17:57:51
I was just wondering what is the difference between two ways of writing Python Docstrings ( __doc__ ): three single quotes: ''' Comment goes here ''' three double quotes: """ Comment goes here """ Is there any subtle difference in the way doc string could be formatted later while generating docs? No. They are the same. The only difference is that the first one can contain a sequence of three unescaped double quotes, while the second can contain a sequence of three unescaped single quotes. (In other words, because the delimiters are different, there is a slight difference in what characters you

Python C extension: method signatures for documentation?

家住魔仙堡 提交于 2019-11-30 17:45:33
I am writing C extensions, and I'd like to make the signature of my methods visible for introspection. static PyObject* foo(PyObject *self, PyObject *args) { /* blabla [...] */ } PyDoc_STRVAR( foo_doc, "Great example function\n" "Arguments: (timeout, flags=None)\n" "Doc blahblah doc doc doc."); static PyMethodDef methods[] = { {"foo", foo, METH_VARARGS, foo_doc}, {NULL}, }; PyMODINIT_FUNC init_myexample(void) { (void) Py_InitModule3("_myexample", methods, "a simple example module"); } Now if (after building it...) I load the module and look at its help: >>> import _myexample >>> help(

Part of a word bold in reStructuredText

五迷三道 提交于 2019-11-30 17:01:06
How can I make a part of a word bold in reStructuredText? Here is an example of what I need: ".rst stands for r e s tructured t ext." I was surprised that you could not simply write .rst stands for **r**e**s**tructured **t**ext. but the reStructuredText specification indeed states that inline markup must be followed by white-space or one of - . , : ; ! ? \ / ' " ) ] } or > , so the above string of reStructuredText is not valid. However, only a minor change is required to get valid character markup with backslash escapes. Changing the above to .rst stands for **r**\ e\ **s**\ tructured **t**\

Show <returns> xml tag into visual studio intellisense

我们两清 提交于 2019-11-30 16:58:22
I added the <returns> xml tag to some of my methods but I can't see its content in IntelliSense. Here is my code: /// <summary> /// we all live in a yellow summary /// </summary> /// <returns>what it returns</returns> public int MyMethod() { .... } Is there any way to show this content? This currently does not work (Visual Studio 2017), and is an open issue: https://github.com/dotnet/roslyn/issues/31618 One way to make it work is to install the ReSharper Visual Studio plugin (but this is paid-for). Sometimes it takes time for the IntelliSense to comprehend your code. To verify that the tag is

XCode 8.2.1 not showing documentation description on autocomplete

南楼画角 提交于 2019-11-30 14:03:15
I'm having problems adding documentation to my code in XCode 8.2.1. Here's my code: /// Test documentation method /// /// - Parameter string: The input string /// - Returns: The output bool func testMethod(string:String) -> Bool { if string == "YES" { return true } return false } The documentation shows as expected in the quick help window but the description doesn't show in the code autocomplete window. Is there a way to get the description to show in the autocomplete box as in the image below: Thank you. You are right, the descriptions you added to the top of your methods and properties don

Xml string in a C# summary comment

旧街凉风 提交于 2019-11-30 13:37:02
问题 I'm documenting a few methods I wrote in C# that deal with parsing tokens. Due to some technical restraints in other areas of the system, these tokens need to take the form of XML elements (i.e., <tokenName /> ). I'd like to put the format of those tokens in the summary statement itself. However, this throws an error: Badly formed XML -- A name was started with an invalid character". Is there any sort of escape character sequence I can use to embed XML in my C# summary comments? 回答1: Use

How do I document a module in Python?

拜拜、爱过 提交于 2019-11-30 13:36:59
问题 That's it. If you want to document a function or a class, you put a string just after the definition. For instance: def foo(): """This function does nothing.""" pass But what about a module? How can I document what a file.py does? 回答1: For the packages, you can document it in __init__.py . For the modules, you can add a docstring simply in the module file. All the information is here: http://www.python.org/dev/peps/pep-0257/ 回答2: Add your docstring as the first statement in the module. """

Using Doxygen with C, do you comment the function prototype or the definition? Or both?

筅森魡賤 提交于 2019-11-30 12:35:22
问题 I'm using Doxygen with some embedded C source. Given a .c/.h file pair, do you put Doxygen comments on the function prototype (.h file) or the function definition (.c file), or do you duplicate them in both places? I'm having a problem in which Doxygen is warning about missing comments when I document in one place but not the other; is this expected, or is my Doxygen screwed up? 回答1: For public APIs I document at the declaration, as this is where the user usually looks first if not using the

How to document fields and properties in Python?

邮差的信 提交于 2019-11-30 12:24:34
问题 It's easy to document a class or method in Python: class Something: """ Description of the class. """ def do_it(self): """ Description of the method. """ pass class_variable = 1 # How to comment? @property def give_me_some_special_dict(self): """ doesn't work! Doc of general dict will be shown. """ return {} But how to document a field or property for usage in API docs or help ? 回答1: Python has a PEP (257) that defines Docstring Conventions. Regarding documentation of attributes, it states:

Developer Documentation: Sharepoint Document Management vs. ScrewTurn Wiki [closed]

大城市里の小女人 提交于 2019-11-30 11:48:41
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Background Info I am working on setting up a method for my company's developers to share documentation and information about our