From bea275b14d7feef7bbb9a1cd538d1e7b17b0b213 Mon Sep 17 00:00:00 2001 From: Elvis Date: Wed, 8 Jan 2020 22:26:37 -0600 Subject: [PATCH 1/2] change sidebar labels --- website/docs/usage.md | 5 +++++ website/docusaurus.config.js | 2 +- website/sidebars.json | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 website/docs/usage.md diff --git a/website/docs/usage.md b/website/docs/usage.md new file mode 100644 index 0000000..058d1e3 --- /dev/null +++ b/website/docs/usage.md @@ -0,0 +1,5 @@ +--- +id: usage +title: Using the Rainbow Six Siege API +sidebar_label: API Usage +--- \ No newline at end of file diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index c82cceb..2557c67 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -31,7 +31,7 @@ const siteConfig = { }, links: [ {to: 'docs/manifest', label: 'Manifest', position: 'right'}, - {to: 'docs/auto/requests', label: 'API', position: 'right'} + {to: 'docs/usage', label: 'API', position: 'right'} ], }, prism: { diff --git a/website/sidebars.json b/website/sidebars.json index 4e0678f..213d933 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -1,10 +1,10 @@ { "Manifest": { - "Manifest": ["manifest"], - "Explore": ["auto/operators", "auto/seasons", "auto/divisions", "auto/ranks"] + "Using the Manifest": ["manifest"], + "Manifest Explorer": ["auto/operators", "auto/seasons", "auto/divisions", "auto/ranks"] }, "API": { - "API Format": ["auto/requests"] + "API Usage": ["usage"] } } From 72a81de966d6311c4947e52f4c37866822f88134 Mon Sep 17 00:00:00 2001 From: Elvis Date: Wed, 8 Jan 2020 23:15:05 -0600 Subject: [PATCH 2/2] reorganize sidebars some more --- .gitignore | 2 ++ scraper/build.js | 24 ++++++++++-------------- website/docs/{ => api}/usage.md | 2 +- website/docusaurus.config.js | 2 +- website/sidebars.json | 5 +++-- 5 files changed, 17 insertions(+), 18 deletions(-) rename website/docs/{ => api}/usage.md (66%) diff --git a/.gitignore b/.gitignore index 345d58a..2b859e7 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ build website/static/img/assets manifest.json auto +explorer +samples.md .docusaurus # account information .env diff --git a/scraper/build.js b/scraper/build.js index 3d1fb64..32115ea 100644 --- a/scraper/build.js +++ b/scraper/build.js @@ -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` @@ -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 @@ -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 @@ -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 @@ -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 @@ -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") diff --git a/website/docs/usage.md b/website/docs/api/usage.md similarity index 66% rename from website/docs/usage.md rename to website/docs/api/usage.md index 058d1e3..150dfdf 100644 --- a/website/docs/usage.md +++ b/website/docs/api/usage.md @@ -1,5 +1,5 @@ --- id: usage title: Using the Rainbow Six Siege API -sidebar_label: API Usage +sidebar_label: Introduction --- \ No newline at end of file diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 2557c67..8abf0ec 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -31,7 +31,7 @@ const siteConfig = { }, links: [ {to: 'docs/manifest', label: 'Manifest', position: 'right'}, - {to: 'docs/usage', label: 'API', position: 'right'} + {to: 'docs/api/usage', label: 'API', position: 'right'} ], }, prism: { diff --git a/website/sidebars.json b/website/sidebars.json index 213d933..3a53896 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -1,10 +1,11 @@ { "Manifest": { "Using the Manifest": ["manifest"], - "Manifest Explorer": ["auto/operators", "auto/seasons", "auto/divisions", "auto/ranks"] + "Manifest Explorer": ["explorer/operators", "explorer/seasons", "explorer/divisions", "explorer/ranks"] }, "API": { - "API Usage": ["usage"] + "API Usage": ["api/usage"], + "Sample Requests": ["api/samples"] } }