Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to embed the docson documentation per html tab generated by java script #54

Open
Shanthisagar272 opened this issue Mar 25, 2017 · 0 comments

Comments

@Shanthisagar272
Copy link

Shanthisagar272 commented Mar 25, 2017

I am trying to create a html page for the json schemas where documentation of every schema is on a seperate Tab as below.
But the problem I am facing is the json documentation is not going into the tab, but just outside the tab
And also it keeps on appending to the existing html page.

I believe the issue is in the below lines
var element = $("

");
$("body").append(element);
docson.doc(element, item);

Kindly let me know how to resolve this

<title> Canonical Data Model JSON Draft 4 Schemas</title> <script src="lib/require.js"></script> <style> body {font-family: "Lato", sans-serif;}

/* Style the tab */
div.tab {
overflow: hidden;
border: 1px solid #ccc;
background-color: #f1f1f1;
}

/* Style the buttons inside the tab */
div.tab button {
background-color: inherit;
float: left;
border: none;
outline: none;
cursor: pointer;
padding: 14px 16px;
transition: 0.3s;
font-size: 17px;
}

/* Change background color of buttons on hover */
div.tab button:hover {
background-color: #ddd;
}

/* Create an active/current tablink class */
div.tab button.active {
background-color: #ccc;
}

/* Style the tab content */
.tabcontent {
display: none;
padding: 6px 12px;
border: 1px solid #ccc;
border-top: none;
-webkit-animation: fadeEffect 1s;
animation: fadeEffect 1s;
}

/* Fade in tabs */
@-webkit-keyframes fadeEffect {
from {opacity: 0;}
to {opacity: 1;}
}

@Keyframes fadeEffect {
from {opacity: 0;}
to {opacity: 1;}
}

/* Style the close button */
.topright {
float: right;
cursor: pointer;
font-size: 20px;
}

.topright:hover {color: red;}
</style>

Logistic User Contract
x

Logistic User

Schema defining the user for the logistic operations

x

Contract

Schema defining the Contract.

<script charset="utf-8"> function openSchema(evt, schemaName) { var i, tabcontent, tablinks; tabcontent = document.getElementsByClassName("tabcontent"); for (i = 0; i < tabcontent.length; i++) { tabcontent[i].style.display = "none"; } tablinks = document.getElementsByClassName("tablinks"); for (i = 0; i < tablinks.length; i++) { tablinks[i].className = tablinks[i].className.replace(" active", ""); } document.getElementById(schemaName).style.display = "block"; evt.currentTarget.className += " active"; require(["docson", "lib/jquery"], function(docson) { docson.templateBaseUrl="templates"; $(function() { $.get(schemaName + ".json").done(function(item) { var element = $("
"); $("body").append(element); docson.doc(element, item); }); }); }); } </script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant