Add command switch tabs for Bash, CMD and Powershell with sphinx-tabs (#3714)

* Enable Sphinx extension sphinx-tabs

* Add command tabs for all export commands

* Add command tabs for all venv commands

Fix trim spaces
This commit is contained in:
Grey Li 2020-10-16 05:08:37 +08:00 committed by GitHub
parent 0ec369b896
commit 6219702269
14 changed files with 498 additions and 126 deletions

View file

@ -135,29 +135,31 @@ exception, and restarts the server whenever you make changes to the
code. You can leave it running and just reload the browser page as you
follow the tutorial.
For Linux and Mac:
.. tabs::
.. code-block:: none
.. group-tab:: Bash
$ export FLASK_APP=flaskr
$ export FLASK_ENV=development
$ flask run
.. code-block:: text
For Windows cmd, use ``set`` instead of ``export``:
$ export FLASK_APP=flaskr
$ export FLASK_ENV=development
$ flask run
.. code-block:: none
.. group-tab:: CMD
> set FLASK_APP=flaskr
> set FLASK_ENV=development
> flask run
.. code-block:: text
For Windows PowerShell, use ``$env:`` instead of ``export``:
> set FLASK_APP=flaskr
> set FLASK_ENV=development
> flask run
.. code-block:: none
.. group-tab:: Powershell
> $env:FLASK_APP = "flaskr"
> $env:FLASK_ENV = "development"
> flask run
.. code-block:: text
> $env:FLASK_APP = "flaskr"
> $env:FLASK_ENV = "development"
> flask run
You'll see output similar to this: