Skip to content

Use tab sets to avoid synchronization of input/ouput tabs in Sphinx #2577

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ public final class SphinxIntegration implements DocIntegration {
private static final List<String> MARKDOWN_REQUIREMENTS = parseRequirements("requirements-markdown.txt");

private static final List<String> BASE_EXTENSIONS = List.of(
"sphinx_inline_tabs",
"sphinx_copybutton",
"sphinx_design");
private static final List<String> MARKDOWN_EXTENSIONS = List.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
@SmithyUnstableApi
public final class SphinxMarkdownWriter extends MarkdownWriter {

private boolean isNewTabGroup = true;

/**
* Constructs a SphinxMarkdownWriter.
*
Expand Down Expand Up @@ -65,27 +63,19 @@ public DocWriter writeAnchor(String linkId) {

@Override
public DocWriter openTabGroup() {
isNewTabGroup = true;
write("::::{tab-set}");
return this;
}

@Override
public DocWriter closeTabGroup() {
isNewTabGroup = true;
write("::::");
return this;
}

@Override
public DocWriter openTab(String title) {
write(":::{tab} $L", title);
if (isNewTabGroup) {
// The inline tab plugin will automatically gather tabs into groups so long
// as no other elements separate them, so to make sure we never accidentally
// merge what should be two groups, we add this directive config to opening
// tabs to ensure a new group gets created.
write(":new-set:\n");
isNewTabGroup = false;
}
write(":::{tab-item} $L", title);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# These are base requirements needed for any sphinx project output.
Sphinx==8.1.3
sphinx_inline_tabs==2023.4.21
sphinx-copybutton==0.5.2
Pygments==2.18.0
sphinx-design==0.6.1
Loading