Unified · Split
| @@ -1,4 +1,8 @@ | ||
| 1 | 1 | [ |
| 2 | + [ | |
| 3 | + "2024-01-20", | |
| 4 | + "New documentation: <a href=\"/htmx/\">htmx</a>" | |
| 5 | + ], | |
| 2 | 6 | [ |
| 3 | 7 | "2024-01-12", |
| 4 | 8 | "New documentation: <a href=\"/hammerspoon/\">Hammerspoon</a>" |
| @@ -0,0 +1,13 @@ | ||
| 1 | +module Docs | |
| 2 | + class Htmx | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + css('.zola-anchor').remove | |
| 6 | + doc.prepend_child("<h1>htmx</h1>") if root_page? | |
| 7 | + css('div:contains("NEWS:")').remove | |
| 8 | + css('h2:contains("sponsors"), #sponsor-table').remove | |
| 9 | + doc | |
| 10 | + end | |
| 11 | + end | |
| 12 | + end | |
| 13 | +end | |
| @@ -0,0 +1,31 @@ | ||
| 1 | +module Docs | |
| 2 | + class Htmx | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + def get_name | |
| 5 | + at_css('h1').content | |
| 6 | + end | |
| 7 | + | |
| 8 | + def get_type | |
| 9 | + if slug.start_with?('attributes') | |
| 10 | + 'Attributes' | |
| 11 | + elsif slug.start_with?('headers') | |
| 12 | + 'Headers' | |
| 13 | + elsif slug.start_with?('events') | |
| 14 | + 'Events' | |
| 15 | + elsif slug.start_with?('extensions') | |
| 16 | + 'Extensions' | |
| 17 | + else | |
| 18 | + get_name | |
| 19 | + end | |
| 20 | + end | |
| 21 | + | |
| 22 | + def additional_entries | |
| 23 | + css('h3[id]:has(code)').each_with_object [] do |node, entries| | |
| 24 | + name = node.at_css('code').content | |
| 25 | + id = node['id'] | |
| 26 | + entries << [name, id] | |
| 27 | + end | |
| 28 | + end | |
| 29 | + end | |
| 30 | + end | |
| 31 | +end | |
| @@ -0,0 +1,35 @@ | ||
| 1 | +module Docs | |
| 2 | + class Htmx < UrlScraper | |
| 3 | + self.name = 'htmx' | |
| 4 | + self.type = 'simple' | |
| 5 | + self.slug = 'htmx' | |
| 6 | + self.links = { | |
| 7 | + home: 'https://htmx.org/', | |
| 8 | + code: 'https://github.com/bigskysoftware/htmx' | |
| 9 | + } | |
| 10 | + self.release = '1.9.10' | |
| 11 | + self.base_url = "https://htmx.org/" | |
| 12 | + self.initial_paths = %w(reference/) | |
| 13 | + | |
| 14 | + html_filters.push 'htmx/entries', 'htmx/clean_html' | |
| 15 | + | |
| 16 | + options[:trailing_slash] = true | |
| 17 | + options[:container] = '.content' | |
| 18 | + options[:download_images] = false | |
| 19 | + options[:skip_patterns] = [ | |
| 20 | + /\Aessays/, | |
| 21 | + /\Aexamples/, | |
| 22 | + /\Amigration-guide/, | |
| 23 | + /\Aposts/, | |
| 24 | + ] | |
| 25 | + | |
| 26 | + # https://github.com/bigskysoftware/htmx/blob/master/LICENSE | |
| 27 | + options[:attribution] = <<-HTML | |
| 28 | + Licensed under the Zero-Clause BSD | |
| 29 | + HTML | |
| 30 | + | |
| 31 | + def get_latest_version(opts) | |
| 32 | + get_npm_version('htmx.org', opts) | |
| 33 | + end | |
| 34 | + end | |
| 35 | +end | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://github.com/bigskysoftware/htmx/blob/v1.9.10/www/static/img/htmx_logo.2.png | |