webpack.rb 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. module Docs
  2. class Webpack < UrlScraper
  3. self.name = 'webpack'
  4. self.type = 'webpack'
  5. self.root_path = 'guides/'
  6. self.initial_paths = %w(
  7. concepts/
  8. guides/
  9. api/
  10. configuration/
  11. loaders/
  12. plugins/
  13. )
  14. self.links = {
  15. home: 'https://webpack.js.org/',
  16. code: 'https://github.com/webpack/webpack'
  17. }
  18. html_filters.push 'webpack/clean_html', 'webpack/entries'
  19. options[:container] = '.page'
  20. options[:trailing_slash] = false
  21. options[:only_patterns] = [
  22. /\Aconcepts\//,
  23. /\Aguides\//,
  24. /\Aapi\//,
  25. /\Aconfiguration\//,
  26. /\Aloaders\//,
  27. /\Aplugins\//
  28. ]
  29. options[:attribution] = <<-HTML
  30. &copy; JS Foundation and other contributors<br>
  31. Licensed under the Creative Commons Attribution License 4.0.
  32. HTML
  33. version '5' do
  34. self.release = '5.37.0'
  35. self.base_url = 'https://webpack.js.org/'
  36. end
  37. version '4' do
  38. self.release = '4.44.2'
  39. self.base_url = 'https://v4.webpack.js.org/'
  40. end
  41. version '1' do
  42. self.release = '1.15.0'
  43. self.base_url = 'https://webpack.github.io/docs/'
  44. self.links = {
  45. home: 'https://webpack.github.io/',
  46. code: 'https://github.com/webpack/webpack/tree/webpack-1'
  47. }
  48. html_filters.push 'webpack/entries_old', 'webpack/clean_html_old', 'title'
  49. options[:title] = false
  50. options[:root_title] = 'webpack'
  51. options[:skip] = %w(list-of-tutorials.html examples.html changelog.html ideas.html roadmap.html)
  52. options[:attribution] = <<-HTML
  53. &copy; 2012&ndash;2015 Tobias Koppers<br>
  54. Licensed under the MIT License.
  55. HTML
  56. end
  57. def get_latest_version(opts)
  58. get_npm_version('webpack', opts)
  59. end
  60. end
  61. end