From 84f8a48b3a036465d9189bca54170ecbc0e96685 Mon Sep 17 00:00:00 2001 From: Jamie Ly Date: Sat, 21 Oct 2017 22:51:20 -0400 Subject: [PATCH] Adds Scala Play framework API docs Specifically for Scala API 2.4, 2.5, and 2.6 --- assets/stylesheets/application.css.scss | 1 + assets/stylesheets/pages/_play.scss | 6 ++++ lib/docs/scrapers/play.rb | 39 +++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 assets/stylesheets/pages/_play.scss create mode 100644 lib/docs/scrapers/play.rb diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index 0b5a71ee..70c0fa59 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -75,6 +75,7 @@ 'pages/phaser', 'pages/php', 'pages/phpunit', + 'pages/play', 'pages/postgres', 'pages/pug', 'pages/ramda', diff --git a/assets/stylesheets/pages/_play.scss b/assets/stylesheets/pages/_play.scss new file mode 100644 index 00000000..494c0e6c --- /dev/null +++ b/assets/stylesheets/pages/_play.scss @@ -0,0 +1,6 @@ +/** + * Play uses the same styles as Scala (since it uses Scaladoc) + */ +._play { + @extend ._scala; +} diff --git a/lib/docs/scrapers/play.rb b/lib/docs/scrapers/play.rb new file mode 100644 index 00000000..cd53ee92 --- /dev/null +++ b/lib/docs/scrapers/play.rb @@ -0,0 +1,39 @@ +module Docs + class Play < FileScraper + include FixInternalUrlsBehavior + + self.name = 'play' + self.type = 'play' + + self.links = { + home: 'https://playframework.com', + code: 'https://github.com/playframework/playframework' + } + self.root_path = 'package.html' + + options[:attribution] = <<-HTML +

Copyright (C) 2009-2017 Lightbend Inc. (https://www.lightbend.com).

+

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

+ HTML + options[:skip_patterns] = [/^index.html/, /index\/index-/] + html_filters.push 'scala/entries', 'scala/clean_html' + + version 'Scala API 2.4' do + self.release = '2.4.11' + self.base_url = 'https://playframework.com/documentation/2.4.11/api/scala/' + self.dir = '/Users/Thibaut/DevDocs/Docs/Play24/docs/content/api/scala' # download from http://central.maven.org/maven2/com/typesafe/play/play-docs_2.11/2.4.11/play-docs_2.11-2.4.11.jar + end + + version 'Scala API 2.5' do + self.release = '2.5.18' + self.base_url = 'https://playframework.com/documentation/2.5.18/api/scala/' + self.dir = '/Users/Thibaut/DevDocs/Docs/Play25/docs/content/api/scala' # download from http://central.maven.org/maven2/com/typesafe/play/play-docs_2.11/2.5.18/play-docs_2.11-2.5.18.jar + end + + version 'Scala API 2.6' do + self.release = '2.6.6' + self.base_url = 'https://playframework.com/documentation/2.6.6/api/scala/' + self.dir = '/Users/Thibaut/DevDocs/Docs/Play26/docs/content/api/scala' # Download from http://central.maven.org/maven2/com/typesafe/play/play-docs_2.11/2.6.6/play-docs_2.11-2.6.6.jar + end + end +end