-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
194 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
project = 'sphinx-tabs test' | ||
master_doc = 'index' | ||
source_suffix = '.rst' | ||
extensions = ['sphinx_tabs.tabs'] | ||
pygments_style = 'sphinx' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<div class="sphinx-tabs docutils container"> | ||
<div class="ui top attached tabular menu sphinx-menu docutils container"> | ||
<div class="active item sphinx-data-tab-Qysr docutils container"> | ||
<div class="docutils container"> | ||
C++</div> | ||
</div> | ||
<div class="item sphinx-data-tab-UHl0aG9u docutils container"> | ||
<div class="docutils container"> | ||
Python</div> | ||
</div> | ||
</div> | ||
<div class="ui bottom attached sphinx-tab tab segment code-tab sphinx-data-tab-Qysr active docutils container"> | ||
<div class="highlight-c++"> | ||
<table class="highlighttable"> | ||
<tr> | ||
<td class="linenos"> | ||
<div class="linenodiv"> | ||
<pre>1</pre> | ||
</div> | ||
</td> | ||
<td class="code"> | ||
<div class="highlight"> | ||
<pre> | ||
<span/> | ||
<span class="n">std</span> | ||
<span class="o">::</span> | ||
<span class="n">cout</span> | ||
<span class="o"><<</span> | ||
<span class="s">"hello world"</span> | ||
<span class="o"><<</span> | ||
<span class="n">std</span> | ||
<span class="o">::</span> | ||
<span class="n">endl</span> | ||
<span class="p">;</span> | ||
</pre> | ||
</div> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> | ||
<div class="ui bottom attached sphinx-tab tab segment code-tab sphinx-data-tab-UHl0aG9u docutils container"> | ||
<div class="highlight-python"> | ||
<div class="highlight"> | ||
<pre> | ||
<span/> | ||
<span class="k">print</span> | ||
<span class="p">(</span> | ||
<span class="s1">'hello world'</span> | ||
<span class="p">)</span> | ||
</pre> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<div class="sphinx-tabs docutils container"> | ||
<div class="ui top attached tabular menu sphinx-menu docutils container"> | ||
<div class="active item sphinx-data-tab-Qysr docutils container"> | ||
<div class="docutils container"> | ||
C++</div> | ||
</div> | ||
<div class="item sphinx-data-tab-UHl0aG9u docutils container"> | ||
<div class="docutils container"> | ||
Python</div> | ||
</div> | ||
</div> | ||
<div class="ui bottom attached sphinx-tab tab segment code-tab sphinx-data-tab-Qysr active docutils container"> | ||
<div class="highlight-c++ notranslate"> | ||
<table class="highlighttable"> | ||
<tr> | ||
<td class="linenos"> | ||
<div class="linenodiv"> | ||
<pre>1</pre> | ||
</div> | ||
</td> | ||
<td class="code"> | ||
<div class="highlight"> | ||
<pre> | ||
<span/> | ||
<span class="n">std</span> | ||
<span class="o">::</span> | ||
<span class="n">cout</span> | ||
<span class="o"><<</span> | ||
<span class="s">"hello world"</span> | ||
<span class="o"><<</span> | ||
<span class="n">std</span> | ||
<span class="o">::</span> | ||
<span class="n">endl</span> | ||
<span class="p">;</span> | ||
</pre> | ||
</div> | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> | ||
<div class="ui bottom attached sphinx-tab tab segment code-tab sphinx-data-tab-UHl0aG9u docutils container"> | ||
<div class="highlight-python notranslate"> | ||
<div class="highlight"> | ||
<pre> | ||
<span/> | ||
<span class="k">print</span> | ||
<span class="p">(</span> | ||
<span class="s1">'hello world'</span> | ||
<span class="p">)</span> | ||
</pre> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. tabs:: | ||
|
||
.. code-tab:: c++ | ||
:linenos: | ||
|
||
std::cout << "hello world" << std::endl; | ||
|
||
.. code-tab:: python | ||
|
||
print('hello world') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import unittest | ||
import pkg_resources | ||
from sphinx_testing import with_app | ||
from .testcase import TestCase | ||
|
||
|
||
class LinenosTest(TestCase): | ||
@with_app( | ||
buildername='html', | ||
srcdir=pkg_resources.resource_filename(__name__, 'linenos')) | ||
def test_build_html( | ||
self, app, status, warning): # pylint: disable=unused-argument | ||
app.builder.build_all() | ||
actual = self.get_result(app, 'index') | ||
expected = self.get_expectation('linenos', 'index') | ||
self.assertHasTabsAssets(actual) | ||
self.assertXMLEqual(expected, actual) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |