From 1ecc19173815187374a68fcf17c0feb538df1259 Mon Sep 17 00:00:00 2001 From: pushfoo <36696816+pushfoo@users.noreply.github.com> Date: Mon, 22 Jul 2024 00:59:58 -0400 Subject: [PATCH 1/3] Add script to convert to Google Docstring style * Add shell script wrapper around docconvert * Mark old script as deprecated --- util/convert_rst_to_google_docs.py | 2 + util/convert_rst_to_google_docs.sh | 69 ++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100755 util/convert_rst_to_google_docs.sh diff --git a/util/convert_rst_to_google_docs.py b/util/convert_rst_to_google_docs.py index 5c086d20b..038d07c10 100644 --- a/util/convert_rst_to_google_docs.py +++ b/util/convert_rst_to_google_docs.py @@ -3,6 +3,8 @@ https://github.com/pythonarcade/arcade/issues/1797 """ +print("Note: this is partially complete, use convert_rst_to_google_docs.sh instead!") +exit(1) import glob import re diff --git a/util/convert_rst_to_google_docs.sh b/util/convert_rst_to_google_docs.sh new file mode 100755 index 000000000..342b36e45 --- /dev/null +++ b/util/convert_rst_to_google_docs.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +# Easy Wrapper around the docconvert python package +# https://pypi.org/project/docconvert/ + +requires() { +cat <&2 + requires 1>&2 + exit 1 +fi + + +Usage() { +cat < $CONFIG_FILE +{ + "input_style": "rest", + "output_style": "google", + "accepted_shebangs": [ + "python" + ], + "output": { + "first_line": true, + "remove_type_backticks": "false", + "use_types": false + } +} +EOF +} +ensure_have_config +echo "Attempting docconvert..." + +docconvert --config $CONFIG_FILE --in-place "$@" From 44f003339bfa1bc7e3bedbd63f0b95dbfb23549c Mon Sep 17 00:00:00 2001 From: pushfoo <36696816+pushfoo@users.noreply.github.com> Date: Mon, 22 Jul 2024 01:03:31 -0400 Subject: [PATCH 2/3] Add better usage instructions --- util/convert_rst_to_google_docs.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/util/convert_rst_to_google_docs.sh b/util/convert_rst_to_google_docs.sh index 342b36e45..31854d500 100755 --- a/util/convert_rst_to_google_docs.sh +++ b/util/convert_rst_to_google_docs.sh @@ -27,9 +27,18 @@ https://pypi.org/project/docconvert/ EOF requires +cat < Date: Mon, 22 Jul 2024 01:07:20 -0400 Subject: [PATCH 3/3] Whitespace fix for config file template --- util/convert_rst_to_google_docs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/convert_rst_to_google_docs.sh b/util/convert_rst_to_google_docs.sh index 31854d500..a622a6de2 100755 --- a/util/convert_rst_to_google_docs.sh +++ b/util/convert_rst_to_google_docs.sh @@ -68,7 +68,7 @@ cat < $CONFIG_FILE "first_line": true, "remove_type_backticks": "false", "use_types": false - } + } } EOF }