Skip to content
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

Split Tensorflow into separate Python and C++ docs #1165

Merged
merged 7 commits into from
Nov 17, 2020

Conversation

lgeiger
Copy link
Contributor

@lgeiger lgeiger commented Jan 25, 2020

@j-f1 Thanks for merging #1144

This PR splits the TensorFlow docs into separate Python, C++ and Guides pages which allows to include docs for TensorFlow versions 2.1, 2.0 and 1.15 so we can start to properly version the TensorFlow docs.

Checklist

If you're updating an existing documentation to it's latest version, please ensure that you have:

  • Updated the versions and releases in the scraper file
  • Ensured the license is up-to-date and that the documentation's entry in the array in about_tmpl.coffee matches it's data in self.attribution
  • Ensured the icons and the SOURCE file in public/icons/your_scraper_name/ are up-to-date if the documentation has a custom icon
  • Ensured self.links contains up-to-date urls if self.links is defined
  • Tested the changes locally to ensure:
    • The scraper still works without errors
    • The scraped documentation still looks consistent with the rest of DevDocs
    • The categorization of entries is still good

@j-f1
Copy link
Contributor

j-f1 commented Feb 10, 2020

It looks like the C++ docs dump everything into a single category. Could you make it more like the Python version, which splits up the entries by category?

@j-f1
Copy link
Contributor

j-f1 commented Feb 10, 2020

Also, it looks like some of the pages in the guide are duplicated. Is it even worth including the guide, since DevDocs doesn’t support full text search.

Copy link
Contributor

@j-f1 j-f1 left a comment

Choose a reason for hiding this comment

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

Finally, can you add '.tfo-notebook-buttons img', '.tfo-notebook-buttons>:first-child' to the list of things to remove in clean_html.rb line 7? This improves the display of the action links, especially in the guide.

@lgeiger
Copy link
Contributor Author

lgeiger commented Feb 25, 2020

Sorry for the long wait.

Finally, can you add '.tfo-notebook-buttons img', '.tfo-notebook-buttons>:first-child' to the list of things to remove in clean_html.rb line 7? This improves the display of the action links, especially in the guide.

👍 I removed the icons and the broken link in 7c51602

Is it even worth including the guide, since DevDocs doesn’t support full text search.

I'd be very happy to remove the guides, I only included them because they were already present. I don't think they add much value and it is not really possible to version them correctly either.

Could you make it more like the Python version, which splits up the entries by category?

I tried to properly structure the C++ docs, but unfortunately the structure cannot be inferred by the slug, and inferring the structure from the navigation sidebar like it was done before doesn't work for me. I haven't worked with Ruby before, so I am not sure how this can be fixed. Since this problem also exists on master I think this should be solved in a future PR.

@lgeiger lgeiger requested a review from j-f1 February 25, 2020 13:49
@j-f1
Copy link
Contributor

j-f1 commented Apr 2, 2020

I unfortunately won’t be able to merge this in the near future because I don’t have great Internet at my house so it can’t really scrape these giant docs but I’ll keep this in mind for whenever I’m somewhere with good internet.

@lgeiger
Copy link
Contributor Author

lgeiger commented Apr 2, 2020

I unfortunately won’t be able to merge this in the near future because I don’t have great Internet at my house so it can’t really scrape these giant docs but I’ll keep this in mind for whenever I’m somewhere with good internet.

No problem, thanks for the heads up. Let me know if there is anything I can help with.

Should I remove the guides as part of this PR? This should also make scraping easier.

@j-f1
Copy link
Contributor

j-f1 commented Apr 2, 2020

Sure! I still had trouble scraping the Python and C++ docs though.

@lgeiger
Copy link
Contributor Author

lgeiger commented Apr 2, 2020

👍 I removed the guides in 0e3cdfd

@j-f1 j-f1 changed the title Split Tensorflow into separate Python, C++ and Guide docs Split Tensorflow into separate Python and C++ docs Jul 17, 2020
Copy link
Contributor

@simon04 simon04 left a comment

Choose a reason for hiding this comment

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

The scraper does not run.

  • SyntaxError: /home/simon/src/devdocs/lib/docs/filters/tensorflow/entries.rb:18: syntax error, unexpected `elsif' elsif slug.start_with?('tf/audio') (easy to fix)
  • index.html does no longer exist → self.root_path = '/tf'
  • HTML::Pipeline::Filter::InvalidDocumentException: HTML::Pipeline::Filter::InvalidDocumentException
    /home/simon/src/devdocs/lib/docs/core/filter.rb:6:in `css'
    /home/simon/src/devdocs/lib/docs/filters/tensorflow/clean_html.rb:7:in `call'
    

I'm happy to review and update the docs once we have a working scraper. In the meanwhile, 2.3 has been released.

@lgeiger
Copy link
Contributor Author

lgeiger commented Nov 15, 2020

@simon04 Thanks for taking a look. I updated the PR to reflect the latest changes on the TF docs website. I wasn't able to check the generated docs yet, but feel free to takeover this PR. I might be able to take a proper look at it next weekend.

@lgeiger lgeiger requested review from simon04 and removed request for a team November 16, 2020 11:39
@simon04 simon04 assigned simon04 and unassigned j-f1 Nov 17, 2020
version '1.15' do
self.release = '1.15.0'
self.base_url = "https://www.tensorflow.org/versions/r#{version}/api_docs/python"
for version in ['2.3', '2.2', '2.1', '2.0', '1.15'] do
Copy link
Contributor

Choose a reason for hiding this comment

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

The statement version '2.3' do … end invokes the method version from lib/docs/core/doc.rb and cannot be replaced by a loop like this. I've fixed this syntax

Copy link
Contributor

@simon04 simon04 left a comment

Choose a reason for hiding this comment

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

Thank you!

@simon04 simon04 merged commit 9ad20cb into freeCodeCamp:master Nov 17, 2020
@lgeiger lgeiger deleted the tensorflow-versions branch November 17, 2020 09:01
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.

3 participants