Page 10 of 17

Re: The Future of the QL Wiki

Posted: Tue Jul 18, 2017 8:05 pm
by NormanDunbar
Evening Simon,

Interesting, yes, bug quite fun to program, and that's half the battle!


Cheers,
Norm.

Re: The Future of the QL Wiki

Posted: Tue Jul 25, 2017 5:38 pm
by NormanDunbar
Right then, I have a tested system running to convert a wiki page (of source text, not the generated html) into almost anything you like.

https://github.com/NormanDunbar/QLWikiConverter

The working branch is the place to be for now.

The file convert_template.txt should explain how you get from a wiki page to whatever else you need or want.

I'll be sorting out some proper conversions soon. I have one that converts the wiki page to html, just for testing, which works well. Unfortunately at work, images on the Web appear blocked as does the ability to embed you tube videos. I need to test from home.

Hopefully, this will help convert to other wiki formats, etc, as we see fit.

You still need to compile the code with a decent c++ compiler, for now, on windows or Linux. Embarcadero give one away for free. JGI! (Just Google It!) :D



Cheers,
Norm.

Re: The Future of the QL Wiki

Posted: Wed Jul 26, 2017 3:08 pm
by NormanDunbar
Bloody Hell! :evil: :evil: :evil:

More lunchtime testing showed up that the Wiki software isn't too keen of enforcing its own standards. Many of the Citations in the Wiki are missing the "source" part. A citation is supposed to be:

Code: Select all

^^citation text | source^^
and while we have many of those, especially the stuff about the Turbo Compiler from SNG, we also have many which don't have the source, as per:

Code: Select all

^^citation text^^


This makes a mockery of any conversion code as it cannot cope (cleanly) with both formats. I'm going to have to do some more thinking now!

EDIT: Thinking done. Solution implemented - we have a conversion text for both types of Citation. This is fixed. I just need to come up with a way of referencing the links to Wiki Pages now. At the moment I just like to "pagename.html" but pages with spaces in their names are a tad upsetting.

However, I do now have the entire Wiki in HTML format! :P

Cheers,
Norm.

Re: The Future of the QL Wiki

Posted: Fri Jul 28, 2017 4:06 pm
by NormanDunbar
It has been completed!
Just in time for a break too. :)

The place to go for the source code (at the moment!) is my repository on GitHub:

https://github.com/NormanDunbar/QLWikiConverter

There you will find a README that explains it all, briefly.

The MYSQL folder has a script that can be run against the Wiki database, to extract the content to a file. This file is then fed into WikiPager to create, in the current folder, a pile of new files, one for each Wiki Page (and language). Those individual files can then be fed (one by one) into RwapWiki, along with a converter data file (much like the beloved Printer.dat used by Quill etc) and the output will be a converted Wiki Page, hopefully in the desired format.

I have provided a blank template file that you can copy and edit to create a new conversion file of your choice. I have also supplied an example convert.HTML.txt file, that can be used to convert pages from Wiki Source code to HTML pages.

At the moment you will need to compile the code yourselves. I've written it cross-platform, so it should compile on Windows and Linux, but it's only tested on Linux so far. It doesn't use anything scary except standard C++ and the STL. It compiles with GCC.

There's a project file for anyone using CodeBlocks as their IDE (That's cross platform too!) and you can still get a free C++ compiler from Embarcadero.com if you are on Windows. It is probably the best C++ compiler available (on Windows!)

Linux users already have G++.

To compile is simple:

Code: Select all

CPP -o wikipager.exe main.cpp
where CPP is the name of your C++ compiler. The other utility, rwapwiki, compiles in a similar manner.

All you need to do is get hold of the output file from the "content.sql" script. I have an older version of the WIki, that Rich sent me some time back, perhaps it could be made available in a recent state? Or even better, the output from running the "content.sql" script in the MySQL folder as follows:

Code: Select all

mysql -u root -p <content.sql >wiki_content.out
The wiki_content.out is in the desired format for WikiPager to process.


Cheers,
Norm.

Re: The Future of the QL Wiki

Posted: Fri Jul 28, 2017 4:15 pm
by RWAP
The latest database is attached.

I can't run the commands on the server, as the Wiki is currently on a shared server with cpanel access only - so no easy way to compile scripts etc

Re: The Future of the QL Wiki

Posted: Fri Jul 28, 2017 5:28 pm
by NormanDunbar
Thanks Rich, I'll extract it from the dump.

I'm off to Scotland for a couple of weeks, so if I go quiet, that's why. Off to the countryside where WiFi and or broadband don't exist in usable form. As Dilwyn knows from his own location.

Cheers,
Norm.

Re: The Future of the QL Wiki

Posted: Fri Jul 28, 2017 5:33 pm
by dilwyn
NormanDunbar wrote:Thanks Rich, I'll extract it from the dump.

I'm off to Scotland for a couple of weeks, so if I go quiet, that's why. Off to the countryside where WiFi and or broadband don't exist in usable form. As Dilwyn knows from his own location.

Cheers,
Norm.
Hmph, don't remind me :D

Raining heavily here so happy for an excuse to do nothing but QLing (as if excuse needed). Error 404: "Summer Does Not Exist In Wales: Please Upgrade."

Re: The Future of the QL Wiki

Posted: Fri Jul 28, 2017 6:01 pm
by NormanDunbar
Same in Yorkshire Dilwyn.
And Scotland.
C'est la vie - as they might say in Cardiff!

Not that I mind, hayfever and sunburn (fragile Jock!) Are not a problem in the rain!


Cheers,
Norm.

Re: The Future of the QL Wiki

Posted: Fri Jul 28, 2017 8:44 pm
by XorA
NormanDunbar wrote: I'm off to Scotland for a couple of weeks, so if I go quiet, that's why. Off to the countryside where WiFi and or broadband don't exist in usable form. As Dilwyn knows from his own location.
Us picts even have Fibre these days :)

Re: The Future of the QL Wiki

Posted: Fri Jul 28, 2017 10:26 pm
by NormanDunbar
XorA wrote:Us picts even have Fibre these days :)
Maybe in the Central Belt, but not where I'm heading! Even back home, which is Elgin, there's only copper. So my brother tells me anyway.

Cheers,
Norm.