Update Hammerspoon documentation (0.9.100)

pull/2108/head
Simon Legner 1 year ago
parent 018d09cc6d
commit f536910cb3

@ -3,6 +3,8 @@ module Docs
class CleanHtmlFilter < Filter class CleanHtmlFilter < Filter
def call def call
at_css("#search").parent.remove if at_css("#search")
# Remove script tags for functionality not needed in DevDocs # Remove script tags for functionality not needed in DevDocs
css("script").remove css("script").remove

@ -6,17 +6,15 @@ module Docs
end end
def get_type def get_type
subpath.split("/")[0] slug.split("/").first
end end
def additional_entries def additional_entries
return [] if root_page? return [] if root_page?
entries = [] entries = []
base_name = at_css("h1").content
# add a base entry # add a base entry
entries << [base_name, nil, base_name] entries << [name, nil, name]
css("section").each do |section| css("section").each do |section|
title_node = section.at_css("h5") title_node = section.at_css("h5")
@ -53,7 +51,7 @@ module Docs
# Create a new entry for each method/function # Create a new entry for each method/function
if fn_type != "Unknown" if fn_type != "Unknown"
entries << ["#{base_name}.#{entry_name}", entry_id, base_name] entries << ["#{name}.#{entry_name}", entry_id, name]
end end
end end

@ -6,26 +6,27 @@ module Docs
home: 'https://www.hammerspoon.org', home: 'https://www.hammerspoon.org',
code: 'https://github.com/Hammerspoon/hammerspoon' code: 'https://github.com/Hammerspoon/hammerspoon'
} }
self.base_url = 'https://www.hammerspoon.org/docs/'
self.release = '0.9.100'
html_filters.push 'hammerspoon/clean_html', 'hammerspoon/entries' html_filters.push 'hammerspoon/clean_html', 'hammerspoon/entries'
# links with no content will still render a page, this is an error in the docs # links with no content will still render a page, this is an error in the docs
# (see: https://github.com/Hammerspoon/hammerspoon/pull/3579) # (see: https://github.com/Hammerspoon/hammerspoon/pull/3579)
options[:skip] = ['module.lp/matrix.md'] options[:skip] = ['module.lp/matrix.md']
# Replace '/module.lp/' with '' in URLs options[:skip_patterns] = [
options[:replace_paths] = { 'localhost:12345/module.lp/MATRIX.md' => 'localhost:12345/module.lp/hs.canvas.matrix' } /LuaSkin/,
]
# Hammerspoon docs don't have a license (MIT specified in the hammerspoon repo) # Hammerspoon docs don't have a license (MIT specified in the hammerspoon repo)
# https://github.com/Hammerspoon/hammerspoon/blob/master/LICENSE # https://github.com/Hammerspoon/hammerspoon/blob/master/LICENSE
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
Hammerspoon &copy; 20142017 Hammerspoon contributors<br>
Licensed under the MIT License.
HTML HTML
def get_latest_version(opts)
version '0.9.100' do get_latest_github_release('Hammerspoon', 'hammerspoon', opts)
self.release = '0.9.100'
# add `hs.doc.hsdocs.start()` to your init.lua to enable the docs server
self.base_url = 'http://localhost:12345/'
end end
end end

Loading…
Cancel
Save