Loading...
 

Tiki Importer


Importing wiki-formatted text with HTML via script

I’d like to take Office documents and import them into Tiki Wiki without any user intervention (other than dropping the file in the appropriate directory).

Here’s what I’ve accomplished so far:

1. Got Unoconv working with Perl’s HTML::WikiConverter
2. Took a word doc and converted it to HTML/wiki format

I know it’s possible to create pages from the output of these steps manually by going to Edit a new page, and insert HTML content with the option to “Parse wiki syntax within the html code.” enabled. However, I’m looking to automate the process. Any idea how I might do this?

Here’s what I’ve gathered so far. Start with the “tiki-editpage.php” code, and somehow call “lib/wiki-plugins/wikiplugin_html.php” to make the appropriate conversion, and then eventually create the page. However, I’ve no clue how to go about this, other than mimic the steps a user would follow to do this process manually (by clicking the “HTML” button in the toolbar, copying/pasting the HTML-wiki content, and saving).

Brazil

Hi Alex,

If you know PHP check the method TikiLib::create_page() (file lib/tikilib.php). It does exactly what you need.

There is an example on how to use it in the code of the Mediawiki importer. See the function TikiImporter_Wiki::insertPage() (file lib/importer/tikiimporter_wiki.php

Rodrigo

alexescalona wrote:

I’d like to take Office documents and import them into Tiki Wiki without any user intervention (other than dropping the file in the appropriate directory).

Here’s what I’ve accomplished so far:

1. Got Unoconv working with Perl’s HTML::WikiConverter
2. Took a word doc and converted it to HTML/wiki format

I know it’s possible to create pages from the output of these steps manually by going to Edit a new page, and insert HTML content with the option to “Parse wiki syntax within the html code.” enabled. However, I’m looking to automate the process. Any idea how I might do this?

Here’s what I’ve gathered so far. Start with the “tiki-editpage.php” code, and somehow call “lib/wiki-plugins/wikiplugin_html.php” to make the appropriate conversion, and then eventually create the page. However, I’ve no clue how to go about this, other than mimic the steps a user would follow to do this process manually (by clicking the “HTML” button in the toolbar, copying/pasting the HTML-wiki content, and saving).


Why Register?

Register at tiki.org and you'll be able to use the account at any *.tiki.org site, thanks to the InterTiki feature. A valid email address is required to receive site notifications and occasional newsletters. You can opt out of these items at any time.