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

Add edb::env-switcher and edb::split-section sphinx directives #8218

Merged
merged 5 commits into from
Feb 4, 2025

Conversation

jaclarke
Copy link
Member

@jaclarke jaclarke commented Jan 14, 2025

  • edb::env-switcher:
    This directive is used to mark a group of pages as a single 'logical' page in the docs navigation, within which the user can switch between the content of each rst page using the environment switcher ui. To use create an empty index.rst page with this directive at the start, and a toctree containing the nested pages:
.. edb:env-switcher::

=============
Some tutorial
=============

.. toctree::
    :maxdepth: 3
    :hidden:

    any
    typescript
    python

The name of each nested page must be defined in the env names mapping in the docs site repo.

  • edb::split-section:
    Any page containing at least one of these directives will be rendered with the split layout design. The last child element in the directive must be a code-block or tabs directive, which will be rendered on the right side of the page, and the rest of the content in the directive will be on the left, aligned with the code block. Any other page content not in split-section directives will also be rendered on the left.
  • edb::split-point:
    Overrides the default behaviour above where the last code block is rendered on the right, and instead explicitly marks the point in the split-section after which the content is rendered on the right side of the page. Has an optional arg which can be either above or below, to pick whether the content before or after the split-point is rendered on the right side of the page (on mobile the order is the same as in the rst)

Copy link
Contributor

@scotttrinh scotttrinh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was expecting a bit more code to review here 😅

@jaclarke
Copy link
Member Author

I was expecting a bit more code to review here 😅

Yeah, most of the code is on the docs site side. 😄 I added you as reviewer just to check that how the directives work/are used makes sense. I've also flipped the split-section directive around, so the code block is at the end now, which I think matches the intended reading order.

@jaclarke jaclarke changed the base branch from master to new-gel-docs February 4, 2025 13:43
@jaclarke jaclarke force-pushed the gel-docs-directives branch from 43ca0e9 to 9719a03 Compare February 4, 2025 13:46
@jaclarke jaclarke merged commit 3bb1448 into new-gel-docs Feb 4, 2025
4 checks passed
@jaclarke jaclarke deleted the gel-docs-directives branch February 4, 2025 13:48
deepbuzin pushed a commit that referenced this pull request Feb 18, 2025
1st1 pushed a commit that referenced this pull request Feb 21, 2025
1st1 pushed a commit that referenced this pull request Feb 21, 2025
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

Successfully merging this pull request may close these issues.

2 participants