Skip to content

Adding Official Url for url scrapped documentations - #170

Merged
Thibaut merged 8 commits into
freeCodeCamp:masterfrom
TrangPham:master
Mar 14, 2015
Merged

Thibaut merged 8 commits into
freeCodeCamp:masterfrom
TrangPham:master

Conversation

@TrangPham

Copy link
Copy Markdown
Contributor

Closes #19

This is my first attempt at this. To be honest I only have a slight understanding of what it going on here. Also the styles may need to be changed. @Thibaut Feel free to pick this apart.

@Thibaut

Thibaut commented Mar 1, 2015

Copy link
Copy Markdown
Member

Thanks for your contribution. I think we should use a new attribute (home_url) instead of base_url, which isn't always a valid URL, and the box should go at the top instead of the bottom.

@TrangPham

Copy link
Copy Markdown
Contributor Author

@Thibaut Thanks :)

I think I've already made the box go at the top.

class OfficialUrlFilter < Filter
    def call
      official_url_html << html if base_url
    end

https://github.com/TrangPham/devdocs/blob/master/lib/docs/filters/core/official_url.rb#L4
I'm appending the rest of the html to the html of the official_url_html.

Should I rename official_url file to home_url too?

@Thibaut

Thibaut commented Mar 1, 2015

Copy link
Copy Markdown
Member

I think I've already made the box go at the top.

You're right. I read the code wrong.

Should I rename official_url file to home_url too?

👍

Comment thread lib/docs/filters/core/official_url.rb Outdated

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@TrangPham

Copy link
Copy Markdown
Contributor Author

After renaming to home_url - should I be manually adding the urls into each doc's scrapper?
Also is there a format that the urls should be following?
Should the css class names be changed from _official and _official-link to home?

@Thibaut

Thibaut commented Mar 1, 2015

Copy link
Copy Markdown
Member

After renaming to home_url - should I be manually adding the urls into each doc's scrapper?

I'll add those progressively when I update each doc.

Also is there a format that the urls should be following?

Not sure what you mean. The link should go to the project's homepage.

Should the css class names be changed from _official and _official-link to home?

👍

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@Thibaut
Thibaut force-pushed the master branch 2 times, most recently from 0f420cc to 34d0d50 Compare March 1, 2015 23:54
@TrangPham

Copy link
Copy Markdown
Contributor Author

I think _home-link is already being used as a css class. Should I leave the _official and _official-link css class named as there are?

@TrangPham

Copy link
Copy Markdown
Contributor Author

I'm looking through the test failures right now, and will be adding some test cases for home_url.

Do you want home_url to ever be able to be blank? Since you'll be adding them in gradually? Because as I have it now, it will cause URI::InvalidURIError: bad URI(is not URI?): when home_url is blank.

@Thibaut

Thibaut commented Mar 3, 2015

Copy link
Copy Markdown
Member

Should I leave the _official and _official-link css class named as there are?

👍

Do you want home_url to ever be able to be blank? Since you'll be adding them in gradually?

Yes. It should be blank for all docs in this PR.

@TrangPham

Copy link
Copy Markdown
Contributor Author

@Thibaut I think this is ready for review - are there other places which I should add more tests to?

Comment thread lib/docs/core/scraper.rb Outdated

This comment was marked as off-topic.

@Thibaut

Thibaut commented Mar 4, 2015

Copy link
Copy Markdown
Member

I'll merge this this week-end.

@TrangPham

Copy link
Copy Markdown
Contributor Author

@Thibaut Changes made.

And thanks so much for helping me with this PR! I thought it would be easier than it was. I still don't completely understand the mechanics of how devdocs works.

@Thibaut

Thibaut commented Mar 9, 2015

Copy link
Copy Markdown
Member

Didn't do much work on DevDocs this week-end. This will have to wait another week :P

Thibaut added a commit that referenced this pull request Mar 14, 2015
Adding Official Url for url scrapped documentations
@Thibaut
Thibaut merged commit 4b9256a into freeCodeCamp:master Mar 14, 2015
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.

Add links to the official website on each documentation's root page

2 participants