Skip to content
This repository has been archived by the owner on Feb 2, 2020. It is now read-only.

Add instructions for using the API #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ build
website/static/img/assets
manifest.json
auto
explorer
samples.md
.docusaurus
# account information
.env
Expand Down
24 changes: 10 additions & 14 deletions scraper/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const debug = DEBUG ? m => console.log(`DEBUG: ${m}`) : () => {};

debug("cleaning up old log files");
const websitePath = "../website"
const docsPath = `${websitePath}/docs/auto`;
const docsPath = `${websitePath}/docs/`;
const explorerPath = `${docsPath}/explorer`;
const distPath = "./dist";
const assetsPath = `${distPath}/assets`

Expand Down Expand Up @@ -372,12 +373,13 @@ const debug = DEBUG ? m => console.log(`DEBUG: ${m}`) : () => {};


fs.mkdirpSync(docsPath);
fs.mkdirpSync(explorerPath);

// auto gen docs for the manifest
// operators
debug("generating docs content")
debug("generating explorer content")
fs.writeFileSync(
`${docsPath}/operators.md`,
`${explorerPath}/operators.md`,
[
"---\nid: operators\ntitle: Operators\nsidebar_label: Operators\n---\n\n This page is automatically generated during the scraping process.",
manifest.allOperators
Expand All @@ -401,7 +403,7 @@ const debug = DEBUG ? m => console.log(`DEBUG: ${m}`) : () => {};
);
// seasons
fs.writeFileSync(
`${docsPath}/seasons.md`,
`${explorerPath}/seasons.md`,
[
"---\nid: seasons\ntitle: Seasons\nsidebar_label: Seasons\n---\n\n This page is automatically generated during the scraping process.",
manifest.allSeasons
Expand All @@ -419,7 +421,7 @@ const debug = DEBUG ? m => console.log(`DEBUG: ${m}`) : () => {};
);
// divisions
fs.writeFileSync(
`${docsPath}/divisions.md`,
`${explorerPath}/divisions.md`,
[
"---\nid: divisions\ntitle: Divisions\nsidebar_label: Divisions\n---\n\n This page is automatically generated during the scraping process.",
manifest.allDivisions
Expand All @@ -444,7 +446,7 @@ const debug = DEBUG ? m => console.log(`DEBUG: ${m}`) : () => {};
);
// ranks
fs.writeFileSync(
`${docsPath}/ranks.md`,
`${explorerPath}/ranks.md`,
[
"---\nid: ranks\ntitle: Ranks\nsidebar_label: Ranks\n---\n\n This page is automatically generated during the scraping process.",
manifest.allRanks
Expand Down Expand Up @@ -591,15 +593,9 @@ const debug = DEBUG ? m => console.log(`DEBUG: ${m}`) : () => {};
} catch (e) {}

fs.writeFileSync(
`${docsPath}/requests.txt`,
["API Format", requests.ascii, detailed.map(getAscii).join("\n\n")].join(
"\n\n"
)
);
fs.writeFileSync(
`${docsPath}/requests.md`,
`${docsPath}/api/samples.md`,
[
"---\nid: requests\ntitle: Sample API Requests\nsidebar_label: Sample Requests\n---",
"---\nid: samples\ntitle: Sample API Requests\nsidebar_label: Sample Requests\n---",
"# API Format\nThis page is generated automatically by the API scraper.",
requests.md,
detailed.map(getMarkdown).join("\n\n")
Expand Down
5 changes: 5 additions & 0 deletions website/docs/api/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
id: usage
title: Using the Rainbow Six Siege API
sidebar_label: Introduction
---
2 changes: 1 addition & 1 deletion website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const siteConfig = {
},
links: [
{to: 'docs/manifest', label: 'Manifest', position: 'right'},
{to: 'docs/auto/requests', label: 'API', position: 'right'}
{to: 'docs/api/usage', label: 'API', position: 'right'}
],
},
prism: {
Expand Down
7 changes: 4 additions & 3 deletions website/sidebars.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"Manifest": {
"Manifest": ["manifest"],
"Explore": ["auto/operators", "auto/seasons", "auto/divisions", "auto/ranks"]
"Using the Manifest": ["manifest"],
"Manifest Explorer": ["explorer/operators", "explorer/seasons", "explorer/divisions", "explorer/ranks"]

},
"API": {
"API Format": ["auto/requests"]
"API Usage": ["api/usage"],
"Sample Requests": ["api/samples"]
}
}