Skip to content
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

Support having the same content in multiple grouped tabs without duplicating it #62

Open
guyikcgg opened this issue Apr 22, 2020 · 4 comments

Comments

@guyikcgg
Copy link

It's common to have the same contents in multiple grouped tabs. Consider the following example:

.. group-tab:: Linux

    Copy the files using ``cp``.

.. group-tab:: Mac

    Copy the files using ``cp``.

.. group-tab:: Windows

    Copy the files using ``copy``.

It would be nice to have a way of not duplicating the same line in Linux and Mac.

@ScriptAutomate
Copy link

Ah, so something like allowing tab directives to properly support .. include:: directives and/or sphinx/rst substitutions within them?

I haven't tested those out within tab directives just yet, so I don't know what functionality works or is ignored, but these would seem like the ones to work on introducing support for.

@chrisjsewell
Copy link
Member

I'd reckon maybe something like:

.. group-tab:: Linux
    :duplicate: Mac; Other1; Other2

    Copy the files using ``cp``.

.. group-tab:: Windows

    Copy the files using ``copy``.

@stefanodavid
Copy link

I've used and I'm still using the include:: directive for duplicated content, it makes also code more readable and maintainable, plus you can reuse content also outside tabs.

BTW, @chrisjsewell thanks for picking the project up, although a bit too late for me... :-)

@guyikcgg
Copy link
Author

@stefanodavid thanks for providing that workaround. I think it's really useful and will definitely try it out. However, for short documents or short commands inside the tab, I believe that @chrisjsewell 's proposal can be convenient.

@chrisjsewell, feel free to email me when you implement the feature -- I can help with documenting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants