Include and parse file (hosted on external site) as wikitext with MediaWiki - mediawiki

With MediaWiki, is there any way to include a text file hosted on another site/server and parse that file as wikitext? Is there any way to include a text file at all?

It's easy to write an extension to do that. MediawikiInclude is an example, although it might not work with the current version of MediaWiki.

Related

Convert mediawiki to word documents

I am trying to move a mediawiki site to confluence v5. Confluence now no longer support using the Universal Wiki Converter (UWC) for version 5. Confluence has advised that they accept "page and page tree imports in the form of Word Documents" or "Confluence Space Exports and Confluence Site Exports".
Therefore I need a way on converting the mediawiki pages into word documents, as well as retaining the structure.
Currently, I have used mediawiki's dumpBackup.phpto create an XML dump of my wiki. I then used a mediawikiXML_exporter.php. This created a exported_mediawiki_pages/directory containing all Pages, File, Categories, Projects, and Users. I checked and all my pages and these files contained mediawiki versions of all my pages and users etc, but stored as .txt files.
Given I cannot use UWC to upload this to confluence, is there a way to convert to a docx format so that I can upload into confluence?
P.S. I'm well aware I may be doing with the wrong approach so if there is a better way to do this from scratch, I'm open to any solution.
You could try https://www.mediawiki.org/wiki/Extension:Collection to convert it to a PDF document, and then see if you can maybe convert that to word.

WordPress generated files edited with HTML

After basic knowledge of HTML/CSS/JS and Jquery, I got myself into WordPress. In order to save time and not build things from zero, I would use pre-made templates, and modify them according to the built of the desired future webpage. There might be a huge misconception in my head, but so far I havent found reply for this solution.
I have a locally running WordPress webpage with the help of WAMP. My webpage would consist 3 separate HTML files, lets say "index.html, contact.html, about.html". My issue is that after generating those pages in WordPress, I dont find any way to modify the HTML file of those sites. Nor locally in my computer, nor in the surface of WordPress. I found the "editor" function in WP, but apparently it lets me to edit only the CSS file.
My main goal is to generate the file with a template, than import it to BRACKETS / ATOM / etc and custom-shape the HTML and CSS on it. What am I missing ?
Thanks,
Wordpress only has templates it uses according to the type of content (page, blog post or any other custom post type you define in the theme) requested. All your actual data is stored in the mysql database. This data is retrieved and inserted into the template and then the generated file is sent to the client. So, you wont find any .html files in the wordpress core. My suggestion is to view the source in the browser, copy, paste and edit in your favourite editor.
I think you are using HTML files as a template which are not dynamically converted into wordpress theme. that's why you can't edit these files. You need to follow these steps.
1. your index file must be in index.php not index.html
2. style.css file with valid codes and most important thing is you need to know wordpress theme development. https://developer.wordpress.org/themes/basics/template-files/ This will help you

Can i put a .doc or .txt for displaying data in html

I just wonder if i can put a .doc or .txt files in the html instead of placing too much code in showing the data. I think that should be some method but i m not sure about it
You can put a direct URL to a .doc or .txt file on your server without even using HTML if that's most convenient. A browser will typically display .txt files right in the browser itself. A .doc file would likely be offered to store on disk so you can use a program like Word to view it.
If you are talking about embedding data into an existing HTML page there are ways to do so but it would require knowing more about your server. Are you using PHP to respond to requests?
You can use a number of methods to acheive this. Most commonly used are php includes if the server is capable of executing php scripts. Javascript is also commonly used and there are many examples of how to do this. This could also be achieved using SSI (server side include) but this method is not commonly used and requires renaming the file with .shtml extension
Hope this helps.

Different code style settings in PhpStorm for php files based on file extension?

I'm using PhpStorm (and love it!), but the coding standard for my current project uses 4 space indents for .php files and 2 space indents for template files (.phtml). The template files are traditional php and HTML. Our code implements a standard Zend Framwork MVC setup.
Is there a way to configure PhpStorm to use one set of code style settings for *.php files and a different set of code style settings for *.phtml files?
Setting::File Type didn't work
I've tried associating .phtml files with the HTML file type, but that causes me to lose ALL php language assistance (no PHP syntax highlighting, no code assist, etc.).
Settings::Template Data Languages didn't work
I also looked for a solution using the the Template Data Languages setting. I setup my .phtml files to the File Type HTML, but PHP isn't an available setting, so it appears there is no way to add php language support for HTML files.
AFAIK it is not possible.
If you want to have PHP support, file extension has to be associated with PHP file type. That's the only way to have PHP support as PHP is not injectable language in current PhpStorm version/implementation.
You may utilize TextMate bundles support plugin and install PHP supported highlighting there. This will allow to assign .phtml extension to another file type. The drawback is that you can only have one language highlighting .. so HTML will not be highlighted + no code completion for actual PHP (that's as far as my simple experiments went with other not-yet-supported languages).

tool to create from plain html file a .po file used for translation

i am using the http://i18next.com/ to translate a static website hosted on github gh-pages.
are there any tools that i can use to first extract from say the index.html file and create a index.po file where the translator can localize / internationalize the page and then use a tool like http://pypi.python.org/pypi/pojson to convert this po file to json to be used by i18next?
POEdit will probably do the trick. In PHP, the Gettext extension (http://es.php.net/gettext) will help. Also, I found this link that will detail the process of creating a po file: http://www.wdmac.com/how-to-create-a-po-language-translation.
You can use po4a for creating po files from html and from many other formats.