Skip to content

Commit

Permalink
Routes and sidebar link are extracted from auth_proxy.html and insert…
Browse files Browse the repository at this point in the history
…ed into contiv.html during build, fixed incorrect verbs in auth_proxy routes

Signed-off-by: Bill Robinson <dseevr@users.noreply.github.com>
  • Loading branch information
dseevr committed Mar 23, 2017
1 parent 1cdf3ac commit 59103c2
Show file tree
Hide file tree
Showing 5 changed files with 930 additions and 206 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# data is extracted from this file and merged into spec/docs/contiv.html as part of the build process
# but we don't actually need to keep it around.
spec/docs/auth_proxy.html
3 changes: 2 additions & 1 deletion spec/auth_proxy.raml
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ securedBy: custom_scheme
/{username}:
type: {collection-item: {provider: auth_proxy}}
displayName: Local User
put:
patch:

/ldap_configuration:
type: {collection-item: {provider: auth_proxy}}
displayName: LDAP Configuration
put:
patch:
22 changes: 18 additions & 4 deletions spec/cleanup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,23 @@

doc = Nokogiri::HTML(File.read(FILENAME))

# add trailing slashes to all paths
# ----- IMPORT AUTH_PROXY DATA ----------------------------------------------------------------------

auth_doc = Nokogiri::HTML(File.read("docs/auth_proxy.html"))

# extract the main panel and sidebar link nodes
auth_panel = auth_doc.css(".panel-default").first
sidebar_link = auth_doc.css("#sidebar ul li").first

# add auth_proxy api panel under the header
doc.at(".page-header").after(auth_panel)

# add auth_proxy link to the top of the sidebar
doc.at("#sidebar ul").prepend_child(sidebar_link)

# ----- TIDY OUTPUT FILE ----------------------------------------------------------------------------

# add trailing slashes to all paths
node_groups = [
doc.css(".panel-title a").select { |n| n.text.start_with?("/") },
doc.css(".modal-title"),
Expand All @@ -19,13 +34,12 @@
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
# ----- OUTPUT --------------------------------------------------------------------------------------

# overwrite the original HTML file
File.write(FILENAME, doc.to_html)
Loading

0 comments on commit 59103c2

Please sign in to comment.