-
-
Notifications
You must be signed in to change notification settings - Fork 791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use tabs to display commands in macOS or Windows #1196
Comments
I guess this is a feature of a sphinx extension. There are different commands for the different environments ie Linux, mac, etc. The commands for macOS vs Windows can be contained in Tabs. It has instructions for windows, macOs, Unix. There's a different command for windows vs macos/unix. |
Good idea. For some examples using tabs, see: |
It was suggested on Discord that we use the sphinx-inline-tabs extension for this. |
Corresponding documentation: https://sphinx-inline-tabs.readthedocs.io/en/latest/ |
I was playing around with this today and have some notes to share. TodoAnother location where tabs could be used: Testing environmentsI'm unclear on the different commands + environment cases when running the tests. It appears there are three suitable commands:
On what systems should the user run the The proof of concept below shows two tabs: Does anyone have more knowledge on this than myself? Proof of conceptHere's a proof of concept, from the Quick reference
---------------
Here are the basic steps needed to get set up and contribute a patch.
This is meant as a checklist, once you know the basics. For complete
instructions please see the :ref:`setup guide <setup>`.
1. Install and set up :ref:`Git <vcsetup>` and other dependencies
(see the :ref:`Git Setup <setup>` page for detailed information).
5. Fork `the CPython repository <https://github.com/python/cpython>`_
to your GitHub account and :ref:`get the source code <checkout>` using::
git clone https://github.com/<your_username>/cpython
cd cpython
6. Build Python, on Unix and macOS use:
.. tab:: Unix/Linux/macOS
.. code-block:: shell
./configure --with-pydebug && make -j
.. tab:: Windows
.. code-block:: dosbatch
PCbuild\build.bat -e -d
See also :ref:`more detailed instructions <compiling>`,
:ref:`how to install and build dependencies <build-dependencies>`,
and the platform-specific pages for :ref:`Unix <unix-compiling>`,
:ref:`macOS`, and :ref:`Windows <windows-compiling>`.
7. :ref:`Run the tests <runtests>`:
.. tab:: Unix/Linux/macOS
.. code-block:: shell
./python.exe -m test -j3
.. tab:: Windows
.. code-block:: dosbatch
./python.bat -m test -j3
On :ref:`most <mac-python.exe>` macOS systems, replace :file:`./python`
with :file:`./python.exe`. On Windows, use :file:`python.bat`. |
https://devguide.python.org/ says:
So:
is Unix,
is macOS, and
is Windows. So shall we have those three tabs? |
That will mean we'll need some duplication for:
Something along the lines of: .. tab: Unix
make patchcheck
.. tab: macOS
make patchcheck
.. tab: Windows
.\python.bat Tools\patchcheck\patchcheck.py But I think that's fine: it will allow people to select the OS of their choice and they'll see the correct instructions. |
Thank you for reviewing this, @hugovk! Okay, that was my suspicion and I agree that repetition in the tags is the right way forward. If this Issue is unclaimed, I would be happy to work on it. |
Please do, you've made a good start :) And the first PR can be small: enable the extension and add some tabs to a single page. We don't need to add tabs to the whole devguide in a single go. |
@lancegoyke Thanks for doing the first two pages! We also now have some JavaScript to activate the relevant tab based on the browser's OS. I've added the pages from #1196 (comment) to a checklist in the top post, and added a couple of more |
I think we're all done here? We can re-open, or open new issues or PRs for anything else. Thanks for all the PRs, @lancegoyke! |
Sometimes we need to display command lines that are different in macos and windows.
That's a feature in furo that lets you display such commands depends on the different environments, called Tabs:
https://pradyunsg.me/furo/reference/tabs/
Using the tabs feature in furo will make the docs look cleaner.
The text was updated successfully, but these errors were encountered: