Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   Realm Works Discussion (http://forums.wolflair.com/forumdisplay.php?f=67)
-   -   Realm Works Output Formatter (http://forums.wolflair.com/showthread.php?t=59981)

Farling January 21st, 2018 09:56 AM

Realm Works Output Formatter
 
Since the existing community output tool at http://forums.wolflair.com/showthread.php?t=57418 has been discontinued, I have started work on a tool which will convert the RWoutput format into other presentation formats.

NOTE: This tool will NEVER be able to export "protected" content, such as material sold on the Content Market (since that data is never present in the RWoutput file generated by Realm Works).

The file can be downloaded from https://github.com/farling42/RWoutpu...-installer.exe

Instructions for Use

1. Within Realm Works, from the "Share" tab of the ribbon, select "Manage Exports", enter some data and then select "Compact Output". This will generate a file in your "Realm Works\Output" folder whose name ends with ".rwoutput".

2. Launch the RWoutput tool, press the "LOAD rwoutput FILE" button and select the file created in step 1.

3. If a separate web page is desired for each topic, then ensure that the "Separate Topic Files" option is selected.

4. If you want to restrict the width of images to something more suitable for web pages, then choose the width in the "Max. Width (pixels)" menu. Optionally choose the "apply reveal mask" if your export should hide unrevealed parts of maps.

5. Choose one of the output options.

5.1 Create HTML file(s) will create XHTML files containing lots of formatting. (Word does not support importing XHTML files, see HTML4 below).

5.2 Create PDF file - experimental, and might not always work.

5.3 Print - print the output to a printer, you could choose the "print to PDF" printer on windows 10 for a more reliable PDF output.

5.4 Create HTML4 file - this is the intermediate file for printing and PDF generation; so why not have it available. This format can also be imported into Word (and possibly other editors).

Uninspiring, but Simple Interface

https://user-images.githubuserconten...c5caa7078b.png

Farling January 21st, 2018 09:56 AM

Release Notes

v2.7
All links within web pages will now contain additional information in their tooltip, gleaned from the first section of the linked topic.

v2.6
Map pin tooltips will auto-populate from the linked topic if they aren't already defined to have some contents and/or gm-directions.

v2.5
There is now a dialog box in which you can specify your own map pin format, just in case you don't like the default format.

v2.4
The tooltip on pins on smart images now displays the name, description and GM directions in one nice simple layout.

v2.3
Display pins on smart images; this will help locate where you have to click to follow the link.
Also display the pin's name as a tooltip when you hover over a pin - at the moment this is limited to plain text, so lots of fancy formatting might look a little wierd.
This only works with the "Create HTML file(s)" output option.

v2.2
Initial support for generating PDF documents and for printing.
Some RWOUTPUT files might just lock the tool up forever, rather than completing the conversion.

v2.1
The 64-bit installation should now work properly.
(The correct version of quazip.dll is now provided in the installation program.)

v2.0
Update the tool to use Qt 5.12.0 and MinGW 64-bit (i.e. it is now a 64-bit program).
This is a permanent change, and should allow any size of realm to be exported to HTML.
Generates error 0x000007b when trying to start.)

v1.20
Provide a simple bar of the bottom of each HTML5 page providing Prev/Next/Up/Top navigation buttons.

v1.19
Register to open from RWOUTPUT files, not RWEXPORT files.
Disable the PDF and PRINT buttons since they don't appear to work.
Slight speed improvements.

v1.18
You can now click on a file in Windows Explorer and open the file with the Realm Works Output Formatter. You should find it available in "open with" -> "Choose Another App".

v1.17
Provide more output options.
- if a single HTML file is requested then each topic will be marked to be printed on a separate page, so if you load the HTML into Word (or print it) then you will have a nice page per topic.
- PRINT is currently a better method of generating a PDF (by choosing the windows 10 "print to pdf" printer) than using the PDF button.

This include early prototyping of PDF generation directly from the tool.
The maximum size of images can also be specified; with the picture being scaled down to not exceed the requested width.
Both the PDF and the PRINT options go via a subset of HTML4, so there is an output choice for HTML4 as well.
Memory should be managed better, so less likely to crash with large realms (2000 topics uses up around 777MB of RAM).

v1.16
Put all assets inline inside the HTML file instead of storing in separate files.
Add some experimental code for generating multiple HTML pages using multiple threads.
Ensure the quazip.dll and zlib1.dll are always put into the installation executable.

v1.15
Stat Blocks are now provided in-line in the HTML output.
Both Hero Lab portfolio files and Realm Works Statblock snippets are used to extract this information.
To do this work means that we now also use the ZLIB and QUAZIP open source libraries.

v1.14
A global collapse/expand button now appears at the top of the navigation pane of the index page.
Each topic ends with a "Child Topics" section which links to the direct children of the topic.
Topic aliases are placed immediately below the topic title.
Provide additional export information as meta items in the head of the main page.
Replace individual style definitions with reference to a locally created CSS style (called rwStyleX), but keep the Realm Works snippet styles (Read_Aloud, Callout, Flavor, Handout) as named classes.

v1.13
Re-instate the option to put everything into a single file.
When putting everything into a single file, put the theme.css inline into the same file.
Fix the CSS so that section numbering works properly again.

v1.12
Entries in the contents list are ordered alphabetically within each category.
You can now choose to have a navigation pane on each topic page (placed on the left by default).

v1.11
The index page now arranges top-level topics under their appropriate category.
Both categories and topics with children can now be collapsed to hide their children (this doesn't work on Edge because Edge doesn't support full HTML5 - search for <details> and <summary> support).
The tool will always generate separate topic files.
The version number of the application is displayed in the bottom status bar when first started.
The installer has been changed to NSIS - the end result is that the file is smaller and the version more reliable.
This version returns to being a 32-bit application, since the loading of the RWoutput file has been optimised (the 900MB file will only take up 900MB of memory instead of 1900MB).

v1.10
The parsing of all the formatting in snippets should now work properly.

v1.9
This version is 64-bit only (it uses the microsoft compiler) to allow for converting MASSIVE RWoutput files (like 900 MB size!)
There is a slight change to the detection of snippet text so that more embedded formatting is converted successfully (although some tables are still causing problems).

v1.8
Topic prefix and suffix added to topic title (configurable via CSS).
Add a title to each pin on a smart image.
Add numbering of sections within a topic (via CSS).
Calculate smart image mask properly.
Improve formatting of the summary page.
Fix low-level handling of HTML inside snippets.
Convert output to be XHTML instead of just HTML.

v1.7
GM snippets now have their own CSS style, and they look like the GM snippets in Realm Works.
External links are now put into the output properly (previously the rest of the snippet was truncated).

v1.6
Read all <p> that appear inside a snippet instead of only the first.
Simplify the HTML output by removing the individual spans (unless they involve style changes).
Provide an option as to whether smart images should have the reveal mask displayed, or not.
Create new "snippetLabel" class for CSS.
Prepend "GM" as a snippetLabel of GM snippets.
Change CSS to use class instead of style definitions: every topic title has a class of topic; every section has a class of sectionX; each level of summary has a class of summaryX
Update the GUI to be more logical.

v1.5
Smart Images now have their reveal mask applied to the final image.
Smart Images also have their pins mapped to links - there is no PIN drawn on the map, but the link is present (in the Firefox web browser the mouse cursor changes to a hand when hovering over a link).

v1.3
Most snippet types are now converted into HTML.
Where required, separate files will be generated from the external objects, herolab portfolio files, or any other sort of object which isn't a simple picture or smart image.

v1.2
The HTML output can be saved in separate files, one topic per file.
A summary sheet (index.html) is produced which lists all the topics in their containing hierarchy.
A CSS style sheet (theme.css) is also created (this file is overwritten each time the output is performed into the same directory).
There is also an option to reduce the size of images - it uses a binary scaling, so the image will be 1/2, 1/4, 1/8 original size, depending on which fraction is required to get the image under the chosen limit.

v1.1
The HTML output has been re-written to be more efficient.
Acenoid's realm now loads (93MB) and saves as an HTML file (73MB) without error.
Status reports during loading and saving of files has been added to the main window.
There's still plenty of progress to go in many ways, but this provides the core implementation on which to build.

v1.0
The initial release converts an RWoutput file into a single HTML document.
Any images in the RWoutput data will be converted into inline images.
Any internal realm links that exist in the RWoutput data will be converted into HTML links.
The topic and section headers will be converted into the relevant nested HTML header tag.
The HTML file can be loaded into a conventional web browser, or could be loaded into Word (or any other text editor) in order to further refine the output's contents.
Printing is possible from within a web browser, although later versions will provide more formatting options.

Valyar January 21st, 2018 10:00 AM

Some screens to share from the alpha? :)
I am desperate for options to print to .pdf or similar... This feature is so required especially for custom worlds.

Farling January 21st, 2018 10:14 AM

Quote:

Originally Posted by Valyar (Post 261756)
I am desperate for options to print to .pdf or similar... This feature is so required especially for custom worlds.

You can print to PDF using the Windows print dialogue. :-)

kbs666 January 21st, 2018 10:30 AM

Rather than starting from scratch I would hope people interested in such would continue work on EightBitz's project.
http://forums.wolflair.com/showthread.php?t=57418

Farling January 21st, 2018 11:15 AM

Quote:

Originally Posted by kbs666 (Post 261762)
Rather than starting from scratch I would hope people interested in such would continue work on EightBitz's project.
http://forums.wolflair.com/showthread.php?t=57418

I took his project as inspiration, but his project is PowerShell based and so is quite restricted in its ability to perform powerful data manipulations.

(Also, I try to avoid any languages or development which are specifically tied to only one operating system.)

Parody January 21st, 2018 12:05 PM

Quote:

Originally Posted by Farling (Post 261758)
You can print to PDF using the Windows print dialogue. :-)

Windows 7 does not include a PDF printer, FWIW.

Dark Lord Galen January 21st, 2018 12:55 PM

an alternative approach might be to do something with or similar to PDF Writer, which simulates an actual printer but converts the printer out cue to a file..... Just a thought.


http://cutepdf.com/

EightBitz January 21st, 2018 01:08 PM

Quote:

Originally Posted by Parody (Post 261767)
Windows 7 does not include a PDF printer, FWIW.

You can find free PDF printers. Here's one example: http://www.primopdf.com/

Be careful when downloading and installing that. If I recall correctly, it has some piggy-back stuff that you'll most likely want to deselect, so read the options carefully.

As long as you're careful about that, though, it works fine.

EightBitz January 21st, 2018 01:17 PM

Quote:

Originally Posted by Farling (Post 261754)
Since the existing community output tool at http://forums.wolflair.com/showthread.php?t=57418 has been discontinuted, I have started work on a tool which will convert the RWoutput format into other presentation formats.

The file can be downloaded from https://github.com/farling42/RWoutpu...0/RWoutput.exe

Instructions for Use

1. Within Realm Works, from the "Share" tab of the ribbon, select "Manage Exports", enter some data and then select "Compact Output". This will generate a file in your "Realm Works\Output" folder whose name ends with ".rwoutput".

2. Launch the RWoutput tool, press the "LOAD RWOUTPUT" button and select the file created in step 1.

3. Press the "SAVE HTML" button and pick a location and enter the name of the HTML file to be generated.

4. The HTML file will be created immediately.

Uninspiring, but Simple Interface

https://user-images.githubuserconten...aa1bef2c01.png

Further Work

v1.0 provides only an initial simple program which implements the reading of the RWoutput file and the generation of a basic HTML file. This initial work provides the basis for further improvements to the data output.

I got a runtime error on one of the Realms that's been challenging for my script.

--
Runtime Error!

Program: C:\Program Files (x86)\RWout\RWout.exe

This application has requested the Runtime to terminate in an unusual way.
Please contact the application's support team for more information."
---

I can't share the realm file, because it's not mine. It's Acenoid's Shadowrun realm.

kbs666 January 21st, 2018 02:07 PM

I'm reluctant to run it on either of my active realms. They're both far too large to bother with as a single HTML page. I'd much rather the output, if it is to be HTML, be a folder with one file per topic.

EightBitz January 21st, 2018 02:13 PM

Quote:

Originally Posted by kbs666 (Post 261778)
I'm reluctant to run it on either of my active realms. They're both far too large to bother with as a single HTML page. I'd much rather the output, if it is to be HTML, be a folder with one file per topic.

My original script has an option for that. But the script is as is. I have too many RL issues right now to further support it.

https://drive.google.com/file/d/1w08...0fuiqT0Fp/view

kbs666 January 21st, 2018 02:25 PM

I've used your script quite a lot. I was hoping someone, with time, would take the time to advance it.

Farling January 21st, 2018 04:33 PM

Quote:

Originally Posted by EightBitz (Post 261775)
I got a runtime error on one of the Realms that's been challenging for my script.

The next version will have a very different output routine.

Was the error generated on the loading RWoutput file, or saving the HTML file?

EightBitz January 21st, 2018 06:24 PM

Quote:

Originally Posted by Farling (Post 261783)
The next version will have a very different output routine.

Was the error generated on the loading RWoutput file, or saving the HTML file?

Saving the HTML file.

Acenoid January 21st, 2018 07:09 PM

Hi there! Thanks for the new tool Farling - and of course - thank you again EightBlitz - for providing us with your great tool that helped me already to export a lot of data! Used it several times now and getting nice results. All the best regaridng the RL issues that have to be resolved. Hopefully the situation will improve!

You guys are making this community so much better ;)

Farling, in case you need the realm or a piece of it let me know.

Farling January 22nd, 2018 02:42 PM

Hey Acenoid, I've just released v1.1 which converts your realm to a single HTML file that is 73MB in size. Some of your images are crazy large in size! ;-)

The HTML output was re-structured and re-written to better handle output directly to a file; and means that producing output to separate HTML pages for each topic should be fairly simple to implement (most likely this coming weekend).

There's far more required for the HTML implementation, such as prettying up the output more; but that should be simple now that the basic conversion has been put in place.

It looks like I will be able to produce a PDF output at some point, and the same work will allow for direct presentation of one or more pages of information in a view-only window (since I will have to present in a window before it can be written to PDF). This same implementation would also allow printing directly to a printer instead of storing in a PDF. (Qt is the toolkit, so QPrinter and QPDFWriter will do the job based on me displaying information on a normal page.)

ErinRigh January 22nd, 2018 07:22 PM

Hey Farling

I dloaded this tool and it is awesome, but is there any reason that it won't convert some snippets, like Labelled Text and hybrid? Is it that the export does not store that information?

EightBitz January 22nd, 2018 08:17 PM

Quote:

Originally Posted by Farling (Post 261826)
There's far more required for the HTML implementation, such as prettying up the output more; but that should be simple now that the basic conversion has been put in place.

I would recommend CSS for this, as it would allow users a standard way to customize things.

Merion January 23rd, 2018 12:42 AM

Great stuff! I always love it, when people create these extremely usefull things.

You should add it to your signature, Farling!

Farling January 23rd, 2018 12:50 AM

Quote:

Originally Posted by ErinRigh (Post 261849)
Hey Farling

I dloaded this tool and it is awesome, but is there any reason that it won't convert some snippets, like Labelled Text and hybrid? Is it that the export does not store that information?

I'm still working on all the various snippet types - not all are properly sorted yet.
I thought that I had the "labeled_text" snippet sorted, but I will have another look later.

Farling January 23rd, 2018 12:51 AM

Quote:

Originally Posted by EightBitz (Post 261850)
I would recommend CSS for this, as it would allow users a standard way to customize things.

I was thinking about something like CSS. I could easily include that as a separate file, and add a button to load your own CSS.

EightBitz January 23rd, 2018 02:56 AM

Quote:

Originally Posted by Farling (Post 261858)
I was thinking about something like CSS. I could easily include that as a separate file, and add a button to load your own CSS.

Right, separate file, like I did with mine, so all anyone has to do is edit the CSS file, and it customizes the whole doc. But I think you'd need to include (like I did with mine) a base CSS file so if a user wants to load their own, they know what tags you're including in the XML and can modify their own CSS file accordingly.

kbs666 January 23rd, 2018 05:42 AM

Quote:

Originally Posted by EightBitz (Post 261859)
Right, separate file, like I did with mine, so all anyone has to do is edit the CSS file, and it customizes the whole doc. But I think you'd need to include (like I did with mine) a base CSS file so if a user wants to load their own, they know what tags you're including in the XML and can modify their own CSS file accordingly.

This.

First it would be a real pain to go through an entire directory pf HTML files adding the same line over and over again.

Second having a base CSS tells people which tags you use so they can tailor their own overrides.

Farling January 24th, 2018 04:53 AM

Version 1.2 has been released.

1) Separate web pages can be created for each topic, with a single index.html providing a summary of the containing hierarchy.

2) The HTML output is generated with a separate "theme.css" file which describes some basic styles.

3) A maximum width can be specified for images, in which case images which are wider than the limit will be reduced in size using a binary fraction to cleanly reduce the image size (e.g. 1/2, 1/4, 1/8, 1/16th).

Farling January 24th, 2018 05:15 AM

Quote:

Originally Posted by kbs666 (Post 261762)
Rather than starting from scratch I would hope people interested in such would continue work on EightBitz's project.
http://forums.wolflair.com/showthread.php?t=57418

I thought it was worth mentioning that I haven't looked at EightBitz's scripts because they are covered by the "Creative Commons Attribution + Non-Commercial license" license, whereas my tools are covered by a GPL license.

It keeps things neater if there is no direct sharing between the two.

Farling January 24th, 2018 05:33 AM

I've just run this tool on my Skulls and Shackles realm, which has an RWoutput file size of 426,177 KB and it didn't crash :-)

Farling January 24th, 2018 09:17 AM

Version 1.3 now supports almost all snippet types. The notable exception is hybrid_tags since I don't see how to generate them within Realm Works.

Separate files are created for objects in the realm which aren't simple picture or smart images.

Farling January 25th, 2018 03:19 AM

Version 1.5 has just been released which adds better support for smart images.

- The reveal mask is used to dim the parts of the image which are not revealed.

- Although no PINs are drawn on the map, their locations on the map are now links to the corresponding topic.

daplunk January 25th, 2018 04:31 AM

Works a treat!

Realm Works Community Campaign World - A Huge Work In Progress

Farling January 25th, 2018 06:12 AM

Version 1.6 has just been released.

There was a situation where multiple paragraphs in a single snippet would only output the first paragraph.

Re-organise the user interface slightly.

Provide an option to show the reveal mask on smart images, instead of always applying it.

All sorts of embedded <span> tags have been removed (unless they reference a style change).

GM instructions are now created with a label of "GM".

The CSS has been improved:
- every topic title has a class of topic
- every section header has a class of sectionX
- each level of summary on the summary page has a class of summaryX
- the label on labelled snippets has a class of "snippetLabel"

Farling January 25th, 2018 10:42 AM

Version 1.7 is available.

GM snippets are displayed similar to inside Realm Works (they have their own CSS style).

External links (and probably tables) weren't being put into the output properly.

gloranphile January 25th, 2018 11:47 AM

Anxious to try this out, but I'm getting a Runtime error as well. It's when loading the initial file, and is the same error given earlier in this thread.

The output file is 879 MB. Happy to send it to you via Google Drive if that might help.

Farling January 25th, 2018 12:15 PM

Quote:

Originally Posted by gloranphile (Post 262042)
Anxious to try this out, but I'm getting a Runtime error as well. It's when loading the initial file, and is the same error given earlier in this thread.

The output file is 879 MB. Happy to send it to you via Google Drive if that might help.

Yes, I would love to try your rwoutput file.
I've been using the original crashing realm and it is working just fine now :-)

gloranphile January 25th, 2018 02:34 PM

PM sent, Farling.

Farling January 25th, 2018 06:00 PM

Quote:

Originally Posted by gloranphile (Post 262055)
PM sent, Farling.

The problem with the first file was a single line of the file which was 254,000 characters long. It wasn't being decoded properly. It seems to consist of a single snippet with 1000s of dwarven names.

Farling January 25th, 2018 06:05 PM

Version 1.8 is now available:

Topic prefix and suffix added to topic title (configurable via CSS).
Add a title to each pin on a smart image.
Add numbering of sections within a topic (via CSS).
Calculate smart image mask properly.
Improve formatting of the summary page.
Fix low-level handling of HTML inside snippets (this includes better support for snippets containing only tables).
Convert output to be XHTML instead of just HTML.

Acenoid January 25th, 2018 06:50 PM

Hello!

Just a nitpick and a quick question - is it possible to get the tool without installer e.g. as zip archive, so it can be just extracted in a folder of my choice. Currently I am using always the uninstall routine of course.

Farling January 25th, 2018 06:55 PM

Quote:

Originally Posted by Acenoid (Post 262073)
Hello!

Just a nitpick and a quick question - is it possible to get the tool without installer e.g. as zip archive, so it can be just extracted in a folder of my choice. Currently I am using always the uninstall routine of course.

I have the same problem with the installer for the other tool as well. The Qt Installer is quite bad for not providing a proper offline upgrade option.

I might look at how to set it up to do an upgrade from an online server, but it seems quite fiddly to set up and maintain.

Farling January 26th, 2018 10:09 AM

Version 1.9 has been produced.

This version is 64-bit only, to allow for processing of massive (900+ MB) RWoutput files.

There's a slight improvement to snippet detection that will allow more formatting to be carried across, although some things (like tables) still aren't always detected properly.


All times are GMT -8. The time now is 10:02 PM.

Powered by vBulletin® - Copyright ©2000 - 2020, vBulletin Solutions, Inc.
wolflair.com copyright 1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.