Skip to content
This repository has been archived by the owner on Aug 31, 2019. It is now read-only.

Web vs XML portal/documentation #55

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions src/_layouts/default.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!!! 5
%html
%head
%title PGM XML Documentation
%title Overcast Network Documentation
%meta{:"http-equiv" => "Content-Type", :content => "text/html;charset=utf-8"}
%meta{:name => "viewport", :content => "width=device-width, initial-scale=1.0"}
- @rand = SecureRandom.hex(13)
Expand All @@ -21,30 +21,35 @@
.navbar-header
%a.navbar-brand{:href => "/"}
%img{:src => "https://oc.tc/assets/logo.png"}
PGM XML Documentation
Overcast Network Documentation
%button.navbar-toggle{:type => "button", :"data-toggle" => "collapse", :"data-target" => ".navbar-main-collapse"}
%span.sr-only Toggle navigation
%span.icon-bar
%span.icon-bar
%span.icon-bar
%nav.collapse.navbar-collapse.navbar-main-collapse
%ul.nav.navbar-nav.navbar-right
%li{:class => (current_page.include?("index") ? "active" : "")}
%li{:class => (current_page.include?("/src/index") ? "active" : "")}
%a{:href => "/"}
%i.glyphicon.glyphicon-home
Home
%li{:class => (current_page.include?("modules") ? "active" : "")}
%a{:href => "/modules/main"}
%i.glyphicon.glyphicon-th-large
Modules
%li{:class => (current_page.include?("reference") ? "active" : "")}
%a{:href => "/reference/inventory"}
%i.glyphicon.glyphicon-book
Reference
%li{:class => (current_page.include?("examples") ? "active" : "")}
%a{:href => "/examples"}
Overview
%li{:class => (current_page.include?("/src/xml") ? "active" : "")}
%a{:href => "/xml/"}
%i.glyphicon.glyphicon-file
Examples
XML Docs
%li{:class => (current_page.include?("/src/api") ? "active" : "")}
%a{:href => "/api/"}
%i.glyphicon.glyphicon-globe
API Docs
- if current_page.include?("/xml/")
.container
%ul.nav.nav-tabs.subnav
= partial('xml_nav')
- elsif current_page.include?("/api/")
.container
%ul.nav.nav-tabs.subnav
= partial('api_nav')

= yield
.container
%hr
Expand Down
8 changes: 8 additions & 0 deletions src/_partials/api_nav.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
%li.pull-right{:class => (current_page.include?("/src/api/reference") ? "active" : "")}
%a{:href => "/api/reference/"}
%i.glyphicon.glyphicon-book
Reference
%li.pull-right{:class => (current_page.match(/\/src\/api\/[^\/]*$/) != nil ? "active" : "")}
%a{:href => "/api/"}
%i.glyphicon.glyphicon-transfer
Usage
10 changes: 5 additions & 5 deletions src/_partials/examples_sidebar.haml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
- @nav_title = "Map XML Examples"
- @subnav_content = [\
- {"path" => "examples/snowy_wars", "name" => "Snowy Wars"},\
- {"path" => "examples/viridun", "name" => "Viridun"},\
- {"path" => "examples/harb", "name" => "Harb"},\
- {"path" => "examples/rfv3", "name" => "Race For Victory 3"},\
- {"path" => "examples/eldritch", "name" => "GS: Eldritch"}]
- {"path" => "xml/examples/snowy_wars", "name" => "Snowy Wars"},\
- {"path" => "xml/examples/viridun", "name" => "Viridun"},\
- {"path" => "xml/examples/harb", "name" => "Harb"},\
- {"path" => "xml/examples/rfv3", "name" => "Race For Victory 3"},\
- {"path" => "xml/examples/eldritch", "name" => "GS: Eldritch"}]

= partial('sidebar')
58 changes: 29 additions & 29 deletions src/_partials/modules_sidebar.haml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
- @nav_title = "XML Modules"
- @subnav_content = [\
- {"path" => "modules/main", "name" => "Main Map Element"},\
- {"path" => "modules/includes", "name" => "XML File Includes"},\
- {"path" => "modules/tutorial", "name" => "Map Tutorial"},\
- {"path" => "xml/", "name" => "Main Map Element", "match" => /xml\/index\.[^\/]*$/},\
- {"path" => "xml/includes", "name" => "XML File Includes"},\
- {"path" => "xml/tutorial", "name" => "Map Tutorial"},\
- "Game Modes",\
- {"path" => "modules/gamemode_ctw", "name" => "Capture the Wool"},\
- {"path" => "modules/gamemode_dtm", "name" => "Destroy the Monument"},\
- {"path" => "modules/gamemode_blitz", "name" => "Blitz"},\
- {"path" => "modules/gamemode_dtc", "name" => "Destroy the Core"},\
- {"path" => "modules/gamemode_tdm", "name" => "Team Death-match"},\
- {"path" => "modules/gamemode_other", "name" => "Other Game Modes"},\
- {"path" => "xml/gamemode_ctw", "name" => "Capture the Wool"},\
- {"path" => "xml/gamemode_dtm", "name" => "Destroy the Monument"},\
- {"path" => "xml/gamemode_blitz", "name" => "Blitz"},\
- {"path" => "xml/gamemode_dtc", "name" => "Destroy the Core"},\
- {"path" => "xml/gamemode_tdm", "name" => "Team Death-match"},\
- {"path" => "xml/gamemode_other", "name" => "Other Game Modes"},\
- "Game Settings",\
- {"path" => "modules/teams", "name" => "Teams"},\
- {"path" => "modules/rules", "name" => "Rules"},\
- {"path" => "modules/kits", "name" => "Kits"},\
- {"path" => "modules/classes", "name" => "Classes"},\
- {"path" => "modules/items", "name" => "Items & Armor"},\
- {"path" => "modules/potions", "name" => "Potion Effects"},\
- {"path" => "modules/repair_remove", "name" => "Repair & Remove"},\
- {"path" => "modules/disabledamage", "name" => "Disable Damage"},\
- {"path" => "modules/projectiles", "name" => "Projectiles"},\
- {"path" => "modules/tnt", "name" => "TNT"},\
- {"path" => "modules/mobs", "name" => "Mob Spawning"},\
- {"path" => "modules/killreward", "name" => "Kill Reward"},\
- {"path" => "modules/other_settings", "name" => "Other Settings"},\
- {"path" => "xml/teams", "name" => "Teams"},\
- {"path" => "xml/rules", "name" => "Rules"},\
- {"path" => "xml/kits", "name" => "Kits"},\
- {"path" => "xml/classes", "name" => "Classes"},\
- {"path" => "xml/items", "name" => "Items & Armor"},\
- {"path" => "xml/potions", "name" => "Potion Effects"},\
- {"path" => "xml/repair_remove", "name" => "Repair & Remove"},\
- {"path" => "xml/disabledamage", "name" => "Disable Damage"},\
- {"path" => "xml/projectiles", "name" => "Projectiles"},\
- {"path" => "xml/tnt", "name" => "TNT"},\
- {"path" => "xml/mobs", "name" => "Mob Spawning"},\
- {"path" => "xml/killreward", "name" => "Kill Reward"},\
- {"path" => "xml/other_settings", "name" => "Other Settings"},\
- "Filters & Regions",\
- {"path" => "modules/filters", "name" => "Filters"},\
- {"path" => "modules/regions", "name" => "Regions"},\
- {"path" => "modules/spawns", "name" => "Spawns"},\
- {"path" => "modules/playable_region", "name" => "Playable Region"},\
- {"path" => "modules/lanes", "name" => "Lanes"},\
- {"path" => "modules/portals", "name" => "Portals"},\
- {"path" => "modules/score_boxes", "name" => "Score Boxes"}]
- {"path" => "xml/filters", "name" => "Filters"},\
- {"path" => "xml/regions", "name" => "Regions"},\
- {"path" => "xml/spawns", "name" => "Spawns"},\
- {"path" => "xml/playable_region", "name" => "Playable Region"},\
- {"path" => "xml/lanes", "name" => "Lanes"},\
- {"path" => "xml/portals", "name" => "Portals"},\
- {"path" => "xml/score_boxes", "name" => "Score Boxes"}]

= partial('sidebar')
8 changes: 4 additions & 4 deletions src/_partials/reference_sidebar.haml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
- @nav_title = "General Reference"
- @subnav_content = [\
- {"path" => "reference/inventory", "name" => "Inventory"},\
- {"path" => "reference/formatting", "name" => "Formatting & Colors"},\
- {"path" => "reference/enchantments", "name" => "Enchantments"},\
- {"path" => "reference/potion_effects", "name" => "Potions"}]
- {"path" => "xml/reference/inventory", "name" => "Inventory"},\
- {"path" => "xml/reference/formatting", "name" => "Formatting & Colors"},\
- {"path" => "xml/reference/enchantments", "name" => "Enchantments"},\
- {"path" => "xml/reference/potion_effects", "name" => "Potions"}]

= partial('sidebar')
16 changes: 12 additions & 4 deletions src/_partials/sidebar.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
%ul.dropdown-menu.subnav-dropdown{:role => "menu", :"style" => "width: 100%;"}
- @subnav_content.each do |item|
- if item.kind_of?(Hash)
%li{:class => (current_page.include?("#{item['path']}") ? "active" : "")}
%a{:href => "/#{item['path']}"} #{item['name']}
- if item.has_key?('match')
%li{:class => (current_page.match(item['match']) ? "active" : "")}
%a{:href => "/#{item['path']}"} #{item['name']}
- else
%li{:class => (current_page.include?("#{item['path']}") ? "active" : "")}
%a{:href => "/#{item['path']}"} #{item['name']}
- elsif item.kind_of?(String)
%li.divider
%li.dropdown-header #{item}
Expand All @@ -17,8 +21,12 @@
%ul.nav.nav-pills.nav-stacked.docs-nav-pills
- @subnav_content.each do |item|
- if item.kind_of?(Hash)
%li{:class => (current_page.include?("#{item['path']}") ? "active" : "")}
%a{:href => "/#{item['path']}"} #{item['name']}
- if item.has_key?('match')
%li{:class => (current_page.match(item['match']) ? "active" : "")}
%a{:href => "/#{item['path']}"} #{item['name']}
- else
%li{:class => (current_page.include?("#{item['path']}") ? "active" : "")}
%a{:href => "/#{item['path']}"} #{item['name']}
- elsif item.kind_of?(String)
%li
%h4 #{item}
12 changes: 12 additions & 0 deletions src/_partials/xml_nav.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
%li.pull-right{:class => (current_page.include?("/src/xml/examples") ? "active" : "")}
%a{:href => "/xml/examples/"}
%i.glyphicon.glyphicon-file
Examples
%li.pull-right{:class => (current_page.include?("/src/xml/reference") ? "active" : "")}
%a{:href => "/xml/reference/inventory"}
%i.glyphicon.glyphicon-book
Reference
%li.pull-right{:class => (current_page.match(/\/src\/xml\/[^\/]*$/) != nil ? "active" : "")}
%a{:href => "/xml/"}
%i.glyphicon.glyphicon-th-large
Modules
13 changes: 13 additions & 0 deletions src/api/index.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.container
.jumbotron.jumbotron-mini
%h1 Web API Documentation
%p.lead Usage
%section
.alert.alert-danger
%strong Heads up!
The Web API is currently in
%i BETA
and this information is subject to change without notice.
.alert.alert-info
%strong No documentation yet.
As the Web API takes more shape these pages will fill up.
13 changes: 13 additions & 0 deletions src/api/reference/index.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.container
.jumbotron.jumbotron-mini
%h1 Web API Documentation
%p.lead Reference
%section
.alert.alert-danger
%strong Heads up!
The Web API is currently in
%i BETA
and this information is subject to change without notice.
.alert.alert-info
%strong No documentation yet.
As the Web API takes more shape these pages will fill up.
56 changes: 46 additions & 10 deletions src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ body {
float: left;
}

.navbar a i.glyphicon {
.navbar a i.glyphicon,
.subnav a i.glyphicon {
font-size: 12px;
margin-bottom: 1px;
}
Expand All @@ -24,23 +25,19 @@ body {
background-color: #e7e7e7;
}

.jumbotron {
.jumbotron-mini {
position: relative;
color: #fff;
background: #450f43;
-webkit-box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2);
-moz-box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2);
-moz-box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2);
box-shadow: inset 0 3px 7px rgba(0,0,0,.2), inset 0 -3px 7px rgba(0,0,0,.2);
}

/* Jumbotron pattern overlay
------------------------- */
.jumbotron .container {
position: relative;
z-index: 2;
}

.jumbotron:after {
.jumbotron-mini:after {
background: url("../img/grid-15px.png") repeat scroll center center transparent;
content: '';
display: block;
Expand All @@ -50,10 +47,36 @@ body {
bottom: 0;
left: 0;
opacity: .8;
z-index: 0;
}

@media (min-width: 768px) {
.jumbotron-mini {
padding: 30px 30px;
padding-bottom: 20px;
}
.jumbotron-mini h1 {
font-size: 45px;
}
.jumbotron-mini .lead {
font-size: 20px;
}
}
@media (max-width: 767px) {
.jumbotron-mini {
padding: 24px 40px;
padding-bottom: 14px;
}
}
.jumbotron-mini .lead {
margin-bottom: 10px;
}
.jumbotron-mini h1 {
margin-top: 0;
}

code {
padding: 1px 4px;
padding: 1px 4px;
}

.right-ref-link {
Expand All @@ -75,10 +98,23 @@ code {
float: none !important;
}

.subnav {
margin-bottom: 30px;
}

.docs-nav-pills > li > a {
position: relative;
display: block;
padding: 8px 14px;
padding: 3px 15px
}

.docs-nav-pills h4 {
padding-bottom: 5px;
border-bottom: 1px solid #ddd;
}

.well h1 {
margin-top: 0;
}

.dropdown-menu > .active > a{
Expand Down
52 changes: 48 additions & 4 deletions src/index.haml
Original file line number Diff line number Diff line change
@@ -1,8 +1,52 @@
.container
.jumbotron.subhead
%h1 PGM XML Documentation
%p.lead Documentation on XML files that are required for each map added to the servers
%section
.page-header
%h1 Welcome
%p These docs provide valuable information to be used when coding XML files. XML files are needed in order for any map released on the Overcast Network to function. The XML defines aspects of the game such as spawn points, kits and more.
%p
Documentation pertaining to XML files and the web API can be found here.
%p
This information is useful to people who wish to create XML files for maps; or Overcast Network related minecraft mods, applications, etc.
%br
.row
.col-md-6.text-center
.well
%h1
%i.glyphicon.glyphicon-file
%h4 XML Documentation
%p
These docs provide valuable information for coding
%br
XML files. XML files are needed in order for any map
%br
released on the Overcast Network to function. The XML
%br
defines aspects of the game such as spawn points, kits and more.
%a.btn.btn-primary.btn-lg{:href => "/xml/"} Browse the XML docs


.col-md-6.text-center
.well
%h1
%i.glyphicon.glyphicon-globe
%h4 Web API Documentation
%p
Here you can find out how to access data relating to the
%br
Overcast Network and its users. This API can be used to
%br
query a users score, maps currently being played, and more.
%br
%b Note:
The Web API is incomplete and in
%i BETA.
%a.btn.btn-primary.btn-lg{:href => "/api/"} Browse the API docs

%p.text-muted
This documentation is open source and can be found on
= succeed '.' do
%a{:href => "https://github.com/OvercastNetwork/docs.oc.tc/", :target => :blank} GitHub
If you see any errors or lack of information, feel free to
%a{:href => "https://github.com/OvercastNetwork/docs.oc.tc/issues/new", :target => :blank} report an issue
or
= succeed '.' do
%a{:href => "https://github.com/OvercastNetwork/docs.oc.tc/fork", :target => :blank} make a pull request
2 changes: 1 addition & 1 deletion src/modules/classes.haml → src/xml/classes.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.container
.jumbotron.subhead
.jumbotron.jumbotron-mini
%h1 Modules
%p.lead Game Settings
%section
Expand Down
Loading