-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Contiv nav header is now automatically added to API documentation whe…
…n generated Signed-off-by: Bill Robinson <dseevr@users.noreply.github.com>
- Loading branch information
Showing
7 changed files
with
97 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env ruby | ||
# encoding: utf-8 | ||
|
||
require "nokogiri" | ||
|
||
FILENAME = "docs/contiv.html" | ||
|
||
doc = Nokogiri::HTML(File.read(FILENAME)) | ||
|
||
# add trailing slashes to all paths | ||
|
||
node_groups = [ | ||
doc.css(".panel-title a").select { |n| n.text.start_with?("/") }, | ||
doc.css(".modal-title"), | ||
] | ||
|
||
node_groups.flatten.each do |node| | ||
node.children.last.content = node.children.last.text + "/" | ||
end | ||
|
||
# insert additional <head> tag requirements for the contiv header | ||
|
||
doc.at("head") << Nokogiri::HTML::DocumentFragment.parse(File.read("docs/head.html")) | ||
|
||
# insert the contiv header html into the top of the <body> | ||
|
||
doc.at("body").prepend_child(Nokogiri::HTML::DocumentFragment.parse(File.read("docs/body.html"))) | ||
|
||
# overwrite the original HTML file | ||
|
||
File.write(FILENAME, doc.to_html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<div class="navbar-jumbotron"> | ||
<nav class="navbar navbar-inverse navbar-static-top" role="navigation"> | ||
<div class="container"> | ||
<div class="navbar-header"> | ||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> | ||
<span class="sr-only">Toggle navigation</span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
</button> | ||
<a class="navbar-brand" href="/" style="color:$white"> Contiv </a> | ||
</div> | ||
<div class="collapse navbar-collapse" id="navbar"> | ||
<ul class="nav navbar-nav navbar-right main-nav"> | ||
<li><a href="/documents/">Docs</a></li> | ||
<li><a href="https://github.com/contiv/install/releases">Download</a></li> | ||
<li><a href="/documents/support/index.html">Support</a></li> | ||
<li><a href="http://blogs.cisco.com/contiv">Blog</a></li> | ||
|
||
<li><a href="https://github.com/contiv"target="_blank"><i class="fa fa-github" style="color:$white"></i></a></li> | ||
<li><a href="https://contiv.herokuapp.com" target="_blank"><i class="fa fa-slack"style="color:$white"></i></a></li> | ||
</ul> | ||
</div> | ||
</div> | ||
</nav> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<link rel="shortcut icon" href="/assets/images/favicon.png"> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"> |
This file was deleted.
Oops, something went wrong.