Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G

Difference between revisions of "FlightGear wiki:Howto: Wiki addon development"

From FlightGear wiki
Jump to: navigation, search
m (Background)
m (cat: FlightGear wiki)
 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{Stub}}
 
{{Stub}}
 +
[[File:ContentMonster-web-extension.png|thumb|Screenshot showing the web-extension port of the '''InstantRefs''' user-script in FireFox.]]
  
 
== Status ==
 
== Status ==
 +
As of 03/2018, we have two different scripts to help with editing the FlightGear wiki. And we're looking for ways to integrate/port them to the web extension framework (JavaScript), probably with node.js support, so that the low-level helpers can also be tested/used without requiring a browser.
  
 
== Objective ==
 
== Objective ==
 +
Come up with a single unified browser addon (web-extension) to help with editing the Flightgear wiki and work around some of its limitations.
  
 
== Background ==
 
== Background ==
 
+
{{Usr|dot_sent}} came up with a tool for editing the FlightGear wiki, it's written in Perl and the source code is on Github: [https://github.com/dot-sent/FlightGearWikiClient https://github.com/dot-sent/FlightGearWikiClient]<ref>{{cite web
dot_sent came up with a tool for editing the FlightGear wiki, it's written in Perl and the source code is on Github, feel free to lurk around and modify to your taste if you feel like it: [https://github.com/dot-sent/FlightGearWikiClient https://github.com/dot-sent/FlightGearWikiClient]<ref>{{cite web
+
 
   |url    =  https://forum.flightgear.org/viewtopic.php?p=327225&sid=4386fdefe5b4aa93279a605b5125c9d0#p327225  
 
   |url    =  https://forum.flightgear.org/viewtopic.php?p=327225&sid=4386fdefe5b4aa93279a605b5125c9d0#p327225  
 
   |title  =  <nowiki> My personal solution to Wiki bugs </nowiki>  
 
   |title  =  <nowiki> My personal solution to Wiki bugs </nowiki>  
Line 28: Line 30:
 
   }}</ref>
 
   }}</ref>
  
 +
This step also cause a number of regressions, because we are no longer using certain dependencies, e.g. jQuery.
 +
Also, the conceptual split into so called '''content scripts''' and '''background scripts''' made it necessary to  move certain functionality out of the original userscript.
  
We're  now exploring if it makes sense to integrate both "scripts" to grow a library of useful tools and APIs.
+
We're  now exploring if it makes sense to integrate both "scripts" to grow a library of useful tools and APIs to help edit/maintain the FlightGear wiki.
  
 
== Requirements ==
 
== Requirements ==
 +
{{Note|Strictly speaking, web-ext/npm isn't really required  currently - i.e. you can just as well test the addon  by installing it temporarily via the <code>about:debugging</code> tab in firefox}}
 
For the sake of simplicity, it's recommended to have the following tools installed:
 
For the sake of simplicity, it's recommended to have the following tools installed:
  
Line 40: Line 45:
  
 
== Testing the extension ==
 
== Testing the extension ==
{{WIP}}
+
{{Note|When using web-ext to test the extension, this will set up a new firefox profile, so that features using persistent settings, won't work as expected}}
 +
 
 +
* download the ZIP file: https://ufile.io/kwrbm
 +
* extract it to a new directory, change to that dir
 +
* execute <code>web-ext run</code> inside the new directory
 +
* in firefox, go to a supported forum/mailing list URL
 +
* make a selection using the mouse
 +
* to configure the addon, go to <code>about:addons</code> and navigate to the "Preferences" button next to the extension's entry.
 +
* to install the dependencies of the headless script (node.js), run <code>npm install</code> inside the extension folder
 +
 
 +
== Known Issues ==
 +
== Dependencies ==
 +
List of dependencies that we may want to evaluate:
 +
 
 +
=== Wiki API ===
 +
* https://www.npmjs.com/package/wikijs (>2k downloads/month)
 +
* https://www.npmjs.com/package/nodemw (~700 downloads/month)
 +
* https://www.npmjs.com/package/mwbot (~300 downloads/month)
 +
 
 +
== Development ==
 +
 
 +
== Roadmap ==
 +
* restore mediawiki access using a wrapper to encapsulate https://www.npmjs.com/package/mediawiki
 +
* restore storage support
 +
* restore UI/wizard support
  
 
== Related ==
 
== Related ==
 
{{Appendix}}
 
{{Appendix}}
 +
 +
[[Category:FlightGear wiki]]

Latest revision as of 11:10, 13 August 2019

This article is a stub. You can help the wiki by expanding it.
Screenshot showing the web-extension port of the InstantRefs user-script in FireFox.

Status

As of 03/2018, we have two different scripts to help with editing the FlightGear wiki. And we're looking for ways to integrate/port them to the web extension framework (JavaScript), probably with node.js support, so that the low-level helpers can also be tested/used without requiring a browser.

Objective

Come up with a single unified browser addon (web-extension) to help with editing the Flightgear wiki and work around some of its limitations.

Background

dot_sent came up with a tool for editing the FlightGear wiki, it's written in Perl and the source code is on Github: https://github.com/dot-sent/FlightGearWikiClient[1]

In addition, there is the Instant-Cquotes script (written in JavaScript) which started out as a userscript (via GreaseMonkey), which got meanwhile ported to the Web extension framework. dot_sent mentioned plans to also use JavaScript for his tool.

Originally, Instant-Cquotes started out as JavaScript-based tool to edit the FlightGear wiki which was created over the years to aggregate community discussions, i.e. to help bootstrap new wiki articles and help maintain those articles that are no longer actively maintained. It's a rather simple piece of code actually that grew over time - originally it was just a UserScript using Greasemonkey - more recently, it's been ported to the Web Extension framework.[2]

This step also cause a number of regressions, because we are no longer using certain dependencies, e.g. jQuery. Also, the conceptual split into so called content scripts and background scripts made it necessary to move certain functionality out of the original userscript.

We're now exploring if it makes sense to integrate both "scripts" to grow a library of useful tools and APIs to help edit/maintain the FlightGear wiki.

Requirements

Note  Strictly speaking, web-ext/npm isn't really required currently - i.e. you can just as well test the addon by installing it temporarily via the about:debugging tab in firefox

For the sake of simplicity, it's recommended to have the following tools installed:

  • git (version control)
  • npm (package manager, used to install web-ext)
  • node.js (javascript for the console)
  • web-ext (tool used to actually develop/test web extensions)

Testing the extension

Note  When using web-ext to test the extension, this will set up a new firefox profile, so that features using persistent settings, won't work as expected
  • download the ZIP file: https://ufile.io/kwrbm
  • extract it to a new directory, change to that dir
  • execute web-ext run inside the new directory
  • in firefox, go to a supported forum/mailing list URL
  • make a selection using the mouse
  • to configure the addon, go to about:addons and navigate to the "Preferences" button next to the extension's entry.
  • to install the dependencies of the headless script (node.js), run npm install inside the extension folder

Known Issues

Dependencies

List of dependencies that we may want to evaluate:

Wiki API

Development

Roadmap

Related

References
  1. dot_sent  (Feb 1st, 2018).  My personal solution to Wiki bugs .
  2. Hooray  (Feb 2nd, 2018).  Re: My personal solution to Wiki bugs .