love.rb 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. module Docs
  2. class Love < UrlScraper
  3. self.name = 'LÖVE'
  4. self.slug = 'love'
  5. self.type = 'love'
  6. self.release = '11.3'
  7. self.base_url = 'https://love2d.org/wiki/'
  8. self.root_path = 'Main_Page'
  9. self.initial_paths = %w(love love.audio love.data love.event love.filesystem love.font
  10. love.graphics love.image love.joystick love.keyboard love.math love.mouse love.physics
  11. love.sound love.system love.thread love.timer love.touch love.video love.window lua-enet
  12. socket utf8)
  13. self.links = {
  14. home: 'https://love2d.org/',
  15. code: 'https://github.com/love2d/love'
  16. }
  17. html_filters.push 'love/entries', 'love/clean_html', 'title'
  18. options[:root_title] = 'LÖVE'
  19. options[:decode_and_clean_paths] = true
  20. options[:container] = '#bodyContent'
  21. options[:skip] = %w(Getting_Started Building_LÖVE Tutorial Tutorials Game_Distribution License
  22. Games Libraries Software Snippets Version_History Lovers PO2_Syndrome HSL_color Guidelines)
  23. options[:skip_patterns] = [
  24. /_\([^\)]+\)\z/, # anything_(language)
  25. /\A(Special|Category|File|Help|Template|User|Tutorial):/,
  26. /\A\d/
  27. ]
  28. options[:replace_paths] = {
  29. 'Config_Files' => 'love.conf',
  30. 'conf.lua' => 'love.conf',
  31. 'enet' => 'lua-enet',
  32. 'ImageFormat' => 'ImageEncodeFormat'
  33. }
  34. options[:attribution] = <<-HTML
  35. &copy; 2006&ndash;2020 L&Ouml;VE Development Team<br>
  36. Licensed under the GNU Free Documentation License, Version 1.3.
  37. HTML
  38. def get_latest_version(opts)
  39. doc = fetch_doc('https://love2d.org/wiki/Version_History', opts)
  40. doc.at_css('#mw-content-text table a').content
  41. end
  42. end
  43. end