-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Conversation
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.
Hi, thank you for this pull request. I've added a few notes and suggestions. Most importantly, the "Classes" entries need some tuning.
lib/docs/scrapers/ember.rb
Outdated
'main' | ||
end | ||
end | ||
options[:container] = 'main' |
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.
Unwrap article for api (for reduced content, and to make various CSS selectors effective, such as ._page > h1:first-child
)
options[:container] = 'main' | |
options[:container] = ->(filter) do | |
if filter.base_url.host.start_with?('api') | |
'main article' | |
else | |
'main' | |
endhost.start_with?('api') | |
end |
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.
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.
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.
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 |
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.
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.
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.
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.
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', |
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.
We normally omit the "copyright (c)" for brevity.
'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 |
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.
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.
Fixed these and moved them into their own type
* fix ember parsing to handle current guides/docs
@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. |
bf64ac2
to
3cd2152
Compare
* better organization of items (put classes at top level) * add both v3 and v2 docs
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.
Awesome, thank you!
If you're updating an existing documentation to it's latest version, please ensure that you have:
about_tmpl.coffee
matches it's data inself.attribution
SOURCE
file inpublic/icons/your_scraper_name/
are up-to-date if the documentation has a custom iconself.links
contains up-to-date urls ifself.links
is defined