Thursday, November 2, 2017

Revisiting SCHelp

As part of the website for my text-based game engine I want to have an online version of the api help that is built into the admin utility. I personally like treeview and search driven help systems and didn't want to have to write my own (More on that in a second) so I looked around for a decent open source web/html help generation tool. Nothing that was quite what I was looking for.
So last night I dusted off a js/html based help system I built years ago (Called SCHelp). The interface is decent and bug free - but the admin tool for it is a nightmare! And being purely js you have to write your topic, generate the data and copy it into the Data.js file then refresh the admin. And the tree editing is wonky and buggy and terrible.

So I created a Java command utility that uses a toc.txt file and other plain text files to build the Data.js file. So you just write your table of contents. It uses indenting to determine the tree structure, and it points to the topic file it will open. The toc spec becomes json in the Data.js file, and the topic files become the js array used by the help system to display them (Huge help systems are probably not gonna work - sorry MSDN).

Here is an example, where we have a home directory, a couple levels of child directories, then an Introduction node that would show that topic.

TOC:
Home
  Getting Started
    Introduction@@topics/general/intro.txt

Topic (in this case intro.txt):
This Is An Introduction
Welcome to our <strong>amazing</strong> help system!

Run the Java utility with the root directory (where the toc.txt is) and it's done. My js help system uses the Data.js as its data.

No comments:

Post a Comment

5 VST Effects I Use in Every Song

VSTs are so great. I have a massive collection of free instruments and FX that I've tracked down. There are SOO many to choose from... B...