-
-
Notifications
You must be signed in to change notification settings - Fork 782
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
point all the image src URIs to use the fig/ path #7
Conversation
I'd like a second opinion on this from someone more familiar than I am with how the websites build and the history of this project- why were we pointing to src and is fig the right place to be pointing. |
On Mon, Jan 19, 2015 at 11:22:52AM -0800, Azalee Bostroem wrote:
swcarpentry/DEPRECATED-lesson-template#43 may help you here. I'm not sure why |
This looks good. +1 to merge.
Because this is how HTML works, check http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element. Sorry if I don't have a better answer. @zmughal Thanks for this pull request. Do you mind replace the HTML with Markdown? E.g. replacing
with
If you do that, you can update this pull request using
where |
@r-gaia-cs Yeah, I can do that right now. |
1e7bac9
to
0875a72
Compare
Done! I added a couple captions where they were missing too. I can remove them if they distract from the flow of the text. The HTML will need to be rebuilt. |
@@ -500,7 +500,7 @@ pyplot.imshow(data) | |||
pyplot.show() | |||
~~~ | |||
|
|||
<img src="../../novice/python/01-numpy_files/novice/python/01-numpy_71_0.png"> | |||
![Heatmap of the Data](fig/01-numpy_71_0.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added caption here
@zmughal Thanks.
What you call "caption" is the alternative text that is render if the web browser doesn't support images or the image can't be retrieved. They don't distract from the flow of the text.
Could you do that?
Sorry to forget it in the first time. After you rebuild the HTML could you add it to this pull request using the same commands from my last comments? |
@@ -68,17 +68,23 @@ <h2 id="learning-objectives" class="objectives objectives">Learning Objectives</ | |||
<pre class="output"><code>weight in kilograms is now: 57.5</code></pre> | |||
<p>As the example above shows, we can print several things at once by separating them with commas.</p> | |||
<p>If we imagine the variable as a sticky note with a name written on it, assignment is like putting the sticky note on a particular value:</p> | |||
<p><img src="img/python-sticky-note-variables-01.svg" alt="Variables as Sticky Notes" /></p> | |||
<div class="figure"> | |||
<img src="fig/python-sticky-note-variables-01.svg" alt="Variables as Sticky Notes" /><p class="caption">Variables as Sticky Notes</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@r-gaia-cs, this is what I mean by the caption. It adds a <p class="caption">
to the HTML in addition to the alt
attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry that I didn't understand it correctly.
This is due one of the Pandoc's default extensions to Markdown. If you want we can disable this extension
$ pandoc -t html -f markdown-implicit_figures<<EOF
![foo](bar.jpg)
EOF
<p><img src="bar.jpg" alt="foo" /></p>
or do it for each case when need:
$ pandoc -t html <<EOF
![foo](bar.jpg)\
EOF
<p><img src="bar.jpg" alt="foo" /> </p>
There is one white space right after the \
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to automatically number figures? If so, I'm +1 on
titling them (but only if the number is part of the title, e.g., "Figure
3: Thorium Analysis"). If they can't be numbered, or if the number
cannot be included in the title, I'm -1 on titling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it can't be done with pandoc yet. jgm/pandoc#615
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Mon, Jan 19, 2015 at 04:43:05PM -0800, Greg Wilson wrote:
Is there a way to automatically number figures?
Maybe not yet? jgm/pandoc#615
It looks like there's an implementation in jgm/pandoc#1298 that's
blocking on a cleaner solution 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to automatically number figures?
We can use CSS.
body {
counter-reset: figure;
}
div.figure p::before {
content: "Figure " counter(figure) ": ";
counter-increment: figure;
}
Another possible solution is using another filter based on
$ pandoc -t json <<EOF
![foo](bar.jpg)
EOF
[{"unMeta":{}},[{"t":"Para","c":[{"t":"Image","c":[[{"t":"Str","c":"foo"}],["bar.jpg","fig:"]]}]}]]
$ pandoc -t json -f markdown-implicit_figures<<EOF
![foo](bar.jpg)
EOF
[{"unMeta":{}},[{"t":"Para","c":[{"t":"Image","c":[[{"t":"Str","c":"foo"}],["bar.jpg",""]]}]}]]
Done! |
On Mon, Jan 19, 2015 at 04:09:57PM -0800, Raniere Silva wrote:
I'd recommend the compiled HTML land as a separate commit, to avoid |
I backed out the HTML in the commit for now and used the |
@zmughal Sorry for the delay.
You only used it on the figures at |
@r-gaia-cs , yes, this is correct. I can do so on the remaining figures if you'd like. In fact, maybe just make those changes and decide how to enumerate the figures later in another issue? (The reason I only did that on just the ones in |
@zmughal Please. When you update this pull request, please send me a note (can be on IRC or email to avoid spam) and I will merge this.
👍 |
And change the `<img>` tags to use Markdown's `![caption](/path/to/image)` syntax. Uses the <backslash><white-space> escaping from Pandoc to avoid generating captions (see the `markdown-implicit_figures` extension).
point all the image src URIs to use the fig/ path
point all the image src URIs to use the fig/ path
No description provided.