Skip to content

Commit

Permalink
Add example of relative vs absolute figure paths in test
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Feb 26, 2020
1 parent cbf2bf3 commit f1821cb
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion tests/test_sphinx/sourcedirs/includes/subfolder/include2.inc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Some other text with **syntax**

```{figure} example.jpg
This relative path will refer to the importing file:

```{figure} example1.jpg
Caption
```

This absolute path will refer to the project root (where the `conf.py` is):

```{figure} /subfolder/example2.jpg
Caption
```
25 changes: 24 additions & 1 deletion tests/test_sphinx/test_sphinx_builds/test_includes.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ <h2>
syntax
</strong>
</p>
<p>
This relative path will refer to the importing file:
</p>
<div class="figure align-default" id="id1">
<img alt="_images/example.jpg" src="_images/example.jpg"/>
<img alt="_images/example1.jpg" src="_images/example1.jpg"/>
<p class="caption">
<span class="caption-text">
Caption
Expand All @@ -48,6 +51,26 @@ <h2>
</a>
</p>
</div>
<p>
This absolute path will refer to the project root (where the
<code class="docutils literal notranslate">
<span class="pre">
conf.py
</span>
</code>
is):
</p>
<div class="figure align-default" id="id2">
<img alt="_images/example2.jpg" src="_images/example2.jpg"/>
<p class="caption">
<span class="caption-text">
Caption
</span>
<a class="headerlink" href="#id2" title="Permalink to this image">
</a>
</p>
</div>
<p>
<a class="reference internal" href="#inc-header">
<span class="std std-ref">
Expand Down
13 changes: 12 additions & 1 deletion tests/test_sphinx/test_sphinx_builds/test_includes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,19 @@
Some other text with
<strong>
syntax
<paragraph>
This relative path will refer to the importing file:
<figure align="default" ids="id1">
<image candidates="{'*': 'example.jpg'}" uri="example.jpg">
<image candidates="{'*': 'example1.jpg'}" uri="example1.jpg">
<caption>
Caption
<paragraph>
This absolute path will refer to the project root (where the
<literal>
conf.py
is):
<figure align="default" ids="id2">
<image candidates="{'*': 'subfolder/example2.jpg'}" uri="subfolder/example2.jpg">
<caption>
Caption
<paragraph>
Expand Down

0 comments on commit f1821cb

Please sign in to comment.