Imported Templates not working on MediaWiki - mediawiki

I am quite new to Mediawiki and am trying to get templates work.
I managed to get a simple one working but the templates are shown in a weird way but no error is provided.

I looked at your template:
http://wordpress-251650-782015.cloudwaysapps.com/index.php?title=Template:Cita_conferenza
And it invokes a LUA module:
http://wordpress-251650-782015.cloudwaysapps.com/wiki/Modulo:Citazione
You can read more information about using this module on
https://it.wikipedia.org/wiki/Modulo:Citazione

#Revious
A bit late, but you may still be interested...
If you want to copy a template from Wikipedia, but it is using lua modules, you can look in the history tab to find pre-lua versions that use only wikicode (lua has been implemented in 2013 in Wikipedia, but some templates have been given modules later).
Here, it seems to be this version
Be careful, however, if the template you are copying uses subtemplates (this does not seem to be the case here).
If this is the case, you should either make copies of the templates with the same name and code, or add their code to the main template, paying attention to the parameter names which will need to be adapted.
Good luck.

Related

NativeScript, Code Sharing and different environments

Note: this is not a dupe of this or this other question. Read on: this question is specific to the Code-Sharing template.
I am doing some pretty basic experiments with NativeScript, Angular and the code sharing templates (see: #nativescript/schematics).
Now I am doing some exploration / poc work on how different "build configuration" are supported by the framework. To be clear, I am searching for a simple -and hopefully official- way to have the application use a different version of a specific file (let's call it configuration.ts) based on the current platform (web/ios/android) and environment (development/production/staging?).
Doing the first part is obviously trivial - after all that is the prime purpose of the code sharing schematics. So, different versions of the same file are identified by different extensions. This page explain things pretty simply.
What I don't get as easily is if the framework/template supports any similar convention-based rule that can be used to switch between debug/release (or even better development/staging/production) versions of a file. Think for example of a config.ts file that contains different parameters based on the environment.
I have done some research in the topic, but I was unable to find a conclusive answer:
the old and now retired documentation for the appbuilder platform mentions a (.debug. and .release.) naming convention for files. I don't think this work anymore.
other sources mention passing parameters during the call to tns build / tns run and then fetching them via webpack env variable... See here. This may work, but seems oddly convoluted
third option that gets mentioned is to use hooks to customize the build (or use a plugin that should do the same)
lastly, for some odd reason, the #nativescript/schematics seems to generate a default project that contains two files called environment.ts and environment.prod.ts. I suspect those only work for the web version of the project (read: ng serve) - I wasn't able to get the mobile compiler to recognize files that end with debug.ts, prod.ts or release.ts
While it may be possible that what I am trying to do isn't just supported (yet?), the general confusion an dissenting opinions on the matter make me think I may be missing something.. somewhere.
In case this IS somehow supported, I also wonder how it may integrate with the NativeScript Sidekick app that is often suggested as a tool to ease the build/run process of NativeScript applications (there is no way to specify additional parameters for the tns commands that the Sidekick automates, the only options available are switching between debug/release mode), but this is probably better to be left for another question.
Environment files are not yet supported, passing environment variables from build command could be the viable solution for now.
But of course, you may write your own schematics if you like immediate support for environment files.
I did not look into sharing environment files between web and mobile yet - I do like Manoj's suggestion regarding modifying the schematics, but I'll have to cross that bridge when I get there I guess. I might have an answer to your second question regarding Sidekick. The latest version does support "Webpack" build option which seems to pass the --bundle parameter to tns. The caveat is that this option seems to be more sensitive to typescript errors, even relatively benign ones, so you have to be careful and make sure to fix them all prior to building. In my case I had to lock the version of #types/jasmine in package.json to "2.8.6" in order to avoid some incompatibility between that and the version of typescript that Sidekick's cloud solution is using. Another hint is to check "Clean Build" after npm dependency changes are made. Good luck!

Publish MATLAB class documentation to HTML

I am creating a MATLAB package using object-oriented programming. I have documented my classes according to a tutorial from MathWorks website. This standard of documentation, however, only works for doc and help commands, but not when I use publish. For example, properties, which have their description written in front of their declaration, don't have said declaration exported to HTML. There is no list of properties or methods at the beginning of the file, so that users can quickly skip to those. Lastly, documentation has to be read directly from the comments in the code, instead of being parsed to HTML.
When I try to add some HTML documentation inside my classes to publish them, the code also appears on doc and help, which is an undesired behavior. Is there a way to create class documentation so that properties and methods can be published to the Web? I've had experience with doc generators like Sphinx (Python) and Doxygen (many languages), in which the descriptions of classes, methods and properties are parsed to HTML so they can be published in places like Read the Docs or GitHub Pages so I am curious to know if MATLAB has something like that.
You can give a try to MTOC++ which uses Doxygen, therefore produces the standard Doxygen HTML documentation.
I have used it already to generate source code documentation for Matlab project containing standard Matlab functions, old class definitions with # notation and classes defined by classdef mixed, and it worked after some tailoring.
This somewhat larger project allows to create documentation for MatLab
files and classes (including packages) using a doxygen filter named
mtoc++. Moreover, a tool/class named MatlabDocMaker allows to create
the documentation from within MatLab. For Windows, Mac and Unix!
You can find it also on Mathworks File Exchange and you can find the documentation here.
One widely-used way to provide HTML documentation for MATLAB functions/class is the M2HTML project. It will automatically generate HTML documentation complete with dependency graphs, source code, and syntax highlighting.

Pretty-print Lua source-code in external file, without embedding it in the HTML file

Since my experience with HTML is fairly rudimentary (and pretty old), I am not sure if my requirement is realistic.
Lets say that I have quite a few files containing Lua source-code, and all of them have the ".lua" extension and available in a particular subdirectory. What I'd like to do is create a static index.html file, which when loaded in a browser, would show the list of the lua source-code files in a drop-down. Once one of the source-code files is selected, I'd like that the file gets loaded into an "area" on the same page, and is pretty-printed, i.e. with syntax-highlighting in browser. I was wondering if I could use something like the google-code-prettyfy for the syntax-highlighting part ? Also, I am not clear if an external lua sourcecode file can be loaded, and displayed within a certain region of html page as being rendered. If yes, would appreciate elaboration on the how part.
A tool like LDoc can be used to accomplish a lot of what you want, much as Doxygen would be used for a C language source kit.
Both are heavily driven by inclusion of specially formatted comments that carry documentation.
I know Doxygen can fold source code into the generated document set, I don't recall about LDoc. Both are actively under development.
It isn't necessarily a bad idea to use both tools on a project, especially if you have C source code implementing Lua modules. You could use Doxygen to build the overall document tree for your engine and C modules, and LDoc to build documentation of the Lua parts. It should be possible with a little care and configuration of both tools to get them to play well together.

Copy and paste articles/namespaces

This might be a far fetched question, but here it goes:
I'm trying to configure a MediaWiki and I'm grouping content into namespaces. I need to find a reasonably easy way for copying a namespace (including content) and pasting it with a different name. First of all: is this possible? Are there any extensions for this? I've looked a bit at the MediaWiki database and I can implement my own software if it is needed, but there are a lot of tables, so if you can give any guidelines it would be nice!
Well this was easily solved. Just export everything by using Special:Export (Special:AllPages can filter by namespace). You can then parse the exported file and change for instance the content between each <title> tag to whatever you want. For example the name of the namespace or subpage you want to transfer the content to.
When you're done you just import it back by using Special:Import.

Using HTML Helpers in Node.js?

There are so many template engines for node.js and express and there is even this detailed comparison: http://paularmstrong.github.com/node-templates/index.html This led me to check out EJS, Mu2 and JQTpl and I spent some hours on experimenting which of them fits my needs best.
I know that there already are several questions concerning which framework is best, but none of them concentrates on the possibility of using helpers. I tried to build a form helper (which should render input tags and their values if I pass an object into it) together with all of them but I did not find a straight forward way accomplishing it.
Are there any recommendable modules that enable me to use helpers? Maybe even using mustache.js (which - for me - feels like the best of the ones I tried)? Thanks in advance!
I can't point you to the comparison you are looking for, but nearly all the templating engines I've looked at have had a facility for helpers.
If you are using Express (which you mentioned in your question), you can tell Express what helpers you want to expose to whatever template engine you are using (set via the "view engine" app variable) - see the following sections of the Express Guide for details:
View Rendering - explains how to configure Express to use a particular templating engine. The example refers to Jade, which is installed with Express by default, and does support helpers.
Server.helpers() - How to register static view helpers to be passed to your template
Server.dynamicHelpers() How to register helpers which can access the Request and Response objects
Some template engines come with support for Express built in, although they may require an extra configuration step. I am partial to CoffeeKup (and the more updated fork coffeecup), which lets you write your views in Coffeescript; enabling auto-compilation requires and extra call to the Express server object (and covered in the docs):
app.register('.coffee', coffeecup.adapters.express);
Others may offer an additional node package, you may find npm search express- instructive. For example, express-handlebars specifically fixes up app.helpers() and app.dynamicHelpers() to work with handlebars. (Disclaimer: I haven't used this module personally).