From 485eb04bcc14d202e00c10e51aabc5de5b3797f2 Mon Sep 17 00:00:00 2001 From: Markus Jura Date: Mon, 13 Jul 2015 07:56:55 +0200 Subject: [PATCH 1/5] Update CSS styling --- app/assets/css/main.sass | 2 +- app/assets/css/modules/_base.sass | 64 ++++++++++++---------------- app/assets/css/modules/_tables.sass | 2 +- app/assets/css/modules/_type.sass | 65 ++++++++++++++++------------- app/assets/css/modules/_vars.sass | 3 ++ app/views/conductr/index.scala.html | 4 +- app/views/main.scala.html | 8 ++-- 7 files changed, 75 insertions(+), 73 deletions(-) diff --git a/app/assets/css/main.sass b/app/assets/css/main.sass index 7c1a7b7..0cbbd60 100644 --- a/app/assets/css/main.sass +++ b/app/assets/css/main.sass @@ -6,7 +6,7 @@ // Make sure the charset is set appropriately @import foundation/functions -$row-width: rem-calc(1200) +$row-width: rem-calc(1000) $small-range: (0em, 55em) $medium-range: (55.063em, 64em) $large-range: (64.063em, 90em) diff --git a/app/assets/css/modules/_base.sass b/app/assets/css/modules/_base.sass index 235f69e..50d0010 100644 --- a/app/assets/css/modules/_base.sass +++ b/app/assets/css/modules/_base.sass @@ -2,7 +2,7 @@ body background: $navy padding: 0 - margin: 0 + margin: 0 .fw-wrapper padding: 60px 0px @@ -30,6 +30,8 @@ body background-color: $slate-tt h1,h2,h3,h4,p,a color: $white + &.white + background-color: $white &.white-ltr background-color: $white-ltr &.white-dkr @@ -76,7 +78,7 @@ body &.scala background-color: $scala-red h1,h2,h3,h4,p,a - color: $white + color: $white #site-header background: $white @@ -125,7 +127,7 @@ body height: 70px line-height: 70px padding: 0 30px - color: navy + color: slate-text border-left: 1px solid $white-dkr font-weight: bold font-stretch: condensed @@ -134,14 +136,14 @@ body transition: all 150ms ease-in-out text-transform: uppercase &:link, &:visited - color: $navy + color: $slate-text &:hover background: rgba(#f0f3f6,0.2) - box-shadow: inset 0 4px 0 $navy,inset 0 0 1px $grey-ltr + box-shadow: inset 0 4px 0 $slate-text,inset 0 0 1px $grey-ltr transition: all 150ms ease-in-out text-decoration: none &:active - color: $navy + color: $slate-text .svg-icon-typesafe-full-color width: 100px height: 40px @@ -163,7 +165,7 @@ body font-style: italic .page-content - background: $white-ltr + background: $white min-height: 600px .left-off-canvas-menu @@ -205,7 +207,7 @@ body text-decoration: none &.active background: $white-dkr - color: $navy + color: $slate-text padding: 3px 3px 3px 10px border-radius: $br &:after @@ -223,7 +225,7 @@ body border: 1px solid $white-dkr border-bottom: 3px solid $white-dkr h3, h3 a - color: $navy + color: $slate-text &:hover text-decoration: none color: $blue-text @@ -248,32 +250,32 @@ body &.active border-left: 10px solid $blue border-bottom: none - background: $white-dkr + background: $white-ltr font-weight: 700 transition: $anime - color: $navy + color: $slate-text &:hover background: $white-ltr text-decoration: none transition: $anime > ul li - font-size: 0.8em + font-size: 0.9em padding-left: 0 #site-footer color: $white - .footer-toc aside > ul > li - border-top: 1px solid $white-dkr - padding-top: 4px - margin: 0 0 10px 0 - float: left - width: 100% + .footer-toc a:hover + text-decoration: none + color: $blue-text + .footer-toc h2 + font-size: 1em + font-weight: 700 text-transform: uppercase - @media only screen and (min-width: $medium) - width: 29% - margin-right: 2% + margin-bottom: .2rem > a - color: white + color: $red + .footer-toc ul > li > a + color: $white .footer-toc ul margin: 0 @@ -284,18 +286,6 @@ body >ul li padding-left: 0 text-transform: none - a.active - background: $white-dkr - display: inline-block - padding: 2px 15px 2px 6px - color: $navy - border-radius: $br - &:hover - text-decoration: none - &:before - content: "\203A" - margin-right: 5px - font-weight: 700 .logo-copyright height: 30px @@ -327,7 +317,7 @@ body text-decoration: none .next-prev-nav - background: $white-dkr + background: $white-ltr padding: 2em border-radius: $br p @@ -364,5 +354,5 @@ body margin-right: 6px body .support-detail a:hover - color: #ffffff - text-decoration: underline + color: $blue + text-decoration: none diff --git a/app/assets/css/modules/_tables.sass b/app/assets/css/modules/_tables.sass index 5a60cf7..cd1731a 100644 --- a/app/assets/css/modules/_tables.sass +++ b/app/assets/css/modules/_tables.sass @@ -2,7 +2,7 @@ table color: $navy thead tr th - background: $blue + background: $navy color: $white tr td color: $navy \ No newline at end of file diff --git a/app/assets/css/modules/_type.sass b/app/assets/css/modules/_type.sass index 0836656..b57437c 100644 --- a/app/assets/css/modules/_type.sass +++ b/app/assets/css/modules/_type.sass @@ -6,26 +6,27 @@ body position: relative cursor: default font: 1em $typesafe-fonts - color: $navy + color: $slate-text font-smoothing: antialiased + -webkit-font-smoothing: antialiased -webkit-font-size-adjust: none text-rendering: optimizeLegibility h1 font-family: inherit - font-size: 2em + font-size: 2.6em font-weight: 300 - color: $navy + color: $slate-text margin-bottom: 0.4em margin-top: 1.1em &:first-child margin-top: 0 h2 font-family: inherit - font-size: 1.6em + font-size: 1.8em margin-bottom: 0.2em margin-top: 1.3em - font-weight: 300 - color: $navy + font-weight: 500 + color: $slate-text &:first-child margin-top: 0 h3, .panel h3 @@ -33,7 +34,7 @@ h3, .panel h3 font-size: 1.125em font-weight: 700 margin-top: 1.3em - color: $navy + color: $slate-text &:first-child margin-top: 0 h4 @@ -41,21 +42,21 @@ h4 font-size: 1em font-weight: 700 margin-top: 1.3em - color: $navy + color: $slate-text &:first-child margin-top: 0 h5 font-family: inherit font-size: 1em margin-top: 1.3em - color: $navy + color: $slate-text &:first-child margin-top: 0 h6 font-family: inherit font-size: 1em margin-top: 1.3em - color: $navy + color: $slate-text &:first-child margin-top: 0 @@ -63,9 +64,8 @@ p font-family: inherit font-size: 1em line-height: 1.45em - margin-bottom: 1em - margin-top: 0em - color: $navy + margin: 1em 0em + color: $slate-text a font-family: inherit color: $blue-text @@ -88,38 +88,45 @@ a h1 a, h2 a font-family: inherit - color: $navy + color: $slate-text text-decoration: none cursor: pointer &:link - color: $navy + color: $slate-text &:visited - color: $navy + color: $slate-text &:hover color: $blue-text text-decoration: none &:active - color: $navy + color: $slate-text pre - padding: 0.125rem 0.3125rem 0.0625rem - border: 1px solid $white-dkr - background: $white - margin: 0 0 30px 0 + padding: 0.5rem 1rem + border: 1px solid $grey-code-dkr + -webkit-border-radius: 5px + border-radius: 5px + background: $grey-code + margin: 0 0 1rem 0 + +code + line-height: 1.45em + font-family: "Source Code Pro", Consolas, "Liberation Mono", Courier, monospace + font-size: 0.85em pre > code background: none border: none -code - line-height: 1.45em - border: 1px solid $white-dkr - background: $white - font-family: "Source Code Pro", Consolas, "Liberation Mono", Courier, monospace - font-size: 0.875em +p > code + border: 1px solid $grey-code-dkr + -webkit-border-radius: 3px + border-radius: 3px + background: $grey-code-ltr + padding: 0.0625rem 0.25rem blockquote - background: $white + background: $grey-code border-left: 10px solid $red margin: 1.5em 0 padding: 1em 20px @@ -135,5 +142,5 @@ blockquote:before blockquote p display: inline - color: $navy + color: $slate-text font-style: italic diff --git a/app/assets/css/modules/_vars.sass b/app/assets/css/modules/_vars.sass index 7a01999..8da6b25 100644 --- a/app/assets/css/modules/_vars.sass +++ b/app/assets/css/modules/_vars.sass @@ -39,6 +39,9 @@ $grey: #899CA9 $grey-dkr: #6F7F89 $grey-ltr: #8BA1B0 $grey-text: #778a99 +$grey-code-ltr: #FAFAFA +$grey-code: #F7F7F7 +$grey-code-dkr: #DDDDDD // GREENS $green: #69af04 diff --git a/app/views/conductr/index.scala.html b/app/views/conductr/index.scala.html index bc9cb70..2df2c9d 100644 --- a/app/views/conductr/index.scala.html +++ b/app/views/conductr/index.scala.html @@ -4,7 +4,7 @@
-
+

Today’s demands on Operations are simply not met by yesterday’s software architectures and technologies

ConductR is a solution for managing Typesafe Reactive Platform applications across a cluster of machines. ConductR is reactive from the ground up thus enabling operations to provide the resiliency required to unleash the full benefits of the Typesafe Reactive Platform in their organization.

@@ -23,7 +23,7 @@

Today’s demands on Operations are simply not met by yesterday’s software

Warm regards,
The ConductR Team

-
+
@toc
diff --git a/app/views/main.scala.html b/app/views/main.scala.html index 4162bd8..4314313 100644 --- a/app/views/main.scala.html +++ b/app/views/main.scala.html @@ -50,11 +50,13 @@ @content -
+
-
+
-

NEXT:

+

+ Next: +

From cabb16774ed38d4791db968b5c93d1845f192ad5 Mon Sep 17 00:00:00 2001 From: Markus Jura Date: Tue, 14 Jul 2015 11:27:35 +0200 Subject: [PATCH 2/5] Update navigation structure --- app/controllers/Application.scala | 7 +++- app/doc/DocRenderer.scala | 31 ++++++++------ app/modules/ConductRDocRendererModule.scala | 1 + app/views/conductr/body.scala.html | 46 +++++++++++++++++++-- app/views/conductr/index.scala.html | 11 ++--- app/views/main.scala.html | 39 +++-------------- app/views/mainNav.scala.html | 2 + conf/routes | 4 +- 8 files changed, 82 insertions(+), 59 deletions(-) diff --git a/app/controllers/Application.scala b/app/controllers/Application.scala index 0bf0669..6908823 100644 --- a/app/controllers/Application.scala +++ b/app/controllers/Application.scala @@ -76,7 +76,11 @@ class Application @Inject() ( private val secret = new SecretKeySpec(settings.play.crypto.secret.getBytes, MacAlgorithm) - def render(path: String) = Action.async { request => + def renderIndex = Action { + Ok(views.html.conductr.index()) + } + + def renderDocs(path: String) = Action.async { request => request.headers.get(HOST) match { case Some(host) => getDocRenderer(host, docRenderers, settings.application.hostAliases) match { @@ -86,6 +90,7 @@ class Application @Inject() ( .map { case html: Html => Ok(html) case resource: File => Ok.sendFile(resource) + case DocRenderer.Redirect(rp) => Redirect(routes.Application.renderDocs(rp)) case DocRenderer.NotFound(rp) => NotFound(s"Cannot find $rp") case DocRenderer.NotReady => ServiceUnavailable("Initializing documentation. Please try again in a minute.") } diff --git a/app/doc/DocRenderer.scala b/app/doc/DocRenderer.scala index 7d1efad..213d5aa 100644 --- a/app/doc/DocRenderer.scala +++ b/app/doc/DocRenderer.scala @@ -16,7 +16,7 @@ import play.api.libs.ws.{WSResponseHeaders, WSClient} import play.doc.{PlayDoc, FilesystemRepository} import play.twirl.api.Html import spray.caching.{Cache, LruCache} -import views.html.conductr.{body, index} +import views.html.conductr.body import scala.collection.immutable import scala.collection.JavaConverters._ @@ -29,6 +29,11 @@ object DocRenderer { */ case class Render(path: String) + /** + * Redirect to a relative documentation path + */ + case class Redirect(path: String) + /** * Path is not found */ @@ -56,17 +61,18 @@ object DocRenderer { private[doc] case class Folder(name: String, documents: immutable.Seq[Entry]) extends Entry private[doc] case class Document(name: String, ref: URI) extends Entry - final private val HtmlExt = "html" final private val SiteUpdateCounter = "SiteUpdateCounter" + final private val IndexPath = "intro/Intro" final private val TocFilename = "index.toc" def props( docArchive: URI, removeRootSegment: Boolean, docRoot: Path, + docUri: String, version: String, wsClient: WSClient): Props = - Props(new DocRenderer(docArchive, removeRootSegment, docRoot, version, wsClient)) + Props(new DocRenderer(docArchive, removeRootSegment, docRoot, docUri, version, wsClient)) private[doc] def unzip(input: Enumerator[Array[Byte]], removeRootSegment: Boolean)(implicit ec: ExecutionContext): Future[Path] = { val archive = Files.createTempFile(null, null) @@ -111,10 +117,10 @@ object DocRenderer { } } - private[doc] def aggregateToc(docDir: Path): Html = { + private[doc] def aggregateToc(docDir: Path, docUri: String): Html = { import HtmlPrettyPrinter._ - val folder = createEntries(docDir, new URI(""), Folder("", List.empty)) + val folder = createEntries(docDir, new URI(docUri), Folder("", List.empty)) def toDoc(documents: immutable.Seq[Entry]): Doc = ul(documents.map { @@ -139,14 +145,14 @@ object DocRenderer { val subTargetUri = new URI(s"$targetUri/$filename") createEntries(subDocDir, subTargetUri, Folder(name, List.empty)) } else { - Document(name, new URI(s"$targetUri/$filename.$HtmlExt")) + Document(name, new URI(s"$targetUri/$filename")) } } folder.copy(documents = folder.documents ++ newDocuments) } private def getName(path: String): String = - path.drop(1).reverse.dropWhile(_ != '.').drop(1).takeWhile(_ != '/').reverse.dropWhile(_ == '/') + path.drop(1).reverse.takeWhile(_ != '/').reverse.dropWhile(_ == '/') } /** @@ -157,6 +163,7 @@ class DocRenderer( docArchive: URI, removeRootSegment: Boolean, docRoot: Path, + docUri: String, version: String, wsClient: WSClient) extends Actor with ActorLogging { @@ -186,7 +193,7 @@ class DocRenderer( log.info(s"Doc retrieved for $docArchive") val docSources = docDir.resolve(docRoot) - val toc = aggregateToc(docSources) + val toc = aggregateToc(docSources, docUri) val repo = new FilesystemRepository(docSources.toFile) val mdRenderer = new PlayDoc(repo, repo, "resources", version) @@ -206,12 +213,10 @@ class DocRenderer( } private def handleRendering(docSources: Path, mdRenderer: PlayDoc, toc: Html, cache: Cache[Html]): Receive = { - case Render(path) if path.isEmpty || path == "/" || path == s"Home.$HtmlExt" => - cache("/") { - index(toc) - }.pipeTo(sender()) + case Render(path) if path.isEmpty => + sender() ! Redirect(IndexPath) - case Render(path) if path.endsWith(HtmlExt)=> + case Render(path) if !path.contains(".")=> cache(path) { val mdFilename = getName(path) mdRenderer.renderPage(mdFilename) match { diff --git a/app/modules/ConductRDocRendererModule.scala b/app/modules/ConductRDocRendererModule.scala index 0f190c1..a080856 100644 --- a/app/modules/ConductRDocRendererModule.scala +++ b/app/modules/ConductRDocRendererModule.scala @@ -21,6 +21,7 @@ object ConductRDocRendererModule { new URI("https://github.com/typesafehub/conductr-doc/archive/master.zip"), removeRootSegment = true, Paths.get("src/main/play-doc"), + controllers.routes.Application.renderDocs("").url, "1.0.x", wsClient), "conductr-doc-renderer") diff --git a/app/views/conductr/body.scala.html b/app/views/conductr/body.scala.html index f24d2e4..5a121a8 100644 --- a/app/views/conductr/body.scala.html +++ b/app/views/conductr/body.scala.html @@ -1,17 +1,57 @@ @(b: Html, toc: Html) -@main("ConductR - A Reactive Application Manager for Operations", toc) { +@scripts = { + +} + +@main("ConductR - A Reactive Application Manager for Operations", additionalScripts = Some(scripts)) {
-
+
@b
-
+
@toc
+ +
+
+
+
+

+ Next: +

+
+
+
+
} \ No newline at end of file diff --git a/app/views/conductr/index.scala.html b/app/views/conductr/index.scala.html index 2df2c9d..c350b71 100644 --- a/app/views/conductr/index.scala.html +++ b/app/views/conductr/index.scala.html @@ -1,10 +1,10 @@ -@(toc: Html) +@() -@main("ConductR - A Reactive Application Manager for Operations", toc) { +@main("ConductR - A Reactive Application Manager for Operations") {
-
+

Today’s demands on Operations are simply not met by yesterday’s software architectures and technologies

ConductR is a solution for managing Typesafe Reactive Platform applications across a cluster of machines. ConductR is reactive from the ground up thus enabling operations to provide the resiliency required to unleash the full benefits of the Typesafe Reactive Platform in their organization.

@@ -23,11 +23,6 @@

Today’s demands on Operations are simply not met by yesterday’s software

Warm regards,
The ConductR Team

-
-
- @toc -
-
} diff --git a/app/views/main.scala.html b/app/views/main.scala.html index 4314313..33f2739 100644 --- a/app/views/main.scala.html +++ b/app/views/main.scala.html @@ -1,4 +1,4 @@ -@(title: String, toc: Html)(content: Html) +@(title: String, additionalScripts: Option[Html] = None)(content: Html) @@ -22,7 +22,6 @@
- @toc @mainNav(false)
@@ -50,18 +49,6 @@ @content -
-
-
-
-

- Next: -

-
-
-
-
-