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
13 steps:13 steps:
14 - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.014 - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
15 - name: Set up Ruby15 - name: Set up Ruby
16 uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.016 uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
17 with:17 with:
18 bundler-cache: true # runs 'bundle install' and caches installed gems automatically18 bundler-cache: true # runs 'bundle install' and caches installed gems automatically
19 - name: Run tests19 - name: Run tests
.github/workflows/schedule-doc-report.yml+1−1
@@ -11,7 +11,7 @@ jobs: · 10 unmodified lines
11 steps:11 steps:
12 - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.012 - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
13 - name: Set up Ruby13 - name: Set up Ruby
14 uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.014 uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
15 with:15 with:
16 bundler-cache: true # runs 'bundle install' and caches installed gems automatically16 bundler-cache: true # runs 'bundle install' and caches installed gems automatically
17 - name: Generate report17 - name: Generate report
.github/workflows/test.yml+1−1
@@ -11,7 +11,7 @@ jobs: · 10 unmodified lines
11 steps:11 steps:
12 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.212 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
13 - name: Set up Ruby13 - name: Set up Ruby
14 uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.014 uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
15 with:15 with:
16 bundler-cache: true # runs 'bundle install' and caches installed gems automatically16 bundler-cache: true # runs 'bundle install' and caches installed gems automatically
17 - name: Run tests17 - name: Run tests
Gemfile.lock+2−2
@@ -78,7 +78,7 @@ GEM · 77 unmodified lines
78 byebug (~> 12.0)78 byebug (~> 12.0)
79 pry (>= 0.13, < 0.16)79 pry (>= 0.13, < 0.16)
80 racc (1.8.1)80 racc (1.8.1)
81 rack (2.2.16)81 rack (2.2.17)
82 rack-protection (3.2.0)82 rack-protection (3.2.0)
83 base64 (>= 0.1.0)83 base64 (>= 0.1.0)
84 rack (~> 2.2, >= 2.2.4)84 rack (~> 2.2, >= 2.2.4)
@@ -130,7 +130,7 @@ GEM · 45 unmodified lines
130 strings-ansi (0.2.0)130 strings-ansi (0.2.0)
131 terminal-table (3.0.2)131 terminal-table (3.0.2)
132 unicode-display_width (>= 1.1.1, < 3)132 unicode-display_width (>= 1.1.1, < 3)
133 terser (1.2.5)133 terser (1.2.6)
134 execjs (>= 0.3.0, < 3)134 execjs (>= 0.3.0, < 3)
135 thin (1.8.2)135 thin (1.8.2)
136 daemons (~> 1.0, >= 1.0.9)136 daemons (~> 1.0, >= 1.0.9)
assets/javascripts/news.json+4−0
@@ -3,6 +3,10 @@ · 2 unmodified lines
3 "2025-06-27",3 "2025-06-27",
4 "New documentation: <a href=\"/zsh/\">Zsh</a>"4 "New documentation: <a href=\"/zsh/\">Zsh</a>"
5 ],5 ],
6 [
7 "2025-06-04",
8 "New documentation: <a href=\"/es_toolkit/\">es-toolkit</a>"
9 ],
6 [10 [
7 "2025-05-28",11 "2025-05-28",
8 "New documentation: <a href=\"/vertx/\">Vert.x</a>"12 "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
59bsdtar --extract --file - --directory=docs/erlang\~$VERSION/59bsdtar --extract --file - --directory=docs/erlang\~$VERSION/
60```60```
61 61
62## es-toolkit
63
64```sh
65git clone https://github.com/toss/es-toolkit docs/es_toolkit
66```
67
62## Gnu68## Gnu
63 69
64### Bash70### Bash
lib/docs/scrapers/es_toolkit.rb+88−0
@@ -0,0 +1,88 @@
1module 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
88end
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 @@
1https://es-toolkit.slash.page/favicon-100x100.png