You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2016/02/25 16:39:40 UTC

[02/10] brooklyn-docs git commit: Updated single page theme

Updated single page theme


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/59853364
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/59853364
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/59853364

Branch: refs/heads/master
Commit: 598533648ef48da07ecdedc45c5d37a0a97dc7fa
Parents: 247a1b5
Author: Duncan Godwin <du...@cloudsoftcorp.com>
Authored: Fri Feb 5 11:56:35 2016 +0000
Committer: Duncan Godwin <du...@cloudsoftcorp.com>
Committed: Thu Feb 25 14:50:25 2016 +0000

----------------------------------------------------------------------
 _build/build.sh                                | 21 ++++++++++--
 _includes/singlepage-content.html              | 32 +++++++++--------
 _includes/singlepage-item.html                 | 14 ++------
 _layouts/singlePage.html                       |  8 +++++
 _plugins/stringTools.rb                        | 26 ++++++++++++++
 guide/concepts/stop-start-restart-behaviour.md |  4 +--
 guide/start/blueprints.md                      |  2 +-
 guide/start/running.md                         |  2 +-
 singlePageManual.html                          |  6 ++--
 singlePageStarted.html                         |  5 ++-
 style/css/singlePage.css                       | 38 +++++++++++++++++++++
 website/learnmore/blueprint-tour.md            |  1 +
 12 files changed, 121 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/59853364/_build/build.sh
----------------------------------------------------------------------
diff --git a/_build/build.sh b/_build/build.sh
index 6081145..ee3d331 100755
--- a/_build/build.sh
+++ b/_build/build.sh
@@ -34,7 +34,9 @@ function help() {
   echo "* --install : install files from _site to the appropriate place in "'$'"BROOKLYN_SITE_DIR (or ../../brooklyn-site-public)"
   echo "* --skip-htmlproof : skip the HTML Proof run on _site"
   echo "* --quick-htmlproof : do a fast HTML Proof run on _site (not checking external links)"
-  echo "* --skip-pdf : skip generation of the PDF Documentation"
+  echo "* --skip-pdf : skip generation of all PDF Documentation"
+  echo "* --skip-pdf-manual : skip generation of the PDF Manual"
+  echo "* --skip-pdf-started : skip generation of the Getting Started PDF"
   echo ""
 }
 
@@ -161,6 +163,14 @@ function parse_arguments() {
       SKIP_PDF=true
       shift
       ;;
+    "--skip-pdf-manual")
+      SKIP_PDF_MANUAL=true
+      shift
+      ;;
+    "--skip-pdf-started")
+      SKIP_PDF_STARTED=true
+      shift
+      ;;
     *)
       echo "ERROR: invalid argument '"$1"'"
       exit 1
@@ -179,8 +189,13 @@ function build_pdf() {
   mkdir -p _pdf
   PDF_MANUAL_LOG="_pdf/pdf_gen_manual.log"
   PDF_STARTED_LOG="_pdf/pdf_gen_started.log"
-  _build/buildPDF.sh "_site/singlePageManual.html" "_pdf/UserManual.pdf" 2>&1 | tee $PDF_MANUAL_LOG
-  _build/buildPDF.sh "_site/singlePageStarted.html" "_pdf/GettingStarted.pdf" 2>&1 | tee $PDF_STARTED_LOG
+  
+  if [ "$SKIP_PDF_MANUAL" != "true" ]; then
+    _build/buildPDF.sh "_site/singlePageManual.html" "_pdf/UserManual.pdf" 2>&1 | tee $PDF_MANUAL_LOG
+  fi
+  if [ "$SKIP_PDF_STARTED" != "true" ]; then
+    _build/buildPDF.sh "_site/singlePageStarted.html" "_pdf/GettingStarted.pdf" 2>&1 | tee $PDF_STARTED_LOG
+  fi
 }
 
 # Runs htmlproof against _site

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/59853364/_includes/singlepage-content.html
----------------------------------------------------------------------
diff --git a/_includes/singlepage-content.html b/_includes/singlepage-content.html
index 4b10bf8..18fc1b7 100644
--- a/_includes/singlepage-content.html
+++ b/_includes/singlepage-content.html
@@ -1,5 +1,5 @@
 {% pop site_items item %}
-{% if item[pageMask] != true %}
+{% if item[page.page_mask] != true %}
 	
 	{% set_hash_entry item path item_path %}
 	{% set_hash_entry item url item_url %}
@@ -7,15 +7,6 @@
 	{% set_hash_entry item title item_title %}
 	{% set_hash_entry item id item_id %}
 	
-	{% unless item_path %}
-	 {% unless item_url %}
-	  {% puts error, null item_url %}
-	  {% putp item %}
-	  {% putv item_url %}
-	  {% fail item missing path and url (jekyll block evaluation order can cause this) %}
-	 {% endunless %}
-	{% endunless %}
-	
 	 {% if visitedb contains item_title %}
 	  {% comment %} <!-- ignore --> {% endcomment %}
 	 {% elsif item['external'] %}
@@ -24,7 +15,7 @@
 	 {% else %}
 	 {% capture pid %}{{ item.title | remove:'/' | replace:' ','-' | downcase }}{% endcapture %}
 	 {% if item_content != null %}
-	<div id="contentsLink-{{pid}}" class="section p-{{item_id}}">
+	<div id="contentsLink-{{pid}}" class="section-breaker section p-{{item_id}}">
 	<h1>{{ item_title }}</h1>
 	{% comment %}
 	<!-- 
@@ -34,13 +25,26 @@
 	
 	{% comment %}<!-- Build the page directory by removing the file name from the item url -->{% endcomment %}
 	{% capture page_url %}{{ item_url | replace_regex:'[^\/]*$', '' }}{% endcapture %}
-	{% capture new_var %}img src=".{{ page_url }}{% endcapture %}
+	
+	{% comment %}<!-- If the URL is prefixed with a pdf-rewrite-prefix, remove it -->{% endcomment %}
+	{% for part in site.pdf-rewrite-prefixes %}
+	  {% capture prefixed %}{{ page_url | startsWith: part[0] }}{% endcapture %}
+	  {% if prefixed == "true"  %}
+	  	{% capture page_url %}{{ part[1] }}{{ page_url | removePrefix: part[0] }}{% endcapture %}
+	  {% endif %}
+	{% endfor %}
+	
+	{% capture new_img %}img src=".{{ page_url }}{% endcapture %}
+	{% capture new_href %}href="{{ site.brooklyn-base-url }}{{ brooklyn-version }}{{ page_url }}{% endcapture %}
 	
 	{% comment %}<!-- Build a regex which replaces the current path with an absolute one but leaves any sub folders such as /images -->{% endcomment %}
-	{% capture regex %}(img(.*)src="{{ page_url | replace:'/','\/' }})|(img(.*)src="){% endcapture %}
+	{% capture img_regex %}(img(.*)src="{{ page_url | replace:'/','\/' }})|(img(.*)src="){% endcapture %}
+	
+	{% comment %}<!-- Build a regex which replaces the current links with an absolute one but leaves any sub folders such as /images and ignores # or external links -->{% endcomment %}
+	{% capture link_regex %}(href="{{ page_url | replace:'/','\/' }})|(href="(?!http)(?!#)){% endcapture %}
 	
 	{% comment %}<!-- Filter the content of the included page -->{% endcomment %}
-	{% capture content_filtered %}{{ item_content | replace_regex:regex, new_var }}{% endcapture %}
+	{% capture content_filtered %}{{ item_content | replace_regex: img_regex, new_img | replace_regex: link_regex, new_href }}{% endcapture %}
 	{{ content_filtered }}
 	</div>
 	 {% endif %}

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/59853364/_includes/singlepage-item.html
----------------------------------------------------------------------
diff --git a/_includes/singlepage-item.html b/_includes/singlepage-item.html
index 803cf7e..8725939 100644
--- a/_includes/singlepage-item.html
+++ b/_includes/singlepage-item.html
@@ -1,23 +1,15 @@
 {% pop site_items item %}
-{% if item[pageMask] != true %}
-	
+{% if item[page.page_mask] != true %}
+
 	{% set_hash_entry item path item_path %}
 	{% set_hash_entry item url item_url %}
 	{% set_hash_entry item title item_title %}
 	{% set_hash_entry item content item_content %}
 	{% set_hash_entry item data item_data %}
 	
-	{% unless item_path %}
-	 {% unless item_url %}
-	  {% puts error, null item_url %}
-	  {% putp item %}
-	  {% putv item_url %}
-	  {% fail item missing path and url (jekyll block evaluation order can cause this) %}
-	 {% endunless %}
-	{% endunless %}
-	
 	{% capture pid %}{{ item.title | remove:'/' | replace:' ','-' | downcase }}{% endcapture %}
 	<a id="{{ item_path }}" name="{{ item_path }}" href="javascript:void(0);"></a>
+	{{ page.my_array['test'] = 'test' }}
 	<li>
 	 {% if visited contains item_title %}
 	  {{ item['title'] }} &nbsp; <a href="#link-{{pid}}"><span class="octicon octicon-link-external flip"></span></a>

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/59853364/_layouts/singlePage.html
----------------------------------------------------------------------
diff --git a/_layouts/singlePage.html b/_layouts/singlePage.html
index 6f45639..adb3c03 100644
--- a/_layouts/singlePage.html
+++ b/_layouts/singlePage.html
@@ -3,7 +3,15 @@
 <!DOCTYPE html>
 <html>
 <head>
+<title>{{ page.title }} - Apache Brooklyn</title>
+<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
+<link href=".{{site.path.style}}/deps/bootstrap.min.css" rel="stylesheet">
+<link href=".{{site.path.style}}/deps/octicons/octicons.css" rel="stylesheet">
+<link href=".{{site.path.style}}/deps/bootstrap-theme.css" rel="stylesheet">
 
+<link href=".{{site.path.style}}/css/website.css" rel="stylesheet">
+<link rel="stylesheet" href=".{{ site.path.style }}/css/singlePage.css" type="text/css" media="screen" />
+<style>.{{ page.pageMask }}{ display: none; }</style>
 </head>
 
 

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/59853364/_plugins/stringTools.rb
----------------------------------------------------------------------
diff --git a/_plugins/stringTools.rb b/_plugins/stringTools.rb
new file mode 100644
index 0000000..929a7c5
--- /dev/null
+++ b/_plugins/stringTools.rb
@@ -0,0 +1,26 @@
+module SliceFilter
+  def slice(input, length, start=0)
+    if length > input.length
+      length = input.length
+    end
+    input[start, length]
+  end
+
+  Liquid::Template.register_filter self
+end
+
+module StartsWithFilter
+  def startsWith(input, startStr)
+    startStr.length < input.length && input[0, startStr.length] == startStr
+  end
+
+  Liquid::Template.register_filter self
+end
+
+module RemovePrefixFilter
+  def removePrefix(input, prefix)
+    input[prefix.length, input.length]
+  end
+
+  Liquid::Template.register_filter self
+end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/59853364/guide/concepts/stop-start-restart-behaviour.md
----------------------------------------------------------------------
diff --git a/guide/concepts/stop-start-restart-behaviour.md b/guide/concepts/stop-start-restart-behaviour.md
index 916ea5c..d862cb3 100644
--- a/guide/concepts/stop-start-restart-behaviour.md
+++ b/guide/concepts/stop-start-restart-behaviour.md
@@ -10,7 +10,7 @@ Many entities expose `start`, `stop` and `restart` effectors. The semantics of t
 ## Top-level applications
 A top-level application is a grouping of other entities, pulling them together into the "application" of your choice. This could range from a single app-server, to an app that is a composite of a no-sql cluster (e.g. MongoDB sharded cluster, or Cassandra spread over multiple datacenters), a cluster of load-balanced app-servers, message brokers, etc.
 
-### start(Collection<Location>)
+### start(Collection &lt;Location&gt;)
 This will start the application in the given location(s). Each child-entity within the application will be started concurrently, passing the location(s) to each child.
 The start effector will be called automatically when the application is deployed through the catalog.
 Is is strongly recommended to not call start again.
@@ -25,7 +25,7 @@ Is is strongly recommended to not call this, unless the application has been exp
 
 ## Software Process (e.g MySql, Tomcat, JBoss app-server, MongoDB)
 
-### start(Collection<Location>)
+### start(Collection &lt;Location&gt;)
 This will start the software process in the given location.
 If a machine location is passed in, then the software process is started there.
 If a cloud location is passed in, then a new VM will be created in that cloud - the software process will be **installed+launched** on that new VM.

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/59853364/guide/start/blueprints.md
----------------------------------------------------------------------
diff --git a/guide/start/blueprints.md b/guide/start/blueprints.md
index 1b195ef..e282e8d 100644
--- a/guide/start/blueprints.md
+++ b/guide/start/blueprints.md
@@ -3,7 +3,7 @@ title: Deploying Blueprints
 layout: website-normal
 ---
 
-Blueprints are descriptors or patterns which describe how Apache Brooklyn should deploy applications. Blueprints are written in [YAML](https://en.wikipedia.org/wiki/YAML){:target="_blank"} and all of the entities available are defined in the __[Brooklyn Catalog](../../website/learnmore/catalog/)__.
+Blueprints are descriptors or patterns which describe how Apache Brooklyn should deploy applications. Blueprints are written in [YAML](https://en.wikipedia.org/wiki/YAML){:target="_blank"} and all of the entities available are defined in the __[Brooklyn Catalog]({{ site.path.website }}/learnmore/catalog/)__.
 
 ## Launching from a Blueprint
 

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/59853364/guide/start/running.md
----------------------------------------------------------------------
diff --git a/guide/start/running.md b/guide/start/running.md
index ed78028..e7631f1 100644
--- a/guide/start/running.md
+++ b/guide/start/running.md
@@ -132,4 +132,4 @@ The CLI provides the command `br`, it's full usage is described in the user manu
 
 ## Next
 
-The first thing we want to do with Brooklyn is **[deploy a blueprint](blueprints.html)**.
+<div class="started-pdf-exclude">The first thing we want to do with Brooklyn is **[deploy a blueprint](blueprints.html)**.</div>

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/59853364/singlePageManual.html
----------------------------------------------------------------------
diff --git a/singlePageManual.html b/singlePageManual.html
index 98bd900..bfdfa69 100644
--- a/singlePageManual.html
+++ b/singlePageManual.html
@@ -1,6 +1,7 @@
 ---
 title: Apache Brooklyn Manual
 layout: singlePage
+page_mask: usermanual-pdf-exclude
 ---
 	<div id="content_container" class="container">
 	<header>
@@ -8,9 +9,7 @@ layout: singlePage
 	</header>
 		<h1>Contents</h1>
 	
-	{% assign pageMask = "usermanual-pdf-exclude" %}
-	
-	    <nav><ul><!-- site.pages --> 
+	    <nav><ul>
 		  {% assign visited = "" | split: "|" %}
 	      {% for node in site.data.menu  %}
 			  {% push site_items node %}
@@ -23,4 +22,5 @@ layout: singlePage
 			  {% push site_items node %}
 			  {% include singlepage-content.html %}
 	      {% endfor %}
+	  
   </div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/59853364/singlePageStarted.html
----------------------------------------------------------------------
diff --git a/singlePageStarted.html b/singlePageStarted.html
index 5598f55..9e527eb 100644
--- a/singlePageStarted.html
+++ b/singlePageStarted.html
@@ -1,6 +1,7 @@
 ---
 title: Apache Brooklyn Manual
 layout: singlePage
+page_mask: started-pdf-exclude
 ---
 	<div id="content_container" class="container">
 	<header>
@@ -8,9 +9,7 @@ layout: singlePage
 	</header>
 		<h1>Contents</h1>
 	
-	{% assign pageMask = "started-pdf-exclude" %}
-	
-	    <nav><ul><!-- site.pages --> 
+	    <nav><ul>
 		  {% assign visited = "" | split: "|" %}
 	      {% for node in site.data.menu  %}
 			  {% push site_items node %}

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/59853364/style/css/singlePage.css
----------------------------------------------------------------------
diff --git a/style/css/singlePage.css b/style/css/singlePage.css
new file mode 100644
index 0000000..781e590
--- /dev/null
+++ b/style/css/singlePage.css
@@ -0,0 +1,38 @@
+.nav.nav-tabs{
+	display: none;
+}
+#next{
+	display: none;
+}
+.collapse {
+    display: block;
+}
+.section-breaker {
+page-break-before:always;
+}
+.panel-heading{
+	padding-bottom: 15px;
+}
+/* The styled bootstrap panels */
+.panel-body, .panel-default{
+	background: none;
+	border: 0px solid #fff !important;
+	box-shadow: none;
+	padding: 0px;
+}
+.panel-default > .panel-heading{
+	background: none;
+	border: 0px solid #fff !important;
+	box-shadow: none;
+	padding-top: 0px;
+	padding-right: 0px;
+	padding-left: 0px;
+}
+pre{
+	overflow: auto;
+	white-space: pre-wrap;       /* CSS 3 */
+    white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
+    white-space: -pre-wrap;      /* Opera 4-6 */
+    white-space: -o-pre-wrap;    /* Opera 7 */
+    word-wrap: break-word;       /* Internet Explorer 5.5+ */
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/59853364/website/learnmore/blueprint-tour.md
----------------------------------------------------------------------
diff --git a/website/learnmore/blueprint-tour.md b/website/learnmore/blueprint-tour.md
index 0a7795b..11a1f23 100644
--- a/website/learnmore/blueprint-tour.md
+++ b/website/learnmore/blueprint-tour.md
@@ -1,6 +1,7 @@
 ---
 layout: website-normal
 title: A Quick Tour of a Brooklyn Blueprint
+usermanual-pdf-exclude: true
 title_in_menu: Blueprint Tour
 ---