Skip to content

Conversation

@peterjc
Copy link
Contributor

@peterjc peterjc commented Dec 19, 2014

This change seems sensible for both reading the input markdown, and the rendering as HTML.

Assuming there is not something in the template which deals with this (and my change is not needed), then I would guess this fix will be needed on all the other recently migrated lessons (and the migration script may need tweaking).

Update: Looking at a few of the other lessons with R and Python (by eye), I did not find any more unescaped inequalities.

@gvwilson
Copy link
Contributor

Good catch - I'll review.

@gvwilson gvwilson assigned gvwilson and tbekolay and unassigned gvwilson Dec 19, 2014
@abostroem
Copy link
Contributor

@gvwilson Did you get a chance to review this or does it still need review?

@gvwilson
Copy link
Contributor

gvwilson commented Jan 2, 2015

I haven't had a chance to review - could you please?

@abostroem
Copy link
Contributor

@gvwilson not sure how to test this. When I run
make preview
it only updates the README.html...

@peterjc
Copy link
Contributor Author

peterjc commented Jan 5, 2015

You can look at the README.md file in your favourite markdown aware viewer, or just browse the files as of my commit right here on GitHub using GitHub's rendering, e.g.:
https://github.com/peterjc/python-novice-inflammation/blob/a4009e55195018f3a1e5b04e2fcc7f3b278170de/01-numpy.md

@aaren
Copy link
Contributor

aaren commented Jan 15, 2015

@peterjc you missed one:

$ ack '&#' -G .*md
01-numpy.md
39:numpy.loadtxt(fname='inflammation-01.csv', delimiter=',')

@aaren
Copy link
Contributor

aaren commented Jan 15, 2015

@abostroem you can force make to update everything by doing make preview -B

@aaren
Copy link
Contributor

aaren commented Jan 15, 2015

@gvwilson any idea why this is like this in the first place?

@gvwilson
Copy link
Contributor

@aaren Apologies for losing the thread - why what is like what?

@peterjc
Copy link
Contributor Author

peterjc commented Jan 15, 2015

@gvwilson I think the question was how did these over-escaped HTML entities get into the markdown source?

@aaren Good catch on the HTML escaped quotes, give my a moment and I'll fix that in another commit...

@aaren
Copy link
Contributor

aaren commented Jan 15, 2015

@gvwilson yes, why are these html things (', etc.) in the markdown at all? Is there a systemic reason?

@peterjc peterjc force-pushed the unescape_inequalities branch from a4009e5 to 7020c6a Compare January 15, 2015 12:45
@peterjc
Copy link
Contributor Author

peterjc commented Jan 15, 2015

Rebased and the quote fixed.

@peterjc
Copy link
Contributor Author

peterjc commented Jan 15, 2015

I haven't down a grep across all the lessons (I only have a handful cloned locally), but it looks like something went wrong on this lesson only?

@aaren
Copy link
Contributor

aaren commented Jan 15, 2015

Here is the full (?) list of html entities still in the markdown:

$ ack '&' -G '.*md$'
05-defensive.md
71:<ipython-input-19-33d87ea29ae4> in <module&gt;()

04-cond.md
412:    That means that on a 40&times;60 data set, we are performing the same calculation 2400 times.

01-numpy.md
39:numpy.loadtxt(fname=&#39;inflammation-01.csv&#39;, delimiter=&#39;,&#39;)
238:if we have an M&times;N array in Python,
468:The expression `(40,)` tells us we have an N&times;1 vector,

@peterjc can you fix the defensive programming one as well?

As for the others (&times), I'm not sure what to do with these. If we had mathjax we could replace with latex, but I don't think that we do so either leave them as is or replace with x.

@peterjc
Copy link
Contributor Author

peterjc commented Jan 15, 2015

I thought I did all the less-than and greater-than signs, thanks again @aaren.

I'm not sure what is best for the times signs - they should look nice in the HTML output at least.

@gvwilson
Copy link
Contributor

It's almost certainly a side effect of an automatic translator (probably
the IPython Notebook to Markdown translation). There's no reason to
keep the escapes. I'm happy to replace them all with "natural" characters.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to change with this PR? I know it is happening automatically, but could you move it to a different commit?

@abostroem
Copy link
Contributor

@aaren and @peterjc does the current form render correctly and this just fixes the code to be all html or does the current version (pre-PR) render incorrectly?

Please let me know when you are ready to merge

@aaren
Copy link
Contributor

aaren commented Jan 15, 2015

@abostroem the pre-PR version renders incorrectly. Look at 01-numpy.html in your browser. This PR modifies the markdown input to not use html escaped characters and then updates the html to reflect that.

@peterjc
Copy link
Contributor Author

peterjc commented Jan 16, 2015

I deliberately committed in the changes to *.html as generated by make preview as per my understanding of the instructions.

(Personally I don't understand why generated *.html files are under source code control, but that's a different issue.)

@gvwilson
Copy link
Contributor

I deliberately committed in the changes to |*.html| as generated by
|make preview| as per my understanding of the instructions.

Thanks.

(Personally I don't understand why generated |*.html| files are under
source code control, but that's a different issue.)

From https://github.com/swcarpentry/lesson-template/blob/gh-pages/DESIGN.md:

Using Pandoc instead of Jekyll means that we have to compile our
Markdown into HTML on our own machines and commit it to the |gh-pages|
branch of the lesson's GitHub repository.

It's considered bad practice to put computer-generated files under
version control, but the HTML pages put into the lesson's root
directory by Pandoc /must/ be committed to version control in order
for the lesson to be displayed properly on GitHub.

It's also considered bad practice to put generated files in the same
directory as source files. We do it because some authors may use
auxiliary source files such as R Markdown and IPython Notebook files
which are executable, and contain paths to things like images and data
files. If we put our source files in a sub-directory, those paths
won't work (or conversely, if we put our generated files in a
different directory, the paths won't work there).

Dr. Greg Wilson | gvwilson@software-carpentry.org
Software Carpentry | http://software-carpentry.org

@aaren
Copy link
Contributor

aaren commented Jan 16, 2015

This looks good to me. I'll leave it to @abostroem to merge.

abostroem added a commit that referenced this pull request Jan 18, 2015
Unescape the less than and greater than inequalities
@abostroem abostroem merged commit 2cc2386 into swcarpentry:gh-pages Jan 18, 2015
valentina-s pushed a commit that referenced this pull request Jun 20, 2016
valentina-s pushed a commit that referenced this pull request Nov 10, 2016
Revising error type since Python 3.x has changed it.
valentina-s pushed a commit that referenced this pull request Feb 3, 2017
Fixed incorrect line numbers in 08-defensive.md
rgaiacs pushed a commit to rgaiacs/swc-python-novice-inflammation that referenced this pull request May 6, 2017
refactored 01-06 to match recent live workshops
rgaiacs pushed a commit to rgaiacs/swc-python-novice-inflammation that referenced this pull request May 6, 2017
rgaiacs pushed a commit to rgaiacs/swc-python-novice-inflammation that referenced this pull request May 6, 2017
rgaiacs pushed a commit to rgaiacs/swc-python-novice-inflammation that referenced this pull request May 6, 2017
rgaiacs pushed a commit to rgaiacs/swc-python-novice-inflammation that referenced this pull request May 6, 2017
kdottiemo pushed a commit to kdottiemo/python-novice-inflammation that referenced this pull request May 19, 2017
…XME in two spots, instead of python-novice-inflammation. Fixed.
@tbekolay tbekolay removed their assignment Oct 16, 2017
maxim-belkin pushed a commit that referenced this pull request Feb 27, 2019
_config.yml: no 'mailto' in 'email'
maxim-belkin pushed a commit that referenced this pull request Oct 23, 2020
maxim-belkin pushed a commit that referenced this pull request Oct 23, 2020
zkamvar pushed a commit that referenced this pull request Apr 21, 2023
Using template variables everywhere

- Fixed error in header.html; missing }
zkamvar pushed a commit that referenced this pull request Apr 21, 2023
Unescape the less than and greater than inequalities
zkamvar pushed a commit that referenced this pull request Apr 21, 2023
zkamvar pushed a commit that referenced this pull request Apr 21, 2023
Revising error type since Python 3.x has changed it.
zkamvar pushed a commit that referenced this pull request Apr 21, 2023
Fixed incorrect line numbers in 08-defensive.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants