Flare - programatically automate processes

This forum is for all Flare issues not related to any of the other categories.
Post Reply
dylnmc
Jr. Propeller Head
Posts: 3
Joined: Thu Oct 29, 2015 8:22 am

Flare - programatically automate processes

Post by dylnmc »

Hi,

I am a software dev ... intern :) and I was told to make a VB script or some other script that would allow me to parse files inside of flare and generate another file populated with information about the parsed data. More specifically, we would like to be able to automatically generate a glossary (or something similar) based on tags that the tech. writers will manually place around certain words (in the xml).

First, is this possible?

Second, how would I go about doing this? I have been googling and googling and just need some direction if there is some to give.

Cheers and thanks so much in advance.
- dylnmc
dylnmc
Jr. Propeller Head
Posts: 3
Joined: Thu Oct 29, 2015 8:22 am

Automated program execution in Flare

Post by dylnmc »

Hello,

I was told to create a script (using VB or whatever is available) to somehow automate a process in Flare. I am a programmer and not a technical writer, so I am unfamiliar with Flare. Basically, we would like to parse files and then generate another file and based on the information in the parsed files, populate the newly generated file appropriately. More specifically, we would like to have a glossary (or something similar) be automatically generated on build that searches through all the files for particular tags. If it finds the corrects tags (in the xml), then it will populate the glossary, and a lot of hassle will be saved.

I am not sure if this can be done, first off; however - secondly - if this can be done, I am not sure where to find how to do it. I have scoured Google and didn't seem to find it.

Thanks so much in advance.
Paulie
Sr. Propeller Head
Posts: 140
Joined: Sun Mar 01, 2015 3:01 pm

Re: Automated program execution in Flare

Post by Paulie »

Hi there,

There will definitely be a way to achieve what you want to do. As somebody that is unfamiliar with Flare, I will give you a couple of tips to get you started:
  • Each output/buildable document is defined by a Flare target (*.fltar)
  • Targets contain a link to a Flare TOC - table of contents file (*.fltoc). The TOC contains the list of actual topics that will be included in the generated document.
  • Targets also allow you to define the glossary file (*.flglo) and whether a glossary will be auto-generated.
All of the aforementioned files are XML, so they are easy to evaluate and generate on the fly programatically. Based on your description above, there are two ways you could achieve this (I'd recommend the latter if you have an automatic build):
  • Interactive via a standalone tool or Flare plug-in
  • As a part of the automated build
If I were to do this from scratch, I would create a tool that allows you to pass in the name of the Flare target as a parameter. The tool would then be configured to run before the target is built. When run the tool would:
  • Evaluate the Target file to extract the:
    • Name of the TOC file.
    • Name of the glossary file
    • Any conditions applied to the target that would exclude content from being built
  • The tool would then evaluate the TOC file to obtain a list of topics to evaluate (excluding any that have been conditioned out.
  • The tool would then evaluate each individual topic (again excluding any xml elements that have been conditioned out). From here, you can search for whatever it is that you specifically use to define whether a glossary item should be included or excluded.
  • Finally, recreate the *.flglo file to contain the glossary entries that you want to show for this particular target.
  • Build the Flare target. The glossary that you created should appear in the output that you have built.
A couple of other things to be aware of:
  • Not all Flare targets define a TOC. If a TOC is not defined, the Primary TOC will be used. The primary TOC used to be contained within the Flare project file (*.flprj) but it doesn't appear to be there in my projects. Perhaps somebody else can point out where this information can be obtained.
  • The Analyzer folder contains a SQLite database file. Depending on how you define what should be included in the glossary, you may be able to query this database, rather than the individual topic files.
I hope this helps. Feel free to ask any additional questions that you may have.
"In an ideal world, software should be simple, well designed, and completely intuitive to end users. In the real world, good documentation is king."
SteveS
Senior Propellus Maximus
Posts: 2090
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
Contact:

Re: Automated program execution in Flare

Post by SteveS »

If I read your post correctly I'm wondering why you need to run the process inside Flare.

I'd be more inclined to create a topic used to hold your terms. Just a heading would be necessary.

Then leave the TWs to do their stuff. When they've finished and built the output you can run your parser over the output and use the results to populate the (up till now) topic.

Hope this helps, or is food for thought...
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
SteveS
Senior Propellus Maximus
Posts: 2090
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
Contact:

Re: Flare - programatically automate processes

Post by SteveS »

I've merged the two threads and deleted Paulie's post linking one to 'tother (Hope you don't mind, Paulie).
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
dylnmc
Jr. Propeller Head
Posts: 3
Joined: Thu Oct 29, 2015 8:22 am

Re: Flare - programatically automate processes

Post by dylnmc »

Ok.

First, thanks for merging the post. I wasn't sure if the first one went though.

Second, I think I am almost there, but I still need a little help.

Let's say that I have a C# program (a .NET application supported by Flare). Let's say that it uses LYNQ in order to parse an XML file to objects and then back again at runtime and that it will overwrite or create a file. I have no idea where to put this project or where to put the proxy (or whatever there needs to be) in order to import it. I have been reading the one manual for Programmers, and it really doesn't seem to tie things together very well. It is great at explaining things but when the time comes to tie it all together, I am a bit lost.

Where do I put the file and the proxy/import so that it will run at runtime?
Post Reply