History

Merge remote-tracking branch 'origin/main' into zsh

Simon Legner committed 1 year ago

Commit 4fb53e12 parents b29a3c8 11f107210 files · +102 −3Browse files

Unified · Split

10 files
  1. .github/workflows/build.yml +1 −1
  2. .github/workflows/schedule-doc-report.yml +1 −1
  3. .github/workflows/test.yml +1 −1
  4. Gemfile.lock +2 −2
  5. assets/javascripts/news.json +4 −0
  6. docs/file-scrapers.md +6 −0
  7. lib/docs/scrapers/es_toolkit.rb +88 −0
  8. public/icons/docs/es_toolkit/16.png +0 −0
  9. public/icons/docs/es_toolkit/16@2x.png +0 −0
  10. public/icons/docs/es_toolkit/SOURCE +1 −0
.github/workflows/build.yml+1−1
@@ -13,7 +13,7 @@ jobs: · 12 unmodified lines
1313 steps:
1414 - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
1515 - name: Set up Ruby
16− uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.0
16+ uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
1717 with:
1818 bundler-cache: true # runs 'bundle install' and caches installed gems automatically
1919 - name: Run tests
.github/workflows/schedule-doc-report.yml+1−1
@@ -11,7 +11,7 @@ jobs: · 10 unmodified lines
1111 steps:
1212 - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
1313 - name: Set up Ruby
14− uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.0
14+ uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
1515 with:
1616 bundler-cache: true # runs 'bundle install' and caches installed gems automatically
1717 - name: Generate report
.github/workflows/test.yml+1−1
@@ -11,7 +11,7 @@ jobs: · 10 unmodified lines
1111 steps:
1212 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1313 - name: Set up Ruby
14− uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.0
14+ uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
1515 with:
1616 bundler-cache: true # runs 'bundle install' and caches installed gems automatically
1717 - name: Run tests
Gemfile.lock+2−2
@@ -78,7 +78,7 @@ GEM · 77 unmodified lines
7878 byebug (~> 12.0)
7979 pry (>= 0.13, < 0.16)
8080 racc (1.8.1)
81− rack (2.2.16)
81+ rack (2.2.17)
8282 rack-protection (3.2.0)
8383 base64 (>= 0.1.0)
8484 rack (~> 2.2, >= 2.2.4)
@@ -130,7 +130,7 @@ GEM · 45 unmodified lines
130130 strings-ansi (0.2.0)
131131 terminal-table (3.0.2)
132132 unicode-display_width (>= 1.1.1, < 3)
133− terser (1.2.5)
133+ terser (1.2.6)
134134 execjs (>= 0.3.0, < 3)
135135 thin (1.8.2)
136136 daemons (~> 1.0, >= 1.0.9)
assets/javascripts/news.json+4−0
@@ -3,6 +3,10 @@ · 2 unmodified lines
33 "2025-06-27",
44 "New documentation: <a href=\"/zsh/\">Zsh</a>"
55 ],
6+ [
7+ "2025-06-04",
8+ "New documentation: <a href=\"/es_toolkit/\">es-toolkit</a>"
9+ ],
610 [
711 "2025-05-28",
812 "New documentation: <a href=\"/vertx/\">Vert.x</a>"
docs/file-scrapers.md+6−0
@@ -59,6 +59,12 @@ curl -L https://github.com/erlang/otp/releases/download/OTP-$RELEASE/otp_doc_htm · 58 unmodified lines
5959 bsdtar --extract --file - --directory=docs/erlang\~$VERSION/
6060 ```
6161
62+## es-toolkit
63+
64+```sh
65+git clone https://github.com/toss/es-toolkit docs/es_toolkit
66+```
67+
6268 ## Gnu
6369
6470 ### Bash
lib/docs/scrapers/es_toolkit.rb+88−0
@@ -0,0 +1,88 @@
1+module Docs
2+ class EsToolkit < FileScraper
3+ self.name = "es-toolkit"
4+ self.slug = "es_toolkit"
5+ self.type = "simple"
6+ self.links = {
7+ code: "https://github.com/toss/es-toolkit",
8+ home: "https://es-toolkit.slash.page",
9+ }
10+
11+ options[:attribution] = <<-HTML
12+ &copy; 2024-2025, Viva Republica<br>
13+ Licensed under the MIT License.
14+ HTML
15+
16+ def get_latest_version(opts)
17+ get_github_tags("toss", "es-toolkit", opts).first["name"]
18+ end
19+
20+ def build_pages(&block)
21+ internal("docs/intro.md", path: "index", &block)
22+ Dir.chdir(source_directory) do
23+ Dir["docs/reference/**/*.md"]
24+ end.each { internal(_1, &block) }
25+ end
26+
27+ protected
28+
29+ def internal(filename, path: nil, &block)
30+ path ||= filename[%r{docs/reference/(.*/.*).md$}, 1]
31+
32+ # calculate name/type
33+ if path != "index"
34+ name = filename[%r{([^/]+).md$}, 1]
35+ type = path.split("/")[0..-2]
36+ type = type.map(&:capitalize).join(" ")
37+ # really bad way to sort
38+ type = type.gsub(/^(Compat|Error)\b/, "\u2063\\1") # U+2063 INVISIBLE SEPARATOR
39+ else
40+ name = type = nil
41+ end
42+
43+ # now yield
44+ entries = [Entry.new(name, path, type)]
45+ output = render(filename)
46+ store_path = "#{path}.html"
47+ yield({entries:, output:, path:, store_path:})
48+ end
49+
50+ # render/style HTML
51+ def render(filename)
52+ s = md.render(request_one(filename).body)
53+
54+ # kill all links, they don't work
55+ s.gsub!(%r{<a href="[^"]+">(.*?)</a>}, "<span>\\1</span>")
56+
57+ # syntax highlighting
58+ s.gsub!(%r{<pre><code class="typescript">}, "<pre data-language='typescript'><code class='typescript'>")
59+
60+ # h3 => h4
61+ s.gsub!(%r{(</?h)3>}, "\\14>")
62+
63+ # manually add attribution
64+ link = "#{self.class.links[:home]}#{filename.gsub(/^docs/,'').gsub(/md$/,'html')}"
65+ s += <<~HTML
66+ <div class="_attribution">
67+ <p class="_attribution-p">
68+ #{options[:attribution]}
69+ <br>
70+ <a href="#{link}" class="_attribution-link">
71+ #{link}
72+ </a>
73+ </p>
74+ </div>
75+ HTML
76+ s
77+ end
78+
79+ def md
80+ @md ||= Redcarpet::Markdown.new(
81+ Redcarpet::Render::HTML,
82+ autolink: true,
83+ fenced_code_blocks: true,
84+ tables: true
85+ )
86+ end
87+ end
88+end
public/icons/docs/es_toolkit/16.png+0−0

Binary file not shown.

public/icons/docs/es_toolkit/16@2x.png+0−0

Binary file not shown.

public/icons/docs/es_toolkit/SOURCE+1−0
@@ -0,0 +1 @@
1+https://es-toolkit.slash.page/favicon-100x100.png