1
0

elisp.rb 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. module Docs
  2. class Elisp < FileScraper
  3. self.type = 'elisp'
  4. self.release = '28.2'
  5. self.base_url= 'https://www.gnu.org/software/emacs/manual/html_node/elisp/'
  6. self.root_path = 'index.html'
  7. self.links = {
  8. home:'https://www.gnu.org/software/emacs/manual/elisp',
  9. code: 'https://git.savannah.gnu.org/cgit/emacs.git'
  10. }
  11. html_filters.push 'elisp/entries', 'elisp/clean_html'
  12. # some file that were not skipped by skip patterns
  13. options[:skip] = [
  14. 'Coding-Conventions.html',
  15. 'Key-Binding-Conventions.html',
  16. 'Library-Headers.html'
  17. ]
  18. # some non essential sections
  19. options[:skip_patterns] = [
  20. /Introduction.html/,
  21. /Antinews.html/,
  22. /GNU-Free-Documentation-License.html/,
  23. /GPL.html/,
  24. /Tips.html/,
  25. /Definition-of-/
  26. ]
  27. # fix duplicates
  28. options[:fix_urls]= -> (url) do
  29. url.sub!('Window-Group.html', 'Basic-Windows.html')
  30. url.sub!('Local-defvar-example.html', 'Using-Lexical-Binding.html')
  31. url.sub!('Defining-Lisp-variables-in-C.html', 'Writing-Emacs-Primitives.html')
  32. url.sub!('describe_002dsymbols-example.html', 'Accessing-Documentation.html')
  33. url.sub!('The-interactive_002donly-property.html', 'Defining-Commands.html')
  34. url.sub!('Text-help_002decho.html', 'Special-Properties.html')
  35. url.sub!('Help-display.html', 'Special-Properties.html')
  36. url.sub!('autoload-cookie.html', 'Autoload.html')
  37. url.sub!('external_002ddebugging_002doutput.html', 'Output-Streams.html')
  38. url.sub!('modifier-bits.html', 'Other-Char-Bits.html')
  39. url.sub!('message_002dbox.html', 'Displaying-Messages.html')
  40. url.sub!('abbreviate_002dfile_002dname.html', 'Directory-Names.html')
  41. url.sub!('Inhibit-point-motion-hooks.html', 'Special-Properties.html')
  42. url.sub!('Coding-systems-for-a-subprocess.html', 'Process-Information.html')
  43. url.sub!('Process-Filter-Example.html', 'Filter-Functions.html')
  44. url.sub!('Docstring-hyperlinks.html', 'Documentation-Tips.html')
  45. url.sub!('seq_002dlet.html', 'Sequence-Functions.html')
  46. url.sub!('should_005fquit.html', 'Module-Misc.html')
  47. url.sub!('Display-Face-Attribute-Testing.html', 'Display-Feature-Testing.html')
  48. url.sub!('module-initialization-function.html', 'Module-Initialization.html')
  49. url.sub!('pcase_002dsymbol_002dcaveats.html', 'pcase-Macro.html')
  50. url.sub!('intern.html', 'Module-Misc.html')
  51. url.sub!('pcase_002dexample_002d1.html', 'pcase-Macro.html')
  52. url
  53. end
  54. options[:attribution]= <<-HTML
  55. Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>
  56. Licensed under the GNU GPL license.
  57. HTML
  58. def get_latest_version(opts)
  59. body = fetch('https://www.gnu.org/software/emacs/manual/html_node/elisp/index.html', opts)
  60. body.scan(/version \d*\.?\d*/)[0].sub('version', '')
  61. end
  62. end
  63. end