dartdoc
dartdoc copied to clipboard
Dartdoc Search
Description
- style.css: changes include a new look for the search box, how the search results are seen in the dropdown list
- generator_utils.dart: includes a one line description that is used in the new search results
- search_results_page.html and search_results_page.md: new templates for the search page results where the results are displayed dynamically.
- templates.dart, validator.dart, html_generator.dart and markdown_generator.dart: changes done are to include the new search page when building docs
- search.dart: - categories: This function takes the search suggestion in HTML form that is going to be displayed and the library it belongs to. It takes the two inputs and inserts it in a map type Map<String, Element>, if the Map does not contain the key it adds simply adds the library as key and the value of the first suggestion. - createCategory: This function takes input, in this case the library name and makes the necessary calls to create a HTML element. - iterateCategoriesMap: This function iterates through the categoriesMap to added it to given HTML element. It adds the value in the map to the given html element. - searchPageResults: This function is used when the press key enter is pressed and is directed to the search_results_page. It adds some html and uses the iterateCategoriesMap to display all the research found. -key enter code: Now if the key enter is pressed and there is no element selected it navigates to the search results page. Since not all the docs pages have base href it looks for a specific value in the HTML to navigate to the right path.
Consider adding an entry to CHANGELOG.md
, too!
For #3037
@srawlins the screenshots for search:
search.html
Search list with more than 10 results for "string"
Search page results for "string"
Search list with less than 10 results for library
Search results for groupings for "has"
Search page results with groupings for "has"
No results page
Search with less than 800 screen size
Search list with less than 800 screen size
Search results page with less than 800 screen size
🎉 Thank you for thinking of good screenshots that I totally missed (like "no results")!
No changes! Screenshots look great! LGTM!
🎉