Fandom Developers Wiki
m ({{Script Install}} template cleanup)
(cropped letter; wording)
Line 9: Line 9:
 
|Code =
 
|Code =
 
* [[MediaWiki:FAQ/code.js|code.js]]
 
* [[MediaWiki:FAQ/code.js|code.js]]
* [[MediaWiki:FAQ/style.css|style.css]] <small>(already included in code.js)</small>
+
* [[MediaWiki:FAQ/style.css|style.css]] <small>(imported in code.js)</small>
 
}}
 
}}
'''FAQ''' dds a page to the wiki where user can find FAQ.
+
'''FAQ''' adds a page to the wiki where user can find FAQ.
   
 
== Configuration ==
 
== Configuration ==
 
* Target page defaults to "Project:FAQ" but you can change it by setting <code>window.dev.faq.page</code> to the preferred page
 
* Target page defaults to "Project:FAQ" but you can change it by setting <code>window.dev.faq.page</code> to the preferred page
* FAQ data are stored and loaded from in '''MediaWiki:Custom-FAQ.json''', so put all your contents there in json format ([[w:c:de.harrypotter:MediaWiki:Custom-FAQ.json|example]]).
+
* FAQ data are stored and loaded from in '''MediaWiki:Custom-FAQ.json''', so put all your contents there in JSON format ([[w:c:de.harrypotter:MediaWiki:Custom-FAQ.json|example]]).
   
 
=== Dataset Structure ===
 
=== Dataset Structure ===

Revision as of 16:05, 25 June 2018

This script/stylesheet is for PERSONAL use only!

You are free to install this script/stylesheet for yourself, but it is not allowed to be used wiki-wide (e.g., in MediaWiki:ImportJS, MediaWiki:Common.js, MediaWiki:Common.css, MediaWiki:Fandomdesktop.js or MediaWiki:Fandomdesktop.css), as it would violate Fandom's Terms of Use.
(See the customization policy)

FAQ adds a page to the wiki where user can find FAQ.

Configuration

  • Target page defaults to "Project:FAQ" but you can change it by setting window.dev.faq.page to the preferred page
  • FAQ data are stored and loaded from in MediaWiki:Custom-FAQ.json, so put all your contents there in JSON format (example).

Dataset Structure

Key Type Remarks
id int Unique running number to identify
question  string
answer  string
related object
  • articles (string[]): Article Names
  • discussions (object)
    • title (string)
    • p (string): post id after /d/p/
keywords  string[]

Installation

Importing multiple scripts? This quick guide shows how to combine the imports.
  • For personal use, add the code snippet below to your global.js page (for use on all wikis) or your common.js page on your wiki (for use on a single wiki). Note that personal JS must be enabled for your account.
importArticles({
    type: 'script',
    articles: [
        'u:dev:MediaWiki:FAQ/code.js',
    ]
});

Changelog

2018-05-28
Added support for wikicode

Planned Features

  • Search for questions
    • by keywords
    • maybe grouping?
  • Add question
  • Edit/Delete question