-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto Generate Provider Documentation (#873)
* ✨ Added auto-generation to providers * 📝 Updated deploy action to generate provider * 📝 Updated provider paragraph on docs
- Loading branch information
Showing
5 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
32
mephisto/scripts/local_db/gh_actions/auto_generate_provider.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters