From: Tomas Sedovic <[email protected]>
Previously, we used a separate list of the doc pages for the menu (in
deltacloud.org/content/_submenu_documentation.haml) and for the documentation
Overview page (in docs/documentation.mdown).
This fix adds a single source located in deltacloud.org/lib/documentation.rb
which is used both for the menu and the overview page. It makes
adding/renaming/moving the doc pages easier.
---
deltacloud.org/content/_submenu-documentation.haml | 12 ++----------
deltacloud.org/content/documentation.haml | 11 ++++++++++-
deltacloud.org/lib/documentation.rb | 15 +++++++++++++++
docs/documentation.mdown | 10 ----------
4 files changed, 27 insertions(+), 21 deletions(-)
create mode 100644 deltacloud.org/lib/documentation.rb
delete mode 100644 docs/documentation.mdown
diff --git a/deltacloud.org/content/_submenu-documentation.haml
b/deltacloud.org/content/_submenu-documentation.haml
index 2be4828..e9c9534 100644
--- a/deltacloud.org/content/_submenu-documentation.haml
+++ b/deltacloud.org/content/_submenu-documentation.haml
@@ -1,19 +1,11 @@
---
filter: haml
---
-- menu = [ { :href => 'documentation.html', :text => 'Overview' }, |
- { :href => "api.html" , :text => 'REST API' }, |
- { :href => "drivers.html" , :text => 'Drivers' }, |
- { :href => "image-builder.html" , :text => 'Image Builder' }, |
- { :href => "framework.html" , :text => 'Framework' }, |
- { :href => "client-ruby.html" , :text => 'Ruby Client' }, |
- ] |
-
#subnavigation
#submenu.container
%ul.l1
- - menu.each do |link|
+ - documentation_pages.each do |link|
%li
- state = (link[:href] == current_page) ? 'active' : 'inactive'
%a{:class => state, :href => link[:href]}
- = link[:text]
+ = link[:menu]
diff --git a/deltacloud.org/content/documentation.haml
b/deltacloud.org/content/documentation.haml
index 99f1fcc..78cf752 100644
--- a/deltacloud.org/content/documentation.haml
+++ b/deltacloud.org/content/documentation.haml
@@ -5,4 +5,13 @@ extension: html
filter:
- haml
---
-= render(:partial => "external", :locals => {:path =>
'../docs/documentation.mdown'} )
+%h1 Documentation
+
+%p The Deltacloud documentation is divided into the following parts:
+
+%ul
+ - documentation_pages.each do |doc|
+ - if doc[:description]
+ %li
+ %a{ :href => doc[:href] }
+ = doc[:description]
diff --git a/deltacloud.org/lib/documentation.rb
b/deltacloud.org/lib/documentation.rb
new file mode 100644
index 0000000..a8e76c7
--- /dev/null
+++ b/deltacloud.org/lib/documentation.rb
@@ -0,0 +1,15 @@
+module DocumentationHelper
+ def documentation_pages
+ [
+ { :href => 'documentation.html', :menu => 'Overview' },
+ { :href => "api.html" , :menu => 'REST API', :description => 'REST API
definition' },
+ { :href => "drivers.html" , :menu => 'Drivers', :description =>
'Currently-supported drivers' },
+ { :href => "image-builder.html" , :menu => 'Image Builder', :description
=> 'Image Builder' },
+ { :href => "framework.html" , :menu => 'Framework', :description =>
'Framework for writing additional drivers' },
+ { :href => "client-ruby.html" , :menu => 'Ruby Client', :description =>
'Ruby client' },
+ ]
+ end
+
+end
+
+Webby::Helpers.register(DocumentationHelper)
diff --git a/docs/documentation.mdown b/docs/documentation.mdown
deleted file mode 100644
index 8d169e9..0000000
--- a/docs/documentation.mdown
+++ /dev/null
@@ -1,10 +0,0 @@
-
-# Documentation
-
-The Deltacloud documentation is divided into the following parts:
-
-- [REST API definition](api.html)
-- [Currently-supported drivers](drivers.html)
-- [Image Builder](image-builder.html)
-- [Framework for writing additional drivers](framework.html)
-- [Ruby client](client-ruby.html)
--
1.6.6.1
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel