Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

New Html beautifier Goodie #3658

Merged
merged 7 commits into from
Oct 21, 2016
Merged

Conversation

akanshgulati
Copy link
Collaborator

@akanshgulati akanshgulati commented Oct 6, 2016

  • New Instant Answer
    • Other: HTML Beautifier
      What changes does this PR introduce?
      It will reformat the html code to have proper indentation for nested tags making it easier for user to read and debug code.
      People to notify

@tagawa @moollaza


Instant Answer Page: https://duck.co/ia/view/html_beautifier

@daxtheduck
Copy link

daxtheduck commented Oct 6, 2016

HTML Beautifier

Description: HTML beautifier helps user to reformat the html code to have proper indentation of nested tags.

Example Query: [beautify html](https://beta.duckduckgo.com/?q=beautify html), [reformat html](https://beta.duckduckgo.com/?q=reformat html), [cleanup html5 code](https://beta.duckduckgo.com/?q=cleanup html5 code)

Tab Name: Answer

Source:

These are the important fields from the IA page. Please check these for errors or missing information and update the IA page


This is an automated message which will be updated as changes are made to the IA page

@tagawa
Copy link
Collaborator

tagawa commented Oct 7, 2016

Nice work @akanshgulati! This is now on the beta server for testing and looking good: https://beta.duckduckgo.com/?q=beautify+html&ia=answer

@akanshgulati
Copy link
Collaborator Author

@tagawa It has a external library which needs to be uploaded first on DDG host. First, deploy the library there.

$beautifyButton.text('Loading..');

// load the library
$.getScript("https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.4/beautify-html.min.js").done(function(){
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@tagawa This is the library url, I am talking about.

@tagawa
Copy link
Collaborator

tagawa commented Oct 7, 2016

@akanshgulati OK, I think this has to be done by @moollaza, similar to #3640 and #3635

@daxtheduck daxtheduck deployed to beta.duckduckgo.com October 17, 2016 09:45 Active
@tagawa
Copy link
Collaborator

tagawa commented Oct 17, 2016

Thanks for the update @akanshgulati.
@moollaza I think we have to add the library to the backend - is that right?

@moollaza
Copy link
Member

Yup I have an internal PR that adds the libs to DDG.require. I will test it with this IA and then merge both 👍

@daxtheduck daxtheduck deployed to beta.duckduckgo.com October 21, 2016 02:04 Active
@daxtheduck daxtheduck deployed to beta.duckduckgo.com October 21, 2016 14:01 Active
@moollaza
Copy link
Member

@akanshgulati this is now live on beta.

It looks like the beautifier isn't working very well though. It seems to only fix some indentation and doesn't remove empty newlines. Can this be configured further?

beautify_html_at_duckduckgo

@moollaza
Copy link
Member

@akanshgulati it seems to work better when you have <html> -- Either way this is OK for now 👍

@moollaza moollaza merged commit c95afc5 into duckduckgo:master Oct 21, 2016
@moollaza
Copy link
Member

beautify_html_at_duckduckgo

@daxtheduck
Copy link

@akanshgulati this is now merged! It should be live on DuckDuckGo within one week (or during the next release) and we'll be sure to notify you when it happens.

After your Instant Answer goes live for the World to use, you will be able to see traffic information about your IA as well as receive feedback directly from users.

Please refer to the maintenance guide and docs to keep up with potential changes to your Instant Answer.

Thank you again for your help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants