Coder Social home page Coder Social logo

sphinx-doc.el's People

Contributors

bookest avatar naiquevin avatar nightblues avatar peterewills avatar syohex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sphinx-doc.el's Issues

Feature request: numpydoc syntax

Sphinx has an extension, numpydoc, which enables a very popular docstring style that is used by numpy, scipy, and many other packages. It would be nice if sphinx-doc could generate docstrings using the syntax of numpydoc.

Error when inserting docstring; inserting docstring kills any existing docstring

Hi:

I just installed the elisp package from MELPA, and tried using it with my Python code. I keep getting the following error message when attempting to insert a new docstring into my code, and additionally, it always kills any existing docstring inside it, instead of updating it.

Suspicious state from syntax checker python-pycompile: Checker python-pycompile returned non-zero exit code 1, but no errors from output: Sorry: IndentationError: ('unexpected indent', ('/tmp/flycheck15795ZS0/app_utils.py', 84, 9, '         callback = mari.utils.connec()\n')) Checker definition probably flawed.

Is there anything I can do to resolve this?

Thanks!

How can I ignore new-line after param or returns?

When I apply C-c M-d it creates the doc section having new line at the end. Would it be possible to ignore the newline that applid at the end of docs?

Example output:

"""TODO describe function

:param provider:
:param _from:
:param job:
:returns:

"""

Wanted:

"""TODO describe function

:param provider:
:param _from:
:param job:
:returns:
"""

Do not enable mode globally on require

The init-value parameter for define-minor-mode is set to t. This enables the mode in non-python buffers as well, which is unfortunate. As far as I can tell from the documentation of define-minor-mode, there is no reason to set it to t initially. As with other minor modes, I'd prefer to enable it from python-mode-hook.

How can we add compact single line?

Before:

def helloworld():
    pass

after:

def helloworld():
    """TODO describe function

    :returns:

    """
    pass

Instead, for an empty function can we remove returns: value and we have more compact as follows:

def helloworld():
    """TODO describe function."""
    pass

Support trailing commas?

In some codebases I have seen that trailing commas are used in function definitions, especially when functions take a lot of keyword parameters and people frequently change or add them. Trailing commas then help with version control and guard against forgotten commas. You might argue whether this is good stile, but the following is valid python:

def foo(arg1, arg2, arg3,):
    return bar

sphinx-doc then fails, because sphinx-doc-fun-args creates an empy string "" as the last arg. I fixed that in place by just removing empty strings from the argument list with remove "". But maybe there is a better place to implement a fix. I didn't go really went into understanding your code, so I refrained from a PR.

(defun sphinx-doc-fun-args (argstrs)
  "Extract list of arg objects from string ARGSTRS.
ARGSTRS is the string representing function definition in Python.
Note that the arguments self, *args and **kwargs are ignored."
  (when (not (string= argstrs ""))
    (mapcar #'sphinx-doc-str->arg
            (-filter
             (lambda (str)
               (and (not (string= (substring str 0 1) "*"))
                    (not (string= str "self"))))
             (remove ""
              (mapcar #'s-trim
                      (split-string argstrs ",")))))))

Feature request: "warning" and "note"

It would be nice to have functions that automatically generate a skeleton for 'warning' and 'note'. For example:

    def function(array, key):
        """
        This function does ...

        .. warning::

            Possible warnings tba. 

        Docstring continued...

        .. note::

            The syntax should be ... 

        Parameters
        ----------
        value : list
            Array read from the parameter file
        key : str
            Name of the parameter

        """

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.