Skip to content

Conversation

@goodlux
Copy link

@goodlux goodlux commented Jun 25, 2018

This fixes issue #8529.

  • Adds Katex extension to conf.py and requirements.txt
  • Fixes syntax differences in docs
  • Should allow documentation pages to render faster

@ssnl
Copy link
Collaborator

ssnl commented Jun 25, 2018

Nice! If it's possible, could you build and host webpage somewhere for easier review purpose? I'm not that familiar with katex to be confident with just reading the code...

@goodlux
Copy link
Author

goodlux commented Jun 25, 2018

Not sure if you will be able to see this, but here goes:
https://home.fburl.com/~robkunkle/katex_test/html_v2/

If that doesn't work, you can test the code locally by going into /doc directory, then typing

make html

it will put the site files in /docs/build/html

Copy link
Collaborator

@ssnl ssnl left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! The link you gave works. Most comments are on \text wrappers. There are a few changes that look unintended to me too.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@goodlux goodlux requested a review from orionr as a code owner June 25, 2018 21:50
@ssnl
Copy link
Collaborator

ssnl commented Jun 25, 2018

this seem to accidentally include changes from other commits

@goodlux
Copy link
Author

goodlux commented Jun 26, 2018

should be resolved now.

@goodlux
Copy link
Author

goodlux commented Jun 26, 2018 via email

Copy link
Collaborator

@ssnl ssnl left a comment

Choose a reason for hiding this comment

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

Romanizing/Italicizing should be the topic of a broader discussion than just among @fmassa , @goodlux and me. The purpose of this patch should be mainly about migrating to KaTeX, rather than changing the behavior / how docs render. We can open an issue and/or discuss internally separately.

This comment was marked as off-topic.

This comment was marked as off-topic.

@zou3519
Copy link
Contributor

zou3519 commented Jun 29, 2018

@goodlux we use flake8 to lint our python code. The lint test is failing (see https://travis-ci.org/pytorch/pytorch/jobs/397456179, this is under "continuous-integration/travis-ci/pr".

You can run the lint locally with "python -m flake8"

@zou3519
Copy link
Contributor

zou3519 commented Jun 29, 2018

@goodlux, looking at https://github.com/pytorch/pytorch/pull/8848/files (which is the list of changed files), some of the \text{ } removals were not undone. Maybe you haven't pushed a commit?

@ssnl
Copy link
Collaborator

ssnl commented Jun 29, 2018

@goodlux I still don't understand the need for a new PR. And this PR definitely shouldn't remove those \text wrappers.

  1. What's wrong with reverting \text changes by pushing to this branch as a new commit? Isn't that as easy (or arguably easier) than submitting as part of a new PR?
  2. We can't merge a PR that has changes that we don't want, even if they will be fixed in a new PR. Each PR is supposed to maintain the repo in a good and consistent state. Until we decide that removing \text is wanted, we shouldn't remove them.
  3. As you also agreed above, this PR should be only about changing mathjax to katex. So please just revert those changes on \text.
  4. I reverted your branch to the first commit, which still hasn't addressed some comments I left, both the ones about \text and the ones not.
  5. See @zou3519 's comment on CI. We can't merge a PR that breaks CI (in this case, continuous-integration/travis-ci/pr, which does the lint check).

So, please just
a. push a commit that keeps \text where they were
b. fix lint.
c. address comments, e.g. remove this is not a test.

(b) & (c) are absolutely merge-blocking. For (a), since you are fixing them anyways, I just don't see why it can't be done in this PR.

Please feel free to correct me if I misunderstood your points.

@ssnl
Copy link
Collaborator

ssnl commented Jun 29, 2018

@pytorchbot retest this please

@goodlux
Copy link
Author

goodlux commented Jul 2, 2018

@ssnl -

The reason I want to make any content changes in a new PR, is because my local branch is polluted.

I'm not able to pull --rebase as recommended, I'm still getting merge conflicts over /third_party/onnx and the fold.py file.

I'd rather just start with a new, clean branch...and fix these minor issues, rather than spending time trying to debug issues with a polluted local branch. If you INSIST though, I'm happy to sync up in another meeting and get to the bottom of it.

Again, I would prefer though to just move on to a clean branch...there are a ton of content changes that need to be made and I'd like to start working on them.

As far as:

"(b) & (c) are absolutely merge-blocking. " - Agreed. I fixed these via github browser...these will be the last changes I'm making to this branch.

@goodlux
Copy link
Author

goodlux commented Jul 2, 2018

Also: To answer (2) and (3) above:

  1. We can't merge a PR that has changes that we don't want, even if they will be fixed in a new PR. Each PR is supposed to maintain the repo in a good and consistent state. Until we decide that removing \text is wanted, we shouldn't remove them.
  • If we are blocked because we aren't sure about italics, let's resolve that now. I'll make a post to the group, and people can vote.
  1. As you also agreed above, this PR should be only about changing mathjax to katex. So please just revert those changes on \text
  • This PR is about making that change, but there were many changes at needed to be made to the formulae for Katex to work. It works fine whether or not one uses italic fonts though....so it's really a non-issue as far as Katex functioning.

@zou3519
Copy link
Contributor

zou3519 commented Jul 3, 2018

@goodlux according to this PR thread, there are still unresolved pull request comments above (some of the \text deletions are still present). The GitHub pull request review comments will auto-minimize after the particular lines of code they are tagged in change.

If you have a polluted local branch, you can try something like the following:

  • Note the git hashes of the commits you made (use git log)
  • check out a new branch off of master
  • use git cherry-pick to select the commits you have onto this new branch

@soumith
Copy link
Contributor

soumith commented Jul 3, 2018

@zou3519 goodlux and I rebased the PR correctly late last night and got his local git branch in a good state. He will revert the \text deletions.

@ssnl
Copy link
Collaborator

ssnl commented Jul 3, 2018

@soumith @zou3519 Thanks for commenting and fixing. :)

@goodlux Sorry if I sounded negative. I didn't mean to. @zou3519 's tip on git cherry-pick is very useful. In addition, a few git commands that I often use in this nasty situation (local branch is messed up) is:

  1. Reset to remote (this loses local changes):
git fetch --all
git reset --hard origin/katex
  1. Drop commits in local branch up to N commits before:
git rebase -i HEAD~{N}
// in the new editor window, you can change the "label" of each commit: 
//  'd' means dropping a commit; 
//  'e' means editing a commit; 
//  's' means squashing a commit with a previous one.
  1. Update local branch with upstream changes:
git pull --rebase upstream master
// Then, if there are merge conflicts, be sure to fix them
// After fixing, 
// git add -A
// git rebase --continue

After doing (2) or (3), you probably need to git push --force on the next push, since remote and local branches have different history.

Hope that this helps.

@weiyangfb
Copy link
Contributor

@goodlux the rebase doesn't look right...

@goodlux
Copy link
Author

goodlux commented Jul 12, 2018

@weiyangfb specifically, what is wrong? I've corrected everything that @ssnl pointed out, in this branch, as requested by him. @soumith actually fixed the branch, and I've used --rebase since. Beyond that, I'm not sure how to proceed. Please advise what I need to do so this PR can be complete.

@soumith
Copy link
Contributor

soumith commented Jul 12, 2018

@goodlux i'll fix your branch and push the PR to master.
To refer to what Wei is saying, if you see the commits tab of this PR: https://github.com/pytorch/pytorch/pull/8848/commits it shows 31 commits, a lot of them unrelated to your changes. It should only show commits that you have pushed.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

SsnL has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

goodlux pushed a commit to goodlux/pytorch that referenced this pull request Aug 15, 2018
…pytorch#8848)

Summary:
This fixes issue pytorch#8529.

- Adds Katex extension to conf.py and requirements.txt
- Fixes syntax differences in docs
- Should allow documentation pages to render faster
Pull Request resolved: pytorch#8848

Reviewed By: soumith

Differential Revision: D8677702

Pulled By: goodlux

fbshipit-source-id: c4a832c5879e0eebcb14763b35a41663331ba23f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants