Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Markdown output from docstrings #27

Open
drmikecrowe opened this issue Apr 14, 2020 · 2 comments
Open

Enhancement: Markdown output from docstrings #27

drmikecrowe opened this issue Apr 14, 2020 · 2 comments

Comments

@drmikecrowe
Copy link

Is there any interest in the community for a Markdown output from the @task() docstrings? If so, I can submit a PR.

In my project, I adopted the standard of:

@task()
def start_server(server='localhost', port = '80'):
    """Start the server

    This task starts the HTTP server on localhost:80 (by default)

    - Args:
        - `server` (`str`, optional): The server IP address. Defaults to 'localhost'.
        - `port` (`str`, optional): The port number. Defaults to '80'.
    """

    print('Starting server at %s:%s' % (server, port))

@task(start_server) #Depends on task with all optional params
def stop_server():
    """Stop the server

    This task stops the running server
    """
    print('Stopping server....')

This would create the following output:

$ pynt -l -m

Raw

---
## start_server

`Start the server`

This task starts the HTTP server on localhost:80 (by default)

- Args:
    - `server` (`str`, optional): The server IP address. Defaults to 'localhost'.
    - `port` (`str`, optional): The port number. Defaults to '80'.

---
## stop_server

`Stop the server`

This task stops the running server

Formatted:


start_server

Start the server

This task starts the HTTP server on localhost:80 (by default)

  • Args:
    • server (str, optional): The server IP address. Defaults to 'localhost'.
    • port (str, optional): The port number. Defaults to '80'.

stop_server

Stop the server

This task stops the running server

@rags
Copy link
Owner

rags commented Apr 16, 2020 via email

@drmikecrowe
Copy link
Author

drmikecrowe commented Apr 16, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants