1
0

hammerspoon.rb 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. module Docs
  2. class Hammerspoon < UrlScraper
  3. self.type = 'hammerspoon'
  4. self.root_path = ''
  5. self.links = {
  6. home: 'https://www.hammerspoon.org',
  7. code: 'https://github.com/Hammerspoon/hammerspoon'
  8. }
  9. html_filters.push 'hammerspoon/clean_html', 'hammerspoon/entries'
  10. # links with no content will still render a page, this is an error in the docs
  11. # (see: https://github.com/Hammerspoon/hammerspoon/pull/3579)
  12. options[:skip] = ['module.lp/matrix.md']
  13. # Replace '/module.lp/' with '' in URLs
  14. options[:replace_paths] = { 'localhost:12345/module.lp/MATRIX.md' => 'localhost:12345/module.lp/hs.canvas.matrix' }
  15. # Hammerspoon docs don't have a license (MIT specified in the hammerspoon repo)
  16. # https://github.com/Hammerspoon/hammerspoon/blob/master/LICENSE
  17. options[:attribution] = <<-HTML
  18. Hammerspoon
  19. HTML
  20. version '0.9.100' do
  21. self.release = '0.9.100'
  22. # add `hs.doc.hsdocs.start()` to your init.lua to enable the docs server
  23. self.base_url = 'http://localhost:12345/'
  24. end
  25. end
  26. end