149 lines
5.8 KiB
HTML
149 lines
5.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>SPT-AKI</title>
|
|
<link rel="stylesheet" href="./assets/css/style.css">
|
|
<link rel="stylesheet" href="./assets/css/prism.css">
|
|
</head>
|
|
|
|
<body>
|
|
<header aki-toolbar>
|
|
<a class="left" href="../../index.html">
|
|
<img class="logo" src="./assets/img/logo.png">
|
|
<span class="title text2">
|
|
<span>SPT-AKI - Docs</span>
|
|
</span>
|
|
</a>
|
|
|
|
<nav class="text2 right dropdown">
|
|
<div class="dropdown-button">...</div>
|
|
<div class="dropdown-content">
|
|
<a href="https://www.sp-tarkov.com">Website</a>
|
|
<a href="https://mods.sp-tarkov.com">Workshop</a>
|
|
<a href="https://dev.sp-tarkov.com">Gitea</a>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
|
|
<main>
|
|
<aside></aside>
|
|
<div id="router-outlet" class="doc-typography">
|
|
<div class="text2" style="align-items:center;display:flex;height:100%;justify-content: center;">
|
|
<div aki-card>
|
|
Select a guide on the left to get started.
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
<script src="./assets/js/prism.js"></script>
|
|
<script src="./assets/js/aki-navigator.js"></script>
|
|
<script>
|
|
const routes = {
|
|
"SPT-AKI": {
|
|
"Installing a release": "sp-aki/install.md",
|
|
"About":"spt-aki/about.md",
|
|
"FAQ": "spt-aki/faq.md",
|
|
// TODO: work on routes nesting
|
|
// "foo" : {
|
|
// "item1": "#",
|
|
// "item2": "#"
|
|
// }
|
|
},
|
|
"Tutorials": {
|
|
// Generalist tutorials (walkthrough projects)
|
|
"WorkInProgress":"demo.md"
|
|
},
|
|
"Modding": {
|
|
// Here are guides only related to modifying the server/client.
|
|
"WorkInProgress":"demo.md"
|
|
},
|
|
"DEBUG": {
|
|
"** Markdown Demo": "demo.md"
|
|
},
|
|
|
|
"Tutorials-old":{
|
|
"Create a mod on SP-Tarkov": ".old/tutorials/create_a_mod.md", // TODO: Create a "modding 101 series"
|
|
"How to report a bug": ".old/tutorials/bug-report.md", // TODO: include in FAQ
|
|
"Editing differents things in my player profile": ".old/tutorials/edit_the_player_profile.md",
|
|
"Change some traders behaviour": ".old/tutorials/edit_traders_values.md",
|
|
"How to customize maps values": ".old/tutorials/edit_location_values.md",
|
|
"Change global values of the server": ".old/tutorials/edit_globals_values.md",
|
|
"Edit weapons textures": ".old/tutorials/edit_weapons_textures.md",
|
|
"Edit weapons textures with photoshop": ".old/tutorials/photoshop_texture_editing.md",
|
|
"Customize weather presets": ".old/tutorials/create_weather.md",
|
|
"Add new bundles to the game": ".old/tutorials/add_new_bundles.md"
|
|
},
|
|
"Modding":{
|
|
"All items stats resources":"resources/itemsStats_resources.md",
|
|
"All locations resources":"resources/locations_resources.md",
|
|
"All player profile resources":"resources/playerProfile_resources.md",
|
|
"All quest resources":"resources/quests_resources.md",
|
|
"All other resources":"resources/other_resources.md"
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Populates the <aside> element in the page
|
|
* based on the `routes` object content.
|
|
*/
|
|
function populateNav() {
|
|
Object.entries(routes).forEach(([key, node]) => {
|
|
const sectionTitle = document.createElement('div');
|
|
sectionTitle.classList.add('subheader');
|
|
sectionTitle.innerText = key;
|
|
|
|
const sectionList = document.createElement('ul');
|
|
// sectionTitle.appendChild(sectionList);
|
|
|
|
Object.entries(node).forEach(([k, v]) => {
|
|
const listItem = document.createElement('li');
|
|
const link = document.createElement('a');
|
|
link.innerText = k;
|
|
link.href = `#${v}`;
|
|
|
|
listItem.appendChild(link);
|
|
// listItem.setAttribute('link', v);
|
|
// listItem.innerText = k;
|
|
|
|
// The nav binding
|
|
listItem.addEventListener('click', e => {
|
|
if (e.target && e.target.hasAttribute('link')) {
|
|
window.location.hash = e.target.getAttribute('link');
|
|
}
|
|
});
|
|
|
|
sectionList.appendChild(listItem);
|
|
});
|
|
|
|
const divider = document.createElement('hr');
|
|
divider.setAttribute('aki-divider', '');
|
|
|
|
const nav = document.querySelector('aside');
|
|
nav.appendChild(sectionTitle);
|
|
nav.appendChild(sectionList);
|
|
nav.appendChild(divider);
|
|
});
|
|
}
|
|
|
|
populateNav();
|
|
|
|
// Dirty override
|
|
class AkiNavigatorDocs extends AkiNavigator {
|
|
async fetchView(view) {
|
|
const response = await fetch(`${this.fetchPath}/${view}`);
|
|
const text = await response.text();
|
|
|
|
this.removeChildren(this.contentOutlet);
|
|
this.contentOutlet.innerHTML = marked(text); // edited
|
|
Prism.highlightAll(); // edited
|
|
}
|
|
}
|
|
|
|
const akiNavigator = new AkiNavigatorDocs(undefined, 'md');
|
|
</script>
|
|
</body> |