Skip to content

Commit

Permalink
Auto Generate Provider Documentation (#873)
Browse files Browse the repository at this point in the history
* ✨ Added auto-generation to providers

* 📝 Updated deploy action to generate provider

* 📝 Updated provider paragraph on docs
  • Loading branch information
Etesam913 committed Aug 1, 2022
1 parent e6d2fbc commit f1b6766
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 2 deletions.
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|
File renamed without changes.
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

0 comments on commit f1b6766

Please sign in to comment.