kiliman / tailwindui-crawler

tailwindui-crawler downloads the component HTML files locally
MIT License
763 stars 95 forks source link

underscores galore #2

Closed epixian closed 4 years ago

epixian commented 4 years ago

After the latest Tailwind UI components update, the crawler has produced files with a ton of underscores left and right of the template name. A snippet of the output is below.

Processing /components/application-ui/layout/panels...
* Found 10 snippets
Writing ../tailwindui/components/application-ui/layout/panels/_____________basic_card___________.html...
Writing ../tailwindui/components/application-ui/layout/panels/_____________card__edge_to_edge_on_mobile___________.html...
Writing ../tailwindui/components/application-ui/layout/panels/_____________card_with_header___________.html...
Writing ../tailwindui/components/application-ui/layout/panels/_____________card_with_footer___________.html...
Writing ../tailwindui/components/application-ui/layout/panels/_____________card_with_header_and_footer___________.html...
Writing ../tailwindui/components/application-ui/layout/panels/_____________card_with_gray_footer___________.html...
Writing ../tailwindui/components/application-ui/layout/panels/_____________card_with_gray_body___________.html...
Writing ../tailwindui/components/application-ui/layout/panels/_____________well___________.html...
Writing ../tailwindui/components/application-ui/layout/panels/_____________well_on_gray___________.html...
Writing ../tailwindui/components/application-ui/layout/panels/_____________well__edge_to_edge_on_mobile___________.html...

As a result, there's nothing to diff against as the filenames are different.

kiliman commented 4 years ago

Have you installed the latest update v1.1? It strips the leading and trailing spaces. It also adds the tailwind.css file so you can view the component in the browser.

If you just want to remove the excess underscores, then simply update index.js like this:

- const title = $('h3', container).text()
+ const title = $('h3', container).text().trim()
epixian commented 4 years ago

i cloned the latest update, which fixes the issue. also noticed you added an OUTPUT option to the .env - awesome! thanks~