Unified · Split
| @@ -13,7 +13,7 @@ jobs: · 12 unmodified lines | ||
| 13 | 13 | steps: |
| 14 | 14 | - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 |
| 15 | 15 | - name: Set up Ruby |
| 16 | − uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.0 | |
| 16 | + uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0 | |
| 17 | 17 | with: |
| 18 | 18 | bundler-cache: true # runs 'bundle install' and caches installed gems automatically |
| 19 | 19 | - name: Run tests |
| @@ -11,7 +11,7 @@ jobs: · 10 unmodified lines | ||
| 11 | 11 | steps: |
| 12 | 12 | - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 |
| 13 | 13 | - name: Set up Ruby |
| 14 | − uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.0 | |
| 14 | + uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0 | |
| 15 | 15 | with: |
| 16 | 16 | bundler-cache: true # runs 'bundle install' and caches installed gems automatically |
| 17 | 17 | - name: Generate report |
| @@ -11,7 +11,7 @@ jobs: · 10 unmodified lines | ||
| 11 | 11 | steps: |
| 12 | 12 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 13 | 13 | - name: Set up Ruby |
| 14 | − uses: ruby/setup-ruby@13e7a03dc3ac6c3798f4570bfead2aed4d96abfb # v1.244.0 | |
| 14 | + uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0 | |
| 15 | 15 | with: |
| 16 | 16 | bundler-cache: true # runs 'bundle install' and caches installed gems automatically |
| 17 | 17 | - name: Run tests |
| @@ -78,7 +78,7 @@ GEM · 77 unmodified lines | ||
| 78 | 78 | byebug (~> 12.0) |
| 79 | 79 | pry (>= 0.13, < 0.16) |
| 80 | 80 | racc (1.8.1) |
| 81 | − rack (2.2.16) | |
| 81 | + rack (2.2.17) | |
| 82 | 82 | rack-protection (3.2.0) |
| 83 | 83 | base64 (>= 0.1.0) |
| 84 | 84 | rack (~> 2.2, >= 2.2.4) |
| @@ -130,7 +130,7 @@ GEM · 45 unmodified lines | ||
| 130 | 130 | strings-ansi (0.2.0) |
| 131 | 131 | terminal-table (3.0.2) |
| 132 | 132 | unicode-display_width (>= 1.1.1, < 3) |
| 133 | − terser (1.2.5) | |
| 133 | + terser (1.2.6) | |
| 134 | 134 | execjs (>= 0.3.0, < 3) |
| 135 | 135 | thin (1.8.2) |
| 136 | 136 | daemons (~> 1.0, >= 1.0.9) |
| @@ -3,6 +3,10 @@ · 2 unmodified lines | ||
| 3 | 3 | "2025-06-27", |
| 4 | 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 | 11 | "2025-05-28", |
| 8 | 12 | "New documentation: <a href=\"/vertx/\">Vert.x</a>" |
| @@ -59,6 +59,12 @@ curl -L https://github.com/erlang/otp/releases/download/OTP-$RELEASE/otp_doc_htm · 58 unmodified lines | ||
| 59 | 59 | bsdtar --extract --file - --directory=docs/erlang\~$VERSION/ |
| 60 | 60 | ``` |
| 61 | 61 | |
| 62 | +## es-toolkit | |
| 63 | + | |
| 64 | +```sh | |
| 65 | +git clone https://github.com/toss/es-toolkit docs/es_toolkit | |
| 66 | +``` | |
| 67 | + | |
| 62 | 68 | ## Gnu |
| 63 | 69 | |
| 64 | 70 | ### Bash |
| @@ -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 | + © 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 | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://es-toolkit.slash.page/favicon-100x100.png | |