Skip to content

Commit

Permalink
docs: API Reference now presents _index.html_ instead of _full.hml_
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Oct 30, 2024
1 parent 1aac89f commit 574dfd1
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions docs/api_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,12 @@ apiIframe = document.getElementById('apiIframe');
hash = window.location.hash;
if (hash.length == 0) {
// sets default hash for the API Reference
hash = "#full";
hash = "#index.html";
history.pushState(null, "", hash);
}

// set the iframe source based on the hash in the URL
if (hash.startsWith("#wg21.link/")) {
apiIframe.src = "https://" + hash.slice(1);
apiIframe.height = 900;
}
else
apiIframe.src = "gen/" + hash.slice(1) + ".html";
apiIframe.src = "gen/" + hash.slice(1);

// receives content height from the subpage displayed in the iframe
// works only for the pages in the same domain as the main docs
Expand All @@ -57,18 +52,15 @@ iFrameResize({
// obtains the link URL clicked in the subpage
onMessage: function(messageData) {
url = messageData.message;
if (url.startsWith("https://wg21.link/")) {
hash = '#' + messageData.message.replace("https://", "");
if (url.search("api_reference/gen") == -1) {
window.open(url);
}
else {
pos = messageData.message.indexOf('#');
if(pos == -1) {
pos = messageData.message.lastIndexOf('/');
}
hash = '#' + messageData.message.slice(pos + 1);
pos_start = messageData.message.lastIndexOf('/');
hash = '#' + messageData.message.slice(pos_start + 1)
history.pushState(null, "", hash);
window.location.reload();
}
history.pushState(null, "", hash);
window.location.reload();
}
},'#apiIframe')
</script>

0 comments on commit 574dfd1

Please sign in to comment.