Skip to content

Commit

Permalink
Merge branch 'main' into Yton
Browse files Browse the repository at this point in the history
  • Loading branch information
YenTonv authored Feb 20, 2024
2 parents a1d4f87 + 68cf0a8 commit 4c75920
Show file tree
Hide file tree
Showing 35 changed files with 1,118 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Set up Ruby
uses: ruby/setup-ruby@360dc864d5da99d54fcb8e9148c14a84b90d3e88 # v1.165.1
uses: ruby/setup-ruby@22fdc77bf4148f810455b226c90fb81b5cbc00a7 # v1.171.0
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/schedule-doc-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Set up Ruby
uses: ruby/setup-ruby@360dc864d5da99d54fcb8e9148c14a84b90d3e88 # v1.165.1
uses: ruby/setup-ruby@22fdc77bf4148f810455b226c90fb81b5cbc00a7 # v1.171.0
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Generate report
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Ruby
uses: ruby/setup-ruby@360dc864d5da99d54fcb8e9148c14a84b90d3e88 # v1.165.1
uses: ruby/setup-ruby@22fdc77bf4148f810455b226c90fb81b5cbc00a7 # v1.171.0
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
Expand Down
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (7.1.2)
activesupport (7.1.3)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
Expand All @@ -16,12 +16,12 @@ GEM
erubi (>= 1.0.0)
rack (>= 0.9.0)
rouge (>= 1.0.0)
bigdecimal (3.1.5)
bigdecimal (3.1.6)
browser (5.3.1)
byebug (11.1.3)
chunky_png (1.4.0)
coderay (1.1.3)
concurrent-ruby (1.2.2)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
daemons (1.4.1)
drb (2.2.0)
Expand All @@ -30,7 +30,7 @@ GEM
ethon (0.16.0)
ffi (>= 1.15.0)
eventmachine (1.2.7)
execjs (2.8.1)
execjs (2.9.1)
exifr (1.4.0)
ffi (1.15.5)
fspath (3.1.2)
Expand All @@ -53,7 +53,7 @@ GEM
in_threads (1.6.0)
method_source (1.0.0)
mini_portile2 (2.8.5)
minitest (5.21.1)
minitest (5.22.2)
multi_json (1.15.0)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
Expand All @@ -62,7 +62,7 @@ GEM
net-ssh (>= 5.0.0, < 8.0.0)
net-ssh (7.0.1)
newrelic_rpm (8.16.0)
nokogiri (1.16.0)
nokogiri (1.16.2)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
options (2.3.2)
Expand Down Expand Up @@ -125,7 +125,7 @@ GEM
strings-ansi (0.2.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
terser (1.1.20)
terser (1.2.0)
execjs (>= 0.3.0, < 3)
thin (1.8.2)
daemons (~> 1.0, >= 1.0.9)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ Made something cool? Feel free to open a PR to add a new row to this table! You
| [waiting-for-dev/vim-www](https://github.com/waiting-for-dev/vim-www) | Vim plugin | ![Latest GitHub commit](https://img.shields.io/github/last-commit/waiting-for-dev/vim-www?logo=github&label) | ![GitHub stars](https://img.shields.io/github/stars/waiting-for-dev/vim-www?logo=github&label) |
| [luckasRanarison/nvim-devdocs](https://github.com/luckasRanarison/nvim-devdocs) | Neovim plugin | ![Latest GitHub commit](https://img.shields.io/github/last-commit/luckasRanarison/nvim-devdocs?logo=github&label) | ![GitHub stars](https://img.shields.io/github/stars/luckasRanarison/nvim-devdocs?logo=github&label) |
| [toiletbril/dedoc](https://github.com/toiletbril/dedoc) | Terminal based viewer | ![Latest GitHub commit](https://img.shields.io/github/last-commit/toiletbril/dedoc?logo=github&label) | ![GitHub stars](https://img.shields.io/github/stars/toiletbril/dedoc?logo=github&label) |
| [Raycast Devdocs](https://www.raycast.com/pomdtr/devdocs) | Raycast extension | Unavailable | Unavailable |

## Copyright / License

Expand Down
10 changes: 9 additions & 1 deletion assets/javascripts/news.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
[
[
"2024-01-24",
"2024-02-20",
"New documentation: <a href=\"/nextjs/\">Nextjs</a>"
],
[
"2024-01-24",
"New documentation: <a href=\"/playwright/\">Playwright</a>"
],
[
"2024-01-20",
"New documentation: <a href=\"/htmx/\">htmx</a>"
],
[
"2024-01-12",
"New documentation: <a href=\"/hammerspoon/\">Hammerspoon</a>"
Expand Down
4 changes: 2 additions & 2 deletions docs/file-scrapers.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ download it, extract it with `dpkg -x $PACKAGE ./` and move `./usr/share/doc/ope
to `path/to/devdocs/docs/openjdk~$VERSION`

```sh
curl -O http://ftp.at.debian.org/debian/pool/main/o/openjdk-21/openjdk-21-doc_21.0.1+12-3_all.deb
tar xf openjdk-21-doc_21.0.1+12-3_all.deb
curl -O http://ftp.at.debian.org/debian/pool/main/o/openjdk-21/openjdk-21-doc_21.0.2+13-2_all.deb
tar xf openjdk-21-doc_21.0.2+13-2_all.deb
tar xf data.tar.xz
mv ./usr/share/doc/openjdk-21-jre-headless/api/ docs/openjdk~$VERSION
```
Expand Down
13 changes: 13 additions & 0 deletions lib/docs/filters/htmx/clean_html.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Docs
class Htmx
class CleanHtmlFilter < Filter
def call
css('.zola-anchor').remove
doc.prepend_child("<h1>htmx</h1>") if root_page?
css('div:contains("NEWS:")').remove
css('h2:contains("sponsors"), #sponsor-table').remove
doc
end
end
end
end
31 changes: 31 additions & 0 deletions lib/docs/filters/htmx/entries.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module Docs
class Htmx
class EntriesFilter < Docs::EntriesFilter
def get_name
at_css('h1').content
end

def get_type
if slug.start_with?('attributes')
'Attributes'
elsif slug.start_with?('headers')
'Headers'
elsif slug.start_with?('events')
'Events'
elsif slug.start_with?('extensions')
'Extensions'
else
get_name
end
end

def additional_entries
css('h3[id]:has(code)').each_with_object [] do |node, entries|
name = node.at_css('code').content
id = node['id']
entries << [name, id]
end
end
end
end
end
11 changes: 7 additions & 4 deletions lib/docs/filters/nim/entries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ def get_name
name.remove! ' User Guide'
name.remove! ' User\'s manual'
name.remove! %r{ \-.*}
name.remove! %r{\Asrc/}
name.remove! %r{\Astd/}
name.strip!
name
name.split("/").last
end

def get_type
Expand Down Expand Up @@ -54,10 +56,11 @@ def additional_entries
else

css('.simple-toc-section a, .nested-toc-section a').each do |node|
entry_name = node.content
entry_name.gsub!(/,.*/, '')
match = /^`(.*)`|^(\w+)/.match(node.content)
entry_name = match[1] || match[2]

entry_id = slug + node['href']
entries << [entry_name, entry_id, name]
entries << ["#{entry_name} (#{name})", entry_id, name]
end

end
Expand Down
1 change: 1 addition & 0 deletions lib/docs/filters/openjdk/clean_html_new.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def call
end

css('.header .sub-title', 'hr', '.table-tabs').remove
css('.copy').remove

# fix ul section that contains summaries or tables
css('ul').each do |node|
Expand Down
29 changes: 29 additions & 0 deletions lib/docs/filters/playwright/clean_html.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module Docs
class Playwright
class CleanHtmlFilter < Filter
def call
@doc = at_css('.markdown')

css('x-search').remove
css('hr').remove
css('font:contains("Added in")').remove
css('.list-anchor').remove

css('.alert').each do |node|
node.name = 'blockquote'
end

css('pre').each do |node|
node.content = node.css('.token-line').map(&:content).join("\n")
node.remove_attribute('style')
node['data-language'] = node.content =~ /\A\s*</ ? 'html' : 'javascript'
node.ancestors('.theme-code-block').first.replace(node)
end

css('*[class]').remove_attribute('class')

doc
end
end
end
end
23 changes: 23 additions & 0 deletions lib/docs/filters/playwright/entries.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module Docs
class Playwright
class EntriesFilter < Docs::EntriesFilter
def get_name
at_css('h1').children.select(&:text?).map(&:content).join.strip
end

def type
type = at_css('.menu__link--active').content
return "#{type}: #{name}" if slug.starts_with?('api/')
type
end

def additional_entries
css('x-search').each_with_object [] do |node, entries|
prev = node.previous_element
prev = prev.previous_element until prev['id']
entries << [node.text, prev['id']]
end
end
end
end
end
Loading

0 comments on commit 4c75920

Please sign in to comment.