Jump to content

Extension:OpenJsCad

From mediawiki.org
MediaWiki extensions manual
OpenJsCad
Release status: experimental
Implementation Tag
Description Allows embedding of OpenJsCad Designs
Author(s) Wolfgang Fahl (WolfgangFahltalk)
Latest version 0.0.1 (2019-06-11)
MediaWiki >= 1.31.0
Database changes No
License Apache License 2.0
Download
Quarterly downloads 0
Translate the OpenJsCad extension if it is available at translatewiki.net
Issues Open tasks · Report a bug

Purpose

[edit]

Allows to embed 3D Designs created with https://www.openjscad.org/ for display in your wikipage.

Usage

[edit]
{{jscad|title=OpenJSCAD example|code=function main() {
    return CSG.cube({radius:[15,15,15]});
}
}}

Installation

[edit]
  • Download and move the extracted OpenJsCad folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/OpenJsCad
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'OpenJsCad' );
    
  • OpenJsCad is best used with a template that hides the ‎<jscad> tag

Here is an example:

<includeonly>
= {{{title|}}} =
{{#tag:jscad|{{{code|}}}}}
= Source code =
{{#tag:source|{{{code|}}}|lang=javascript}}
[[Category:OpenJSCAD]]
</includeonly>
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.