Skip to content

Commit

Permalink
Fixed image path search (#56)
Browse files Browse the repository at this point in the history
* Fixed image path search

* special case for http url

* trying to fix isabsolutefor CI

* run penguins test, commit diff. Run s/clonkk/pietroppeter/g

* rerun test locally

* fix git diff

* another commit, another CI try

* finish fixing hopefully

* add ignore whitespace to git diff command

* ignore enf of file
  • Loading branch information
Clonkk authored Jun 10, 2021
1 parent 6b24c8b commit 6306709
Show file tree
Hide file tree
Showing 18 changed files with 95 additions and 89 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ There are two levels of html rendering.
to:

* [soasme](https://github.com/soasme) for the excellent libraries nim-markdown and nim-mustache, which provide the backbone of nimib rendering and customization
* [clonkk](https://github.com/clonkk) for help in a critical piece of code early on (see [this Stack Overflow answer](https://stackoverflow.com/a/64032172/4178189))
* [Clonkk](https://github.com/Clonkk) for help in a critical piece of code early on (see [this Stack Overflow answer](https://stackoverflow.com/a/64032172/4178189))
* [yardanico](https://github.com/yardanico) for being the first contributor and great sponsor of this library, even before an official release

## ❓ ❗ Q & A
Expand Down
54 changes: 27 additions & 27 deletions docs/cheatsheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
display:none
}
</style>

<script async defer data-domain="pietroppeter.github.io/nimib" src="https://plausible.io/js/plausible.js"></script>
</head>
<body>
Expand Down Expand Up @@ -117,7 +117,7 @@ <h1>Lists</h1>
<p>(In this example, leading and trailing spaces are shown with with dots: ⋅)</p>
<pre><code class="language-markdown">1. First ordered list item
2. Another item
⋅⋅⋅⋅* Unordered sub-list.
⋅⋅⋅⋅* Unordered sub-list.
1. Actual numbers don't matter, just that it's a number
⋅⋅⋅⋅1. Ordered sub-list
4. And another item.
Expand Down Expand Up @@ -185,8 +185,8 @@ <h1>Links</h1>

Or leave it empty and use the [link text itself].

URLs and URLs in angle brackets will automatically get turned into links.
http://www.example.com or <http://www.example.com> and sometimes
URLs and URLs in angle brackets will automatically get turned into links.
http://www.example.com or <http://www.example.com> and sometimes
example.com (but not on Github, for example).

Some text to show that the reference links can follow later.
Expand All @@ -213,10 +213,10 @@ <h1>Images</h1>
<hr />
<pre><code class="language-markdown">Here's our logo (hover to see the title text):

Inline-style:
Inline-style:
![alt text](https://nim-lang.org/assets/img/logo.svg "Logo Title Text 1")

Reference-style:
Reference-style:
![alt text][logo]

[logo]: https://nim-lang.org/assets/img/logo.svg "Logo Title Text 2"
Expand Down Expand Up @@ -246,14 +246,14 @@ <h1>Code and Syntax Highlighting</h1>
var s = "JavaScript syntax highlighting";
alert(s);
```

```python
s = "Python syntax highlighting"
print s
```

```
No language indicated, so no syntax highlighting.
No language indicated, so no syntax highlighting.
But let's throw in a <b>tag</b>.
```
</code></pre>
Expand All @@ -263,7 +263,7 @@ <h1>Code and Syntax Highlighting</h1>
<pre><code class="language-python">s = &quot;Python syntax highlighting&quot;
print s
</code></pre>
<pre><code>No language indicated, so no syntax highlighting.
<pre><code>No language indicated, so no syntax highlighting.
But let's throw in a &lt;b&gt;tag&lt;/b&gt;.
</code></pre>
<blockquote>
Expand All @@ -287,7 +287,7 @@ <h1>Tables</h1>
| zebra stripes | are neat | $1 |

There must be at least 3 dashes separating each header cell.
The outer pipes (|) are optional, and you don't need to make the
The outer pipes (|) are optional, and you don't need to make the
raw Markdown line up prettily. You can also use inline Markdown.

Markdown | Less | Pretty
Expand Down Expand Up @@ -426,11 +426,11 @@ <h1>YouTube Videos</h1>
<hr />
<p>They can't be added directly but you can add an image with a link to the video like this:</p>
<pre><code class="language-markdown">&lt;a href="http://www.youtube.com/watch?feature=player_embedded&v=xqHdUjCXizI
" target="_blank">&lt;img src="http://img.youtube.com/vi/xqHdUjCXizI/0.jpg"
" target="_blank">&lt;img src="http://img.youtube.com/vi/xqHdUjCXizI/0.jpg"
alt="Nim Conf 2020 Introduction" width="240" height="180" border="10" />&lt;/a>
</code></pre>
<p><a href="http://www.youtube.com/watch?feature=player_embedded&v=xqHdUjCXizI
" target="_blank"><img src="http://img.youtube.com/vi/xqHdUjCXizI/0.jpg"
" target="_blank"><img src="http://img.youtube.com/vi/xqHdUjCXizI/0.jpg"
alt="Nim Conf 2020 Introduction" width="240" height="180" border="10" /></a></p>

</main>
Expand Down Expand Up @@ -467,7 +467,7 @@ <h1>YouTube Videos</h1>

<span class="hljs-comment"># how to create a custom block:</span>
<span class="hljs-keyword">func</span> wrapMarkdown(code: <span class="hljs-built_in">string</span>): <span class="hljs-built_in">string</span> =
<span class="hljs-string">&quot;&lt;pre&gt;&lt;code class=</span><span class="hljs-meta">\&quot;</span><span class="hljs-meta">language-markdown\&quot;</span><span class="hljs-string">&gt;&quot;</span> &amp; code &amp; <span class="hljs-string">&quot;&lt;/code&gt;&lt;/pre&gt;&quot;</span>
<span class="hljs-string">&quot;&lt;pre&gt;&lt;code class=</span><span class="hljs-meta">\&quot;</span><span class="hljs-meta">language-markdown\&quot;</span><span class="hljs-string">&gt;&quot;</span> &amp; code &amp; <span class="hljs-string">&quot;&lt;/code&gt;&lt;/pre&gt;&quot;</span>

<span class="hljs-keyword">template</span> nbTextWithSource(escapeHtml: <span class="hljs-built_in">bool</span>, body: <span class="hljs-built_in">untyped</span>) =
nbText(body)
Expand All @@ -489,7 +489,7 @@ <h1>YouTube Videos</h1>
<span class="hljs-keyword">let</span> anchorName = name.toLower.replace(<span class="hljs-string">&quot; &quot;</span>, <span class="hljs-string">&quot;-&quot;</span>)
nbText <span class="hljs-string">&quot;&lt;a name = </span><span class="hljs-meta">\&quot;</span><span class="hljs-string">&quot;</span> &amp; anchorName &amp; <span class="hljs-string">&quot;</span><span class="hljs-meta">\&quot;</span><span class="hljs-meta">&gt;&lt;/a&gt;\n</span><span class="hljs-string"># &quot;</span> &amp; name &amp; <span class="hljs-string">&quot;</span><span class="hljs-meta">\n</span><span class="hljs-meta">\n</span><span class="hljs-string">---&quot;</span>
<span class="hljs-comment"># see below, but any number works for a numbered list</span>
nbToc.output.add <span class="hljs-string">&quot;1. &lt;a href=</span><span class="hljs-meta">\&quot;</span><span class="hljs-string">#&quot;</span> &amp; anchorName &amp; <span class="hljs-string">&quot;</span><span class="hljs-meta">\&quot;</span><span class="hljs-string">&gt;&quot;</span> &amp; name &amp; <span class="hljs-string">&quot;&lt;/a&gt;</span><span class="hljs-meta">\n</span><span class="hljs-string">&quot;</span>
nbToc.output.add <span class="hljs-string">&quot;1. &lt;a href=</span><span class="hljs-meta">\&quot;</span><span class="hljs-string">#&quot;</span> &amp; anchorName &amp; <span class="hljs-string">&quot;</span><span class="hljs-meta">\&quot;</span><span class="hljs-string">&gt;&quot;</span> &amp; name &amp; <span class="hljs-string">&quot;&lt;/a&gt;</span><span class="hljs-meta">\n</span><span class="hljs-string">&quot;</span>

nbText <span class="hljs-string">&quot;&quot;&quot;
# Markdown Cheatsheet
Expand Down Expand Up @@ -531,7 +531,7 @@ <h1>YouTube Videos</h1>
<span class="hljs-keyword">const</span> dot = <span class="hljs-string">&quot;⋅&quot;</span>
<span class="hljs-keyword">let</span> source = <span class="hljs-string">&quot;&quot;&quot;1. First ordered list item
2. Another item
⋅⋅⋅⋅* Unordered sub-list.
⋅⋅⋅⋅* Unordered sub-list.
1. Actual numbers don't matter, just that it's a number
⋅⋅⋅⋅1. Ordered sub-list
4. And another item.
Expand Down Expand Up @@ -567,26 +567,26 @@ <h1>YouTube Videos</h1>

Or leave it empty and use the [link text itself].

URLs and URLs in angle brackets will automatically get turned into links.
http://www.example.com or &lt;http://www.example.com&gt; and sometimes
URLs and URLs in angle brackets will automatically get turned into links.
http://www.example.com or &lt;http://www.example.com&gt; and sometimes
example.com (but not on Github, for example).

Some text to show that the reference links can follow later.

[arbitrary case-insensitive reference text]: https://www.mozilla.org
[1]: http://slashdot.org
[link text itself]: http://www.reddit.com
&quot;&quot;&quot;</span>
&quot;&quot;&quot;</span>
nbText <span class="hljs-string">&quot;&gt; only URL with angle brackets are turned into links here&quot;</span>

nbSection <span class="hljs-string">&quot;Images&quot;</span>
nbTextWithSource <span class="hljs-string">&quot;&quot;&quot;
Here's our logo (hover to see the title text):

Inline-style:
Inline-style:
![alt text](https://nim-lang.org/assets/img/logo.svg &quot;Logo Title Text 1&quot;)

Reference-style:
Reference-style:
![alt text][logo]

[logo]: https://nim-lang.org/assets/img/logo.svg &quot;Logo Title Text 2&quot;
Expand All @@ -613,14 +613,14 @@ <h1>YouTube Videos</h1>
var s = &quot;JavaScript syntax highlighting&quot;;
alert(s);
```

```python
s = &quot;Python syntax highlighting&quot;
print s
```

```
No language indicated, so no syntax highlighting.
No language indicated, so no syntax highlighting.
But let's throw in a &lt;b&gt;tag&lt;/b&gt;.
```
&quot;&quot;&quot;</span>
Expand All @@ -645,7 +645,7 @@ <h1>YouTube Videos</h1>
| zebra stripes | are neat | $1 |

There must be at least 3 dashes separating each header cell.
The outer pipes (|) are optional, and you don't need to make the
The outer pipes (|) are optional, and you don't need to make the
raw Markdown line up prettily. You can also use inline Markdown.

Markdown | Less | Pretty
Expand Down Expand Up @@ -708,7 +708,7 @@ <h1>YouTube Videos</h1>
nbSection <span class="hljs-string">&quot;YouTube Videos&quot;</span>
nbText <span class="hljs-string">&quot;They can't be added directly but you can add an image with a link to the video like this:&quot;</span>
nbTextWithSource(escapeHtml=<span class="hljs-literal">true</span>): <span class="hljs-string">&quot;&quot;&quot;&lt;a href=&quot;http://www.youtube.com/watch?feature=player_embedded&amp;v=YOUTUBE_VIDEO_ID_HERE
&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://img.youtube.com/vi/YOUTUBE_VIDEO_ID_HERE/0.jpg&quot;
&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://img.youtube.com/vi/YOUTUBE_VIDEO_ID_HERE/0.jpg&quot;
alt=&quot;IMAGE ALT TEXT HERE&quot; width=&quot;240&quot; height=&quot;180&quot; border=&quot;10&quot; /&gt;&lt;/a&gt;
&quot;&quot;&quot;</span>.replace(<span class="hljs-string">&quot;YOUTUBE_VIDEO_ID_HERE&quot;</span>, <span class="hljs-string">&quot;xqHdUjCXizI&quot;</span>).replace(<span class="hljs-string">&quot;IMAGE ALT TEXT HERE&quot;</span>, <span class="hljs-string">&quot;Nim Conf 2020 Introduction&quot;</span>)

Expand All @@ -726,4 +726,4 @@ <h1>YouTube Videos</h1>
}
}
</script></body>
</html>
</html>
4 changes: 2 additions & 2 deletions docs/hello.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
display:none
}
</style>

<script async defer data-domain="pietroppeter.github.io/nimib" src="https://plausible.io/js/plausible.js"></script>
</head>
<body>
Expand Down Expand Up @@ -135,4 +135,4 @@ <h3>The great revelation</h3>
}
}
</script></body>
</html>
</html>
Binary file modified docs/images/penguins_count_species.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/penguins_mass_vs_length_with_sex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/penguins_mass_vs_length_with_species.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/penguins_simpson.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
display:none
}
</style>

<script async defer data-domain="pietroppeter.github.io/nimib" src="https://plausible.io/js/plausible.js"></script>
</head>
<body>
Expand Down Expand Up @@ -259,7 +259,7 @@ <h2>🙏 Thanks</h2>
<p>to:</p>
<ul>
<li><a href="https://github.com/soasme">soasme</a> for the excellent libraries nim-markdown and nim-mustache, which provide the backbone of nimib rendering and customization</li>
<li><a href="https://github.com/clonkk">clonkk</a> for help in a critical piece of code early on (see <a href="https://stackoverflow.com/a/64032172/4178189">this Stack Overflow answer</a>)</li>
<li><a href="https://github.com/Clonkk">Clonkk</a> for help in a critical piece of code early on (see <a href="https://stackoverflow.com/a/64032172/4178189">this Stack Overflow answer</a>)</li>
<li><a href="https://github.com/yardanico">yardanico</a> for being the first contributor and great sponsor of this library, even before an official release</li>
</ul>
<h2>❓ ❗ Q &amp; A</h2>
Expand Down Expand Up @@ -507,7 +507,7 @@ <h3>why the Q &amp; A?</h3>
to:

* [soasme](https://github.com/soasme) for the excellent libraries nim-markdown and nim-mustache, which provide the backbone of nimib rendering and customization
* [clonkk](https://github.com/clonkk) for help in a critical piece of code early on (see [this Stack Overflow answer](https://stackoverflow.com/a/64032172/4178189))
* [Clonkk](https://github.com/Clonkk) for help in a critical piece of code early on (see [this Stack Overflow answer](https://stackoverflow.com/a/64032172/4178189))
* [yardanico](https://github.com/yardanico) for being the first contributor and great sponsor of this library, even before an official release

## :question: :exclamation: Q &amp; A
Expand Down Expand Up @@ -568,4 +568,4 @@ <h3>why the Q &amp; A?</h3>
}
}
</script></body>
</html>
</html>
2 changes: 1 addition & 1 deletion docs/index.nim
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ There are two levels of html rendering.
to:
* [soasme](https://github.com/soasme) for the excellent libraries nim-markdown and nim-mustache, which provide the backbone of nimib rendering and customization
* [clonkk](https://github.com/clonkk) for help in a critical piece of code early on (see [this Stack Overflow answer](https://stackoverflow.com/a/64032172/4178189))
* [Clonkk](https://github.com/Clonkk) for help in a critical piece of code early on (see [this Stack Overflow answer](https://stackoverflow.com/a/64032172/4178189))
* [yardanico](https://github.com/yardanico) for being the first contributor and great sponsor of this library, even before an official release
## :question: :exclamation: Q & A
Expand Down
8 changes: 4 additions & 4 deletions docs/mostaccio.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
display:none
}
</style>

<script async defer data-domain="pietroppeter.github.io/nimib" src="https://plausible.io/js/plausible.js"></script>
</head>
<body>
Expand Down Expand Up @@ -116,7 +116,7 @@ <h3>Variables</h3>
<p>Output:</p>
<pre><code class="nim hljs"><span class="hljs-keyword">echo</span> tmpl.render(context)</code></pre>
<pre><samp>* Chris
*
*
* &amp;lt;b&amp;gt;Github&amp;lt;/b&amp;gt;
* &lt;b&gt;Github&lt;/b&gt;
* &lt;b&gt;Github&lt;/b&gt;
Expand Down Expand Up @@ -640,7 +640,7 @@ <h3>Set Delimiter</h3>
<span class="hljs-string">&quot;user&quot;</span>: user,
<span class="hljs-string">&quot;expanded&quot;</span>: expanded
}.toTable

context = newContext(searchDirs = @[], partials=partials)
context[<span class="hljs-string">&quot;names&quot;</span>] = %* [
{ <span class="hljs-string">&quot;name&quot;</span>: <span class="hljs-string">&quot;resque&quot;</span> },
Expand Down Expand Up @@ -701,4 +701,4 @@ <h3>Set Delimiter</h3>
}
}
</script></body>
</html>
</html>
4 changes: 2 additions & 2 deletions docs/nolan.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
display:none
}
</style>

<script async defer data-domain="pietroppeter.github.io/nimib" src="https://plausible.io/js/plausible.js"></script>
</head>
<body>
Expand Down Expand Up @@ -141,4 +141,4 @@ <h1>kLciimre</h1>
}
}
</script></body>
</html>
</html>
4 changes: 2 additions & 2 deletions docs/nolan_no_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
display:none
}
</style>

<script async defer data-domain="pietroppeter.github.io/nimib" src="https://plausible.io/js/plausible.js"></script>
</head>
<body>
Expand Down Expand Up @@ -74,4 +74,4 @@ <h1>kLciimre</h1>
</div>
</footer>
</body>
</html>
</html>
12 changes: 6 additions & 6 deletions docs/numerical.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ <h3>Example 3 from <a href="https://tutorial.math.lamar.edu/classes/de/eulersmet
&gt; This nimib example document shows how to:
&gt; - apply (or not) a custom style ([latex.css](https://latex.now.sh/)){otherStyle}
&gt; - using latex rendering of equations (thanks to [katex](https://katex.org/))
&gt; - having as output an html table (using standard markdown converter to table)
&gt; - having as output an html table (using standard markdown converter to table)
&gt;
&gt; The document itself shows how to use [numericalnim](https://github.com/hugogranstrom/numericalnim)
&gt; to integrate an ODE.
Expand Down Expand Up @@ -236,19 +236,19 @@ <h3>Example 3 from <a href="https://tutorial.math.lamar.edu/classes/de/eulersmet

We will use two fixed timestep methods to find the solution:
- Heun's 2nd order method (`Heun2`)
- classic 4th order Runge-Kutta (`RK4`)
- classic 4th order Runge-Kutta (`RK4`)

As timestamps we will use $h=0.1, 0.05, 0.01$.
&quot;&quot;&quot;</span>
nbText: <span class="hljs-string">&quot;First we translate the ODE as $y'=f(y,t)$ with $f$:&quot;</span>
nbCode:
<span class="hljs-keyword">proc</span> f(t, y: <span class="hljs-built_in">float</span>, ctx: <span class="hljs-type">NumContext</span>[<span class="hljs-built_in">float</span>]): <span class="hljs-built_in">float</span> =
y - <span class="hljs-number">0.5</span>*exp(<span class="hljs-number">0.5</span>*t)*sin(<span class="hljs-number">5</span>*t) + <span class="hljs-number">5</span>*exp(<span class="hljs-number">0.5</span>*t)*cos(<span class="hljs-number">5</span>*t)

<span class="hljs-keyword">proc</span> y(t: <span class="hljs-built_in">float</span>): <span class="hljs-built_in">float</span> =
<span class="hljs-comment">## analytical solution</span>
exp(<span class="hljs-number">0.5</span>*t)*sin(<span class="hljs-number">5</span>*t)

<span class="hljs-keyword">let</span> y0 = <span class="hljs-number">0.0</span>
<span class="hljs-comment">## we will not be using the NumContext object</span>
<span class="hljs-keyword">var</span> ctx = newNumContext[<span class="hljs-built_in">float</span>]()
Expand Down Expand Up @@ -318,7 +318,7 @@ <h3>Example 3 from <a href="https://tutorial.math.lamar.edu/classes/de/eulersmet
<span class="hljs-comment"># add a show Markdown source. It would be nice when hovering a code block to show (on the side? how to do it on mobile?) the call code (nbText: or other)</span>
<span class="hljs-keyword">when</span> <span class="hljs-keyword">defined</span>(numericalDefaultStyle):
nbDoc.filename = filename_default_style

nbSave
</code></pre>
</section><script>
Expand All @@ -334,4 +334,4 @@ <h3>Example 3 from <a href="https://tutorial.math.lamar.edu/classes/de/eulersmet
}
}
</script></body>
</html>
</html>
Loading

0 comments on commit 6306709

Please sign in to comment.