1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-16 14:17:34 +02:00

Format Python files with YAPF (#1360)

This commit is contained in:
Martin Geisler
2023-10-18 19:56:05 +02:00
committed by GitHub
parent 0022898ada
commit c4ce2ab8a9
4 changed files with 14 additions and 7 deletions

View File

@ -13,7 +13,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""mdbook preprocessor which will help show the presentation aspect ratio.
The preprocessor adds a large red rectangle on every page. The
@ -31,6 +30,7 @@ import json
import sys
import textwrap
def update_book_items(items):
aspect_ratio_helper = textwrap.dedent("""
<style>
@ -74,6 +74,7 @@ def update_book_items(items):
chapter['content'] = aspect_ratio_helper + chapter['content']
update_book_items(chapter['sub_items'])
if __name__ == '__main__':
if len(sys.argv) > 1:
if sys.argv[1] == "supports":
@ -82,4 +83,3 @@ if __name__ == '__main__':
context, book = json.load(sys.stdin)
update_book_items(book['sections'])
print(json.dumps(book))