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

Auto Generate Provider Documentation #873

Merged
merged 5 commits into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
python auto_generate_blueprint.py
python auto_generate_architect.py
python auto_generate_requester.py

python auto_generate_provider.py
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build website
Expand Down
34 changes: 34 additions & 0 deletions docs/web/docs/reference/providers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@




# Provider


The crowd provider determines the source of the crowd workers.
## mock




|dest|type|default|help|choices|required|
| :--- | :--- | :--- | :--- | :--- | :--- |
|requester_name|str|???|None|None|False|

## mturk




|dest|type|default|help|choices|required|
| :--- | :--- | :--- | :--- | :--- | :--- |
|requester_name|str|???|None|None|False|

## mturk sandbox




|dest|type|default|help|choices|required|
| :--- | :--- | :--- | :--- | :--- | :--- |
|requester_name|str|???|None|None|False|
32 changes: 32 additions & 0 deletions mephisto/scripts/local_db/gh_actions/auto_generate_provider.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from mdutils.mdutils import MdUtils
from mephisto.client.cli_commands import get_wut_arguments
from mephisto.operations.registry import (
get_valid_provider_types,
)
from mephisto.scripts.local_db.gh_actions.auto_generate_blueprint import (
create_blueprint_info,
)


def main():
provider_file = MdUtils(
file_name="../../../../docs/web/docs/reference/providers.md",
)
provider_file.new_header(level=1, title="Providers")
provider_file.new_paragraph(
"Crowd providers standardize access to external crowd workers, by wrapping external API communication through a standardized interface."
)
valid_provider_types = get_valid_provider_types()
for provider_type in valid_provider_types:
provider_file.new_header(level=2, title=provider_type.replace("_", " "))
args = get_wut_arguments(
("provider={provider_name}".format(provider_name=provider_type),)
)
arg_dict = args[0]
create_blueprint_info(provider_file, arg_dict)

provider_file.create_md_file()


if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def main():
requester_file = MdUtils(
file_name="../../../../docs/web/docs/reference/Requester.md",
file_name="../../../../docs/web/docs/reference/requesters.md",
)
requester_file.new_header(level=1, title="Requesters")
requester_file.new_paragraph(
Expand Down