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

Fixing links in docs #520

Merged
merged 5 commits into from
Sep 15, 2023
Merged
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
85 changes: 29 additions & 56 deletions docs/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ const configData = {
name: 'Alpaca-OwO',
category: configCategories[1],
website: 'https://github.com/Project-Alpaca/Alpaca-OwO',
desc: 'Arcade controller I/O platform designed by <a target="_blank" href="https://github.com/dogtopus">dogtopus</a>.'
desc: 'Arcade controller I/O platform designed by <a href="https://github.com/dogtopus">dogtopus</a>.'
},
BentoBox: {
name: 'ScrubTier BentoBox',
category: configCategories[2],
website: 'https://github.com/OpenStickCommunity/GP2040-CE/tree/RP2040-arcade-board/configs/BentoBox',
website: 'https://github.com/OpenStickCommunity/GP2040-CE/tree/main/configs/BentoBox',
desc: ''
},
DURAL: {
Expand All @@ -40,19 +40,19 @@ const configData = {
name: 'Flatbox Rev 4',
category: configCategories[1],
website: 'https://github.com/jfedor2/flatbox/tree/master/hardware-rev4',
desc: 'Stickless PCB designed by <a target="_blank" href="https://github.com/jfedor2">jfedor2</a> using an embedded RP2040 chip.'
desc: 'Stickless PCB designed by <a href="https://github.com/jfedor2">jfedor2</a> using an embedded RP2040 chip.'
},
FlatboxRev5: {
name: 'Flatbox Rev 5',
category: configCategories[1],
website: 'https://github.com/jfedor2/flatbox/tree/master/hardware-rev5',
desc: 'Stickless PCB designed by <a target="_blank" href="https://github.com/jfedor2">jfedor2</a> using the Waveshare RP2040-Zero.'
desc: 'Stickless PCB designed by <a href="https://github.com/jfedor2">jfedor2</a> using the Waveshare RP2040-Zero.'
},
FlatboxRev5RGB: {
name: 'Flatbox Rev 5 RGB',
category: configCategories[1],
website: 'https://github.com/OpenStickCommunity/Hardware/tree/main/Flatbox%20Rev%205%20RGB',
desc: 'Stickless PCB designed by <a target="_blank" href="https://github.com/jfedor2">jfedor2</a> and <a target="_blank" href="https://github.com/TheTrainGoes">TheTrain</a> using the Waveshare RP2040-Zero.'
desc: 'Stickless PCB designed by <a href="https://github.com/jfedor2">jfedor2</a> and <a href="https://github.com/TheTrainGoes">TheTrain</a> using the Waveshare RP2040-Zero.'
},
KB2040: {
name: 'Adafruit KB2040',
Expand All @@ -70,7 +70,7 @@ const configData = {
MavercadeKeebfighter: {
name: 'Mavercade Keebfighter',
category: configCategories[2],
website: 'https://github.com/OpenStickCommunity/GP2040-CE/tree/RP2040-arcade-board/configs/MavercadeKeebfighter',
website: 'https://github.com/OpenStickCommunity/GP2040-CE/tree/main/configs/MavercadeKeebfighter',
desc: ''
},
Pico: {
Expand All @@ -91,7 +91,7 @@ const configData = {
name: 'Pico Fighting Board',
category: configCategories[1],
website: 'https://github.com/FeralAI/PicoFightingBoard',
desc: 'Arcade encoder board designed by <a target="_blank" href="https://github.com/FeralAI">FeralAI</a> using a Raspberry Pi Pico or pin-equivalent RP2040 board.'
desc: 'Arcade encoder board designed by <a href="https://github.com/FeralAI">FeralAI</a> using a Raspberry Pi Pico or pin-equivalent RP2040 board.'
},
PicoW: {
name: 'Raspberry Pi Pico W',
Expand All @@ -105,53 +105,53 @@ const configData = {
name: 'RP2040 Advanced Breakout',
category: configCategories[1],
website: 'https://github.com/OpenStickCommunity/Hardware/tree/main/RP2040%20Advanced%20Breakout%20Board',
desc: 'Arcade encoder board designed by <a target="_blank" href="https://github.com/TheTrainGoes">TheTrain</a> using an embedded RP2040, and is the official board of the GP2040-CE project.'
desc: 'Arcade encoder board designed by <a href="https://github.com/TheTrainGoes">TheTrain</a> using an embedded RP2040, and is the official board of the GP2040-CE project.'
},
RP2040MiniBreakoutBoard: {
name: 'RP2040 Mini Breakout',
category: configCategories[1],
website: 'https://github.com/OpenStickCommunity/Hardware/tree/main/RP2040%20Mini%20Breakout%20Board',
desc: 'A reduced-footprint spin off of the RP2040 Advanced Breakout Board designed by <a target="_blank" href="https://github.com/TheTrainGoes">TheTrain</a>.'
desc: 'A reduced-footprint spin off of the RP2040 Advanced Breakout Board designed by <a href="https://github.com/TheTrainGoes">TheTrain</a>.'
},
ReflexEncoder: {
name: 'Reflex Arcade Encoder',
category: configCategories[1],
website: 'https://github.com/misteraddons/ReflexFightingBoard',
desc: 'Arcade encoder board designed and sold by <a target="_blank" href="https://github.com/misteraddons">MiSTerAddons</a> using an embedded RP2040 chip.'
desc: 'Arcade encoder board designed and sold by <a href="https://github.com/misteraddons">MiSTerAddons</a> using an embedded RP2040 chip.'
},
ReflexCtrlSNES: {
name: 'Reflex CTRL SNES',
category: configCategories[1],
website: 'https://github.com/misteraddons/Reflex-CTRL',
desc: 'Reflex Board Open source PCB for SNES Controller replacement PCBs designed and sold by <a target="_blank" href="https://github.com/misteraddons">MiSTerAddons</a> using an embedded RP2040 chip.'
desc: 'Reflex Board Open source PCB for SNES Controller replacement PCBs designed and sold by <a href="https://github.com/misteraddons">MiSTerAddons</a> using an embedded RP2040 chip.'
},
SGFDevices: {
name: 'SGF Flatbox',
category: configCategories[1],
website: 'https://github.com/sgfdevices/SGFlatbox',
desc: 'Configuration for the <a target="_blank" href="https://github.com/sgfdevices/SGFlatbox">SGF Flatbox-based controllers</a>, based on the excellent revisions of the Flatbox design by jfedor2 powered by an RP2040 MCU.'
desc: 'Configuration for the <a href="https://github.com/sgfdevices/SGFlatbox">SGF Flatbox-based controllers</a>, based on the excellent revisions of the Flatbox design by jfedor2 powered by an RP2040 MCU.'
},
SparkFunProMicro: {
name: 'SparkFun Pro Micro',
category: configCategories[0],
pos: 2,
pinout: '/#/wiring?id=sparkfun-pro-micro-rp2040',
website: 'https://learn.sparkfun.com/tutorials/pro-micro-rp2040-hookup-guide',
desc: 'An RP2040 board in the Pro Micro form factor. This build is a drop-in replacement for the <a target="_blank" href="https://github.com/MickGyver/DaemonBite-Arcade-Encoder">Daemonbite Arcade Encoder</a>.'
desc: 'An RP2040 board in the Pro Micro form factor. This build is a drop-in replacement for the <a href="https://github.com/MickGyver/DaemonBite-Arcade-Encoder">Daemonbite Arcade Encoder</a>.'
},
Stress: {
name: 'Stress',
category: configCategories[1],
website: 'https://github.com/GroooveBob/Stress',
desc: 'A small and portable PCB-as-a-controller designed by <a target="_blank" href="https://github.com/GroooveBob">GroooveBob</a> using the Waveshare RP-2040-Zero.'
desc: 'A small and portable PCB-as-a-controller designed by <a href="https://github.com/GroooveBob">GroooveBob</a> using the Waveshare RP-2040-Zero.'
},
WaveshareZero: {
name: 'Waveshare RP2040-Zero',
category: configCategories[0],
pos: 3,
pinout: '/#/wiring?id=waveshare-rp2040-zero',
website: 'https://www.waveshare.com/wiki/RP2040-Zero',
desc: 'The <a target="_blank" href="https://www.waveshare.com/rp2040-zero.htm">Waveshare RP2040-Zero</a> is a small form factor board with castellated pins and USB-C, making this a popular choice for custom built PCBs without the need for SMT assembly.'
desc: 'The <a href="https://www.waveshare.com/rp2040-zero.htm">Waveshare RP2040-Zero</a> is a small form factor board with castellated pins and USB-C, making this a popular choice for custom built PCBs without the need for SMT assembly.'
},
};

Expand All @@ -163,6 +163,8 @@ window.$docsify = {
loadSidebar: '_sidebar.md',
auto2top: true,
subMaxLevel: 3,
externalLinkTarget: '_self',
cornerExternalLinkTarget: '_self',
themeable: {
readyTransition : true, // default
responsiveTables: true // default
Expand Down Expand Up @@ -205,13 +207,13 @@ window.$docsify = {
</a>
</li>
<li v-if="release.pinout">
<a :href="release.pinout" target="_blank">
<a :href="release.pinout">
<i class="fa-solid fa-gamepad fa-2xl"></i>
Pinout
</a>
</li>
<li v-if="release.website">
<a :href="release.website" target="_blank">
<a :href="release.website">
<i class="fa-solid fa-globe fa-2xl"></i>
Website
</a>
Expand Down Expand Up @@ -312,13 +314,19 @@ window.$docsify = {

this.$root.releaseNotes = releaseInfo.body;
this.$root.releaseVersion = releaseInfo.name;
if (window.location.hostname === 'localhost') {
this.$root.releases = Object.keys(this.configData)
.map(key => {

this.$root.releases = releaseInfo.assets
.filter(a => a.name.startsWith('GP2040-CE_'))
.filter(a => {
const key = a.name.substring(a.name.lastIndexOf('_') + 1).replace('.uf2', '');
return Object.keys(this.configData).indexOf(key) > -1;
})
.map(a => {
const key = a.name.substring(a.name.lastIndexOf('_') + 1).replace('.uf2', '');
return {
key,
...this.configData[key],
url: '',
url: a.browser_download_url,
img: `/assets/boards/${key}.jpg`,
};
})
Expand All @@ -336,41 +344,6 @@ window.$docsify = {
values[r.category].push(r);
return values;
}, { });
}
else {
this.$root.releases = releaseInfo.assets
.filter(a => a.name.startsWith('GP2040-CE_'))
.filter(a => {
const key = a.name.substring(a.name.lastIndexOf('_') + 1).replace('.uf2', '');
return Object.keys(this.configData).indexOf(key) > -1;
})
.map(a => {
const key = a.name.substring(a.name.lastIndexOf('_') + 1).replace('.uf2', '');
return {
key,
...this.configData[key],
url: a.browser_download_url,
img: `/assets/boards/${key}.jpg`,
};
})
.sort((a, b) => {
if (a.name < b.name) return -1;
if (a.name > b.name) return 1;
return 0;
})
.sort((a, b) => (a.pos === undefined ? Number.MAX_VALUE : a.pos) - (b.pos === undefined ? Number.MAX_VALUE : b.pos))
.reduce((p, r) => {
let values = { ...p };
if (!values[r.category])
values[r.category] = [];

values[r.category].push(r);
return values;
}, { });
}


console.log(this.$root.releases);

this.fetched = true;
});
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "",
"scripts": {
"start": "docsify serve ./"
"start": "docsify serve ./ --open"
},
"keywords": [],
"author": "",
Expand Down