https://prettier.io/
Unified · Split
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | [ |
| 2 | 2 | [ |
| 3 | 3 | "2021-12-07", |
| 4 | + "New documentation: <a href=\"/prettier/\">Prettier</a>", | |
| 4 | 5 | "Renamed documentation: <a href=\"/dom/\">Web APIs</a>" |
| 5 | 6 | ], |
| 6 | 7 | [ |
| @@ -666,6 +666,11 @@ credits = [ · 665 unmodified lines | ||
| 666 | 666 | '1996-2021 The PostgreSQL Global Development Group<br>© 1994 The Regents of the University of California', |
| 667 | 667 | 'PostgreSQL', |
| 668 | 668 | 'https://www.postgresql.org/about/licence/' |
| 669 | + ], [ | |
| 670 | + 'Prettier', | |
| 671 | + 'James Long and contributors', | |
| 672 | + 'MIT', | |
| 673 | + 'https://raw.githubusercontent.com/prettier/prettier/main/LICENSE ' | |
| 669 | 674 | ], [ |
| 670 | 675 | 'Puppeteer', |
| 671 | 676 | '2021 Google Inc', |
| @@ -0,0 +1,27 @@ | ||
| 1 | +module Docs | |
| 2 | + class Prettier | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + def get_name | |
| 5 | + at_css('h1').children.select(&:text?).map(&:content).join.strip | |
| 6 | + end | |
| 7 | + | |
| 8 | + def type | |
| 9 | + link = at_css('.navListItemActive') | |
| 10 | + section = link.ancestors('.navGroup').first | |
| 11 | + type = section.at_css('h3').content.strip | |
| 12 | + return name if type == 'Configuring Prettier' | |
| 13 | + return name if type == 'Usage' | |
| 14 | + type | |
| 15 | + end | |
| 16 | + | |
| 17 | + def additional_entries | |
| 18 | + entries = [] | |
| 19 | + css('.mainContainer h2').each do |node| | |
| 20 | + id = node.at_css('.anchor')['id'] | |
| 21 | + entries << [node.text, id] | |
| 22 | + end | |
| 23 | + entries | |
| 24 | + end | |
| 25 | + end | |
| 26 | + end | |
| 27 | +end | |
| @@ -0,0 +1,25 @@ | ||
| 1 | +module Docs | |
| 2 | + class Prettier < UrlScraper | |
| 3 | + self.name = 'Prettier' | |
| 4 | + self.type = 'simple' | |
| 5 | + self.release = '2.5.1' | |
| 6 | + self.base_url = 'https://prettier.io/docs/en/' | |
| 7 | + self.links = { | |
| 8 | + home: 'https://prettier.io/', | |
| 9 | + code: 'https://github.com/prettier/prettier' | |
| 10 | + } | |
| 11 | + | |
| 12 | + # Docusaurus like react_native | |
| 13 | + html_filters.push 'prettier/entries', 'react_native/clean_html' | |
| 14 | + | |
| 15 | + options[:container] = '.docMainWrapper' | |
| 16 | + | |
| 17 | + options[:attribution] = <<-HTML | |
| 18 | + © James Long and contributors | |
| 19 | + HTML | |
| 20 | + | |
| 21 | + def get_latest_version(opts) | |
| 22 | + get_npm_version('prettier', opts) | |
| 23 | + end | |
| 24 | + end | |
| 25 | +end | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://prettier.io/icon.png | |