OrangeNote / RuneBook

📖 arcane Rune Pages manager for League of Legends 📜
MIT License
95 stars 65 forks source link

I need help to try and add functionality #58

Open 0k4 opened 6 years ago

0k4 commented 6 years ago

Hey,

I was wondering if it's a good idea to perhaps add probuilds. We could add a button that adds runes from probuilds, and then also includes a link to the page where it got the runes from to quickly check the build :) Could you tell me where in the code you'd add a new site, and how I'd create a button? I'll try do it and fork and a pull request if you like the idea.

Kind Regards.

OrangeNote commented 6 years ago

Hi! I'm happy to hear that you're interested in adding a new source for pages.

RuneBook has a plugin system for external sites. The only thing you have to do is to create a new js file in the /plugins folder. RuneBook will take care of the rest, and it will add a tab for you. The js plugin must export a default object that has some properties and methods. I actually never documented this part, but you can look at other existing plugin as reference. Every site is different, so it's up to you how to configure the plugin and how to implement the required methods. Again, looking at existing plugins might be a good way to get started.

OrangeNote commented 6 years ago

For the link to the external site: it's something that RuneBook doesn't support at the moment and I don't think there's a way to make it happen only through custom logic in the plugin.

0k4 commented 5 years ago

Hey! Thanks for the pointers! I have some free time next week and will have a crack at it then. I've take a quick look at the code already and it's as you mentioned. I could easily add it, but the hard part will be getting the content from the divs on probuilds itself. But I'll use your extractfunctions on other sites and run it on them to check exactly what you expect to be extracted.