|
33 | 33 | "from ghapi.templates import *\n", |
34 | 34 | "\n", |
35 | 35 | "import textwrap\n", |
| 36 | + "from contextlib import contextmanager\n", |
36 | 37 | "from enum import Enum" |
37 | 38 | ] |
38 | 39 | }, |
|
597 | 598 | "outputs": [], |
598 | 599 | "source": [ |
599 | 600 | "#export\n", |
| 601 | + "@contextmanager\n", |
600 | 602 | "def actions_group(title):\n", |
601 | | - " \"Print the special `::group` line for `title`\"\n", |
602 | | - " print(f\"::group::{title}\")" |
| 603 | + " \"Context manager to print the special `::group`/`::endgroup` lines for `title`\"\n", |
| 604 | + " print(f\"::group::{title}\")\n", |
| 605 | + " yield\n", |
| 606 | + " print(f\"::endgroup::\")" |
603 | 607 | ] |
604 | 608 | }, |
605 | 609 | { |
606 | 610 | "cell_type": "code", |
607 | 611 | "execution_count": null, |
608 | 612 | "metadata": {}, |
609 | | - "outputs": [], |
| 613 | + "outputs": [ |
| 614 | + { |
| 615 | + "name": "stdout", |
| 616 | + "output_type": "stream", |
| 617 | + "text": [ |
| 618 | + "::group::Adding numbers...\n", |
| 619 | + "2\n", |
| 620 | + "::endgroup::\n" |
| 621 | + ] |
| 622 | + } |
| 623 | + ], |
610 | 624 | "source": [ |
611 | | - "#export\n", |
612 | | - "def actions_endgroup():\n", |
613 | | - " \"Print the special `::endgroup`\"\n", |
614 | | - " print(f\"::endgroup::\")" |
| 625 | + "with actions_group('Adding numbers...'): print(1+1)" |
615 | 626 | ] |
616 | 627 | }, |
617 | 628 | { |
|
684 | 695 | "text": [ |
685 | 696 | "Converted 00_core.ipynb.\n", |
686 | 697 | "Converted 01_actions.ipynb.\n", |
| 698 | + "Converted 02_auth.ipynb.\n", |
| 699 | + "Converted 03_page.ipynb.\n", |
| 700 | + "Converted 04_event.ipynb.\n", |
687 | 701 | "Converted 10_cli.ipynb.\n", |
688 | 702 | "Converted 50_fullapi.ipynb.\n", |
| 703 | + "Converted 80_tutorial_actions.ipynb.\n", |
689 | 704 | "Converted 90_build_lib.ipynb.\n", |
690 | | - "Converted index.ipynb.\n", |
691 | | - "Converted tutorial_actions.ipynb.\n" |
| 705 | + "Converted ghapi demo.ipynb.\n", |
| 706 | + "Converted index.ipynb.\n" |
692 | 707 | ] |
693 | 708 | } |
694 | 709 | ], |
|
0 commit comments