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

Add documentation for "programmatic" usage #358

Open
sreenivasulureddysura opened this issue Jul 29, 2024 · 8 comments
Open

Add documentation for "programmatic" usage #358

sreenivasulureddysura opened this issue Jul 29, 2024 · 8 comments
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@sreenivasulureddysura
Copy link

sreenivasulureddysura commented Jul 29, 2024

Currently Granian documentation is not there. Example: document

@gi0baro
Copy link
Member

gi0baro commented Jul 30, 2024

@sreenivasulureddysura can you clarify this?

@gi0baro gi0baro changed the title User Documentation with Github Add documentation for "programmatic" usage Jul 30, 2024
@gi0baro gi0baro added documentation Improvements or additions to documentation help wanted Extra attention is needed labels Jul 30, 2024
@iamkhav
Copy link
Contributor

iamkhav commented Jul 31, 2024

@sreenivasulureddysura, do you mean "programmatic" as in calling Granian from Python instead of cli?

If so, that's true. This way of using Granian is not documented. One would have to check code to see how

granian/granian/cli.py

Lines 257 to 304 in 0a85e88

server = Granian(
app,
address=host,
port=port,
interface=interface,
workers=workers,
threads=threads,
blocking_threads=blocking_threads,
threading_mode=threading_mode,
loop=loop,
loop_opt=loop_opt,
http=http,
websockets=websockets,
backlog=backlog,
backpressure=backpressure,
http1_settings=HTTP1Settings(
keep_alive=http1_keep_alive, max_buffer_size=http1_buffer_size, pipeline_flush=http1_pipeline_flush
),
http2_settings=HTTP2Settings(
adaptive_window=http2_adaptive_window,
initial_connection_window_size=http2_initial_connection_window_size,
initial_stream_window_size=http2_initial_stream_window_size,
keep_alive_interval=http2_keep_alive_interval,
keep_alive_timeout=http2_keep_alive_timeout,
max_concurrent_streams=http2_max_concurrent_streams,
max_frame_size=http2_max_frame_size,
max_headers_size=http2_max_headers_size,
max_send_buffer_size=http2_max_send_buffer_size,
),
log_enabled=log_enabled,
log_level=log_level,
log_dictconfig=log_dictconfig,
log_access=log_access_enabled,
log_access_format=log_access_fmt,
ssl_cert=ssl_certificate,
ssl_key=ssl_keyfile,
url_path_prefix=url_path_prefix,
respawn_failed_workers=respawn_failed_workers,
respawn_interval=respawn_interval,
reload=reload,
process_name=process_name,
pid_file=pid_file,
)
try:
server.serve()
except FatalError:
raise click.exceptions.Exit(1)

I could add this use-case to README.md.

BTW, are there any plans to have a dedicated documentation website?

@gi0baro
Copy link
Member

gi0baro commented Aug 1, 2024

@sreenivasulureddysura, do you mean "programmatic" as in calling Granian from Python instead of cli?

Correct, I changed the title and the naming comes from Uvicorn (https://www.uvicorn.org/#running-programmatically).

I could add this use-case to README.md.

BTW, are there any plans to have a dedicated documentation website?

IMHO at the moment there's still few content for launching a website; probably relying on markdown files within the GH repo is fine at the moment, in the same way we have those for other projects in the organization like renoir.

@sreenivasulureddysura
Copy link
Author

@gi0baro Let's bring all the markdown files and deploy it using the github page. Mkdocs library will help in the deploy it. If you are okay with Mkdocs I will submit the PR with the basic structure.

@gi0baro
Copy link
Member

gi0baro commented Aug 1, 2024

@gi0baro Let's bring all the markdown files and deploy it using the github page. Mkdocs library will help in the deploy it. If you are okay with Mkdocs I will submit the PR with the basic structure.

Again, there's no enough content/reasons to publish (yet?) a website about Granian. And if and when that become a need, it would probably be a subdomain of emmett.sh website or even if on its own domain, built in a similar way.

None of the projects in Emmett organization use Mkdocs; I would avoid having a single project with a different toolset/workflow, and if there's any valid reason to change that organization-wide, we should have that discussion separately from this issue.

Let's start by having documentation in place with just markdown files, then post-pone further considerations at the proper time.

@sreenivasulureddysura
Copy link
Author

@gi0baro f emmett.sh website or even if on its own domain, [built in a similar way](https://github.com/emmett-framework/website). this looks good. Can we have a sub-domain of the emmett.sh for granian that helps? You have lot of content for Granian Just the document to arrange it .

@iamkhav
Copy link
Contributor

iamkhav commented Aug 1, 2024

@gi0baro f emmett.sh website or even if on its own domain, [built in a similar way](https://github.com/emmett-framework/website). this looks good. Can we have a sub-domain of the emmett.sh for granian that helps? You have lot of content for Granian Just the document to arrange it .

How about as a first (small) step we re-organize the current root md file into multiple ones and link from the root md file (in places where it might be necessary)? :)

It's easier to read and it'll also be easier to transition once @gi0baro decides it's time to move the docs to a standalone domain.

FWIW, I think the thoroughness and quality of information in the docs is much more important than them having their own domain. I'll start with making a PR for programmatic usage ☝🏽

@gi0baro
Copy link
Member

gi0baro commented Aug 1, 2024

How about as a first (small) step we re-organize the current root md file into multiple ones and link from the root md file (in places where it might be necessary)? :)

Sounds good to me; the only warning point to take into account is that README.md is also used for PyPi, so let's just be careful on what we take out from there.

FWIW, I think the thoroughness and quality of information in the docs is much more important than them having their own domain.

I totally agree.

I'll start with making a PR for programmatic usage ☝🏽

Thank you for the effort!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants