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 for include directive in tabs #172

Closed
JSS95 opened this issue Dec 6, 2022 · 3 comments · Fixed by #173
Closed

Support for include directive in tabs #172

JSS95 opened this issue Dec 6, 2022 · 3 comments · Fixed by #173

Comments

@JSS95
Copy link
Contributor

JSS95 commented Dec 6, 2022

Context

Sphinx's include directive allows including the entire code from another file.

.. include:: my/code.py
   :code: python

It would be nice if we had this feature in code tabs.

Proposal

Propsal A: allow include nested in code-tab

.. tabs::

   .. code-tab::

      .. include:: my/code.py
         :code: python

Proposal B: add :include: option to code-tab

.. tabs::

   .. code-tab::
      :include: my/code.py

Tasks and updates

No response

@welcome
Copy link

welcome bot commented Dec 6, 2022

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@foster999
Copy link
Collaborator

Thanks for getting in touch!

Please could you try using 'include' within a normal 'tab' directive, instead of a 'code-tab'?

The 'code-tab' puts all of the content within a code block, which can't be nested in. I believe that 'include' creates its own code block, so using it in a normal tab should give the desired result. Please let me know if this doesn't work 😄

@JSS95
Copy link
Contributor Author

JSS95 commented Dec 6, 2022

Thank you, @foster999. That worked!
I think it would be good to have this documented so I opened #173.

foster999 pushed a commit that referenced this issue Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants