Skip to content

Commit

Permalink
extend files
Browse files Browse the repository at this point in the history
  • Loading branch information
mpmcgarry committed Oct 18, 2013
1 parent a27a8ee commit 1b426b0
Show file tree
Hide file tree
Showing 22 changed files with 4,991 additions and 4 deletions.
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global

# Ignore bundler config
/.bundle

# Ignore the build directory
/build

# Ignore Sass' cache
/.sass-cache

.idea
/vendor
.DS_Store

6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

gem "middleman-livereload"
gem "redcarpet", "~>2.2.2"
gem "middleman-core"
gem 'middleman-syntax'
59 changes: 59 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (3.2.14)
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
em-websocket (0.5.0)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.5.3)
eventmachine (1.0.3)
ffi (1.9.0)
http_parser.rb (0.5.3)
i18n (0.6.4)
listen (1.2.3)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
rb-kqueue (>= 0.2)
middleman-core (3.1.4)
activesupport (~> 3.2.6)
bundler (~> 1.1)
i18n (~> 0.6.1)
listen (~> 1.2.2)
rack (>= 1.4.5)
rack-test (~> 0.6.1)
thor (>= 0.15.2, < 2.0)
tilt (~> 1.3.6)
middleman-livereload (3.1.0)
em-websocket (>= 0.2.0)
middleman-core (>= 3.0.2)
multi_json (~> 1.0)
rack-livereload
middleman-syntax (1.2.1)
middleman-core (~> 3.0)
rouge (~> 0.3.0)
multi_json (1.7.8)
rack (1.5.2)
rack-livereload (0.3.15)
rack
rack-test (0.6.2)
rack (>= 1.0)
rb-fsevent (0.9.3)
rb-inotify (0.9.1)
ffi (>= 0.5.0)
rb-kqueue (0.2.0)
ffi (>= 0.5.0)
redcarpet (2.2.2)
rouge (0.3.10)
thor
thor (0.18.1)
tilt (1.3.7)

PLATFORMS
ruby

DEPENDENCIES
middleman-core
middleman-livereload
middleman-syntax
redcarpet (~> 2.2.2)
11 changes: 11 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CF Docs 09012012

Copyright (c) 2012 VMware, Inc. All Rights Reserved.

This product is licensed to you under the Apache License, Version 2.0 (the "License").
You may not use this product except in compliance with the License.

This product may include a number of subcomponents with separate copyright notices
and license terms. Your use of these subcomponents is subject to the terms and
conditions of the subcomponent's license, as noted in the LICENSE file.

56 changes: 52 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,54 @@
extend-cf-docs
==============
cf-docs
====

Documentation on extending Cloud Foundry
This is the documentation for the Cloud Foundry project - including information about running and managing applications on Cloud Foundry, and setting up your own Cloud Foundry instance with VCAP and BOSH.

This repository also feeds [cloudfoundry.github.com](http://cloudfoundry.github.com) using [Github Pages](http://pages.github.com/) and [Middleman](http://middlemanapp.com/).

If you have minor changes, you can contribute by forking this repository, modifying the files in `/source/docs`, and creating a GitHub pull request.

If you want to contribute on a larger scale, see the [Pivotal Project for CF Docs](https://www.pivotaltracker.com/projects/713283#).

## Contributing docs

You can either contribute directly within Github or by cloning the repository to your local machine using git.

## Viewing docs locally

These docs are rendered using [middleman](https://github.com/middleman/middleman). To pull down the raw documentation project and view the docs on your local machine using middleman:

```
git clone https://github.com/cloudfoundry/cf-docs.git cloudfoundry-docs
cd cloudfoundry-docs
bundle
bundle exec middleman server
```

Then view [http://0.0.0.0:4567](http://0.0.0.0:4567) in your browser.

## More help

### Twitter

* Follow the [@cloudfoundry](https://twitter.com/cloudfoundry) Twitter account for retweets of blogs and news from the world of Cloud Foundry
* Search the [#cloudfoundry](https://twitter.com/search/realtime?q=%23cloudfoundry) hashtag to follow discussions about Cloud Foundry

### Discussion Groups

* [Using Cloud Foundry](http://stackoverflow.com/questions/tagged/cloudfoundry) (development-related questions)
* [Running / Setting up Cloud Foundry](https://groups.google.com/a/cloudfoundry.org/forum/?fromgroups#!forum/vcap-dev)
* [Using BOSH](https://groups.google.com/a/cloudfoundry.org/forum/?fromgroups#!forum/bosh-users)
* [Running / Setting up BOSH](https://groups.google.com/a/cloudfoundry.org/forum/?fromgroups#!forum/bosh-dev)

There is also a #cloudfoundry IRC channel on the Freenode network, but that may be less-frequently monitored by members of the core team.

### Bugs

When you are getting started with Cloud Foundry, and are still learning your way around the repositories, you can file bugs in each repo's Github Issue section.

### Support

Support issues that are particular to the Pivotal-hosted Cloud Foundry public PaaS available at http://run.pivotal.io can be filed at the address below.

* [support.cloudfoundry.com](http://support.cloudfoundry.com)

We are experimenting with documentation organization. You can safely ignore this repository for now.
127 changes: 127 additions & 0 deletions config.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
###
# Compass
###

# Susy grids in Compass
# First: gem install susy
# require 'susy'

# Change Compass configuration
# compass_config do |config|
# config.output_style = :compact
# end

###
# Page options, layouts, aliases and proxies
###

# Per-page layout changes:
#
# With no layout
# page "/path/to/file.html", :layout => false
#
# With alternative layout
# page "/path/to/file.html", :layout => :otherlayout
#
# A path which all have the same layout
# with_layout :admin do
# page "/admin/*"
# end

# Proxy (fake) files
# page "/this-page-has-no-template.html", :proxy => "/template-file.html" do
# @which_fake_page = "Rendering a fake page with a variable"
# end

###
# Helpers
###

# Automatic image dimensions on image_tag helper
# activate :automatic_image_sizes

# Methods defined in the helpers block are available in templates
# helpers do
# def some_helper
# "Helping"
# end
# end

require 'navigation'
require 'quicklinks'

set :markdown_engine, :redcarpet
set :markdown, :layout_engine => :erb,
:tables => true,
:autolink => true,
:smartypants => true,
:fenced_code_blocks => true

set :css_dir, 'stylesheets'

set :js_dir, 'javascripts'

set :images_dir, 'images'

# Build-specific configuration
configure :build do
# For example, change the Compass output style for deployment
# activate :minify_css

# Minify Javascript on build
# activate :minify_javascript

# Enable cache buster
# activate :cache_buster

# Use relative URLs
activate :relative_assets

# Compress PNGs after build
# First: gem install middleman-smusher
# require "middleman-smusher"
# activate :smusher

# Or use a different image path
# set :http_path, "/Content/images/"
end

# For syntax highlighting .. middleman-syntax
activate :syntax

# For navigation breadcrumbs
activate :navigation

# For generated intra-page links
activate :quicklinks

# For live reload
# activate :livereload

helpers do
class Middleman::Sitemap::Page
def banner_url
p= "/" + app.images_dir + "/banner/" + self.path.gsub(/\.html$/, ".jpg")
unless File.exists?(app.source_dir+p)
p = self.parent ? self.parent.banner_url : "/" + app.images_dir + "/banner/default.jpg"
end
return p
end

def label
self.data && self.data['menu_title'] || self.parent.nil? ? "home" : File.basename(self.directory_index? ? File.dirname(self.path) : self.path, ".html").gsub("_", " ")
end
end

def banner_img(opts={:width=>700, :height=>120})
image_tag current_page.banner_url, opts
end

# Returns all pages under a certain directory.
def sub_pages(dir)
sitemap.resources.select do |resource|
resource.path.start_with?(dir)
end
end

end
76 changes: 76 additions & 0 deletions navigation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# mostly from https://github.com/multiscan/middleman-navigation but modified slightly
module Navigation
class << self
def registered(app)
app.helpers HelperMethods
end

alias :included :registered
end

class Middleman::Sitemap::Resource
def nonav?
self.data && self.data[:nonav]
end
def hidden?
self.data && self.data['hidden'] || File.basename(self.path, ".html")[-1]=="_" || File.basename(self.path, ".html")[0]=="_" || File.basename(File.dirname(self.path))[0]=="_"
end
def weight
self.data && self.data['weight'] || 0
end
end

module HelperMethods
# create a list item containing the link to a given page.
# If page is the current one, only a span is Class "selected" is added if the page is the current one.
def menu_item(page, options={:li_class=>''})
_options = {
:selected => {:class => "active"},
:wrapper => "%s"
}
options = _options.merge(options)
mylabel = options[:label] || page.data.title #this needed to be changed from page.label to page.data.title
if page==current_page
options[:li_class] += ' ' + options[:selected][:class]
link = content_tag :span, mylabel
else
link = link_to(mylabel, "/"+page.path)
end
link = options[:wrapper] % link
return content_tag :li, link, :class => options[:li_class].strip
end

# create an <ul> list with links to all the childrens of the current page
def children_nav(options={})
p = current_page
return nil if p.nonav?
c = p.children.delete_if{ |m| m.hidden? }
return nil if c.empty?
i = 0;
menu_content = c.sort{ |a,b| a.weight <=> b.weight }.map{ |cc|
i += 1
item_class = (i == 1) ? 'first' : ''
item_class += ' last' if c.length == i
options[:li_class] = item_class
menu_item(cc, options)
}.join("\n")
options.delete(:li_class)
options.delete(:wrapper)
return content_tag :ul, menu_content, options
end

# create an <ul> list with links to all the parent pages down to the root
def trail_nav() # removed sep
p = current_page
res = Array.new
res << menu_item(p)
while p = p.parent
# removed sep
res << menu_item(p)
end
return res.reverse.join(" ") #removed <ul> tags
end
end
end

::Middleman::Extensions.register(:navigation, Navigation)
Loading

0 comments on commit 1b426b0

Please sign in to comment.