forked from CalumJEadie/microbuild
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Comments
I'm curious - how do you use this markdown? I do not know if this feature
is useful widely. I would be interested in knowing if others need this
feature as well.
…On Tue, Apr 14, 2020 at 1:42 PM drmikecrowe ***@***.***> wrote:
Is there any interest in the community for a Markdown output from the
@task <https://github.com/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
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#27>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCJUTLT2AVOIYHM6XGYC3RMRDYZANCNFSM4MHVMYMA>
.
|
Basically, I ran pynt - l - m > build-documentation.md that is committed in
the repo.
But, at a higher level the docstring uses the first line as the summary
that is printed when you run pynt -l, and the rest of the docstring is
output when you use the pynt -l -m.
While I used markdown in my docstring, it'll output whatever you code in
your tasks appropriately. If you write your docstring in rst, or another
format, it'll output that as well
On Thu, Apr 16, 2020, 3:20 PM Raghunandan Rao <notifications@github.com>
wrote:
… I'm curious - how do you use this markdown? I do not know if this feature
is useful widely. I would be interested in knowing if others need this
feature as well.
On Tue, Apr 14, 2020 at 1:42 PM drmikecrowe ***@***.***>
wrote:
> Is there any interest in the community for a Markdown output from the
> @task <https://github.com/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
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#27>, or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AABCJUTLT2AVOIYHM6XGYC3RMRDYZANCNFSM4MHVMYMA
>
> .
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#27 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAWBSC3UB3ZAQHMSWBF6CLRM5LBTANCNFSM4MHVMYMA>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
This would create the following output:
$
pynt -l -m
Raw
Formatted:
start_server
Start the server
This task starts the HTTP server on localhost:80 (by default)
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
The text was updated successfully, but these errors were encountered: