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

update Ember docs to latest version #1483

Merged
merged 2 commits into from
Feb 22, 2021
Merged

Conversation

yads
Copy link
Contributor

@yads yads commented Feb 19, 2021

  • fix ember parsing to handle current guides/docs

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

  • [X ] Updated the versions and releases in the scraper file
  • [X ] 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
  • [ X] Ensured the icons and the SOURCE file in public/icons/your_scraper_name/ are up-to-date if the documentation has a custom icon
  • [ X] Ensured self.links contains up-to-date urls if self.links is defined
  • [X ] 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

@yads yads requested a review from a team as a code owner February 19, 2021 19:02
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.

Hi, thank you for this pull request. I've added a few notes and suggestions. Most importantly, the "Classes" entries need some tuning.

'main'
end
end
options[:container] = 'main'
Copy link
Contributor

Choose a reason for hiding this comment

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

Unwrap article for api (for reduced content, and to make various CSS selectors effective, such as ._page > h1:first-child)

Suggested change
options[:container] = 'main'
options[:container] = ->(filter) do
if filter.base_url.host.start_with?('api')
'main article'
else
'main'
endhost.start_with?('api')
end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue with unwrapping the content, is that not all pages in the Ember guides have an article. I originally wanted to have this be 'main article', but as it turned out not all pages have an article tag. There isn't much of a pattern, but I'll see if I can tune it a bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wound up reversing the original container rule as it works with the new docs better.

if self.type != 'Data' && name.include?('.')
type = "#{self.name.remove(/ \(.*/)}.#{name.split('.').first}"
end
name = heading.at_css('span').content.strip
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the list I get when searching for "checkbox". Only 3 out of x properties are shown. The entries Checkbox (events), . and .() all link to /ember/classes/checkbox/methods.

Screenshot_2021-02-19 Ember js Checkbox — DevDocs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason that this is only listing items that do not have Inherited in one of the documentation fields (it's actually in the line above this one.

next if node.at_css('.github-link').content.include?('Inherited')

I can get rid of that rule if that helps. I'll investigate the weird . and .() entries.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok I fixed the Checkbox. issue, however, it seems like Checkbox.() is a bug with the Ember docs themselves. This entry is missing a name https://api.emberjs.com/ember/3.25/classes/Checkbox/methods?anchor= and is thereby coming out like that. I think I'd rather fix it in the Ember docs themselves than have a special case for this in the scraper.

@@ -273,7 +273,7 @@ credits = [
'https://www.gnu.org/licenses/gpl-3.0.html'
], [
'Ember.js',
'2017 Yehuda Katz, Tom Dale and Ember.js contributors',
'Copyright (c) 2020 Yehuda Katz, Tom Dale and Ember.js contributors',
Copy link
Contributor

Choose a reason for hiding this comment

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

We normally omit the "copyright (c)" for brevity.

Suggested change
'Copyright (c) 2020 Yehuda Katz, Tom Dale and Ember.js contributors',
'2020 Yehuda Katz, Tom Dale and Ember.js contributors',

if self.type != 'Data' && name.include?('.')
type = "#{self.name.remove(/ \(.*/)}.#{name.split('.').first}"
end
name = heading.at_css('span').content.strip
Copy link
Contributor

Choose a reason for hiding this comment

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

Below "Classes", a gazillion non-working "Function" entries is shown:

Screenshot_2021-02-19 Ember js Classes — DevDocs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed these and moved them into their own type

* fix ember parsing to handle current guides/docs
@yads
Copy link
Contributor Author

yads commented Feb 20, 2021

@simon04 I think I've addressed most of the issues you've raised. I've also fixed the broken Packages as the links did not work properly.

@yads yads requested a review from simon04 February 20, 2021 00:57
@yads yads force-pushed the fix-ember-docs branch 2 times, most recently from bf64ac2 to 3cd2152 Compare February 20, 2021 17:11
* better organization of items (put classes at top level)
* add both v3 and v2 docs
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.

Awesome, thank you!

@simon04 simon04 merged commit eca9970 into freeCodeCamp:master Feb 22, 2021
@yads yads deleted the fix-ember-docs branch November 29, 2022 20:41
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.

2 participants