Combining Generated and Flare-managed Content

One way to combine generated content with Flare-managed content is to use snippets. Here is a generic structure:

Generated topics each contain:

Generated snippet – periodically refreshed

Generated snippet – updated with Flare editors

Consider a simple case where the generated content comes from a CSV file. For this example, the CSV is analogous to a table with two columns. The first column is a name of some reference subject and the second column is the description.

Flowers,Flowers are structures which are part of some plants…
Unicorns,Unicorns are figments which occur in some imaginations…
Sunbeams,Sunbeams bathe the earth in radiation when another object does not block the sun…
Rainbows,Rainbows lead to the other side…

The term CSV is thrown around loosely. For this example, the CSV has only two entries per line. The entries are delimited by one comma. To provide a simple example, the content itself does not have commas. Here is one way to read a CSV with Visual Basic:

How to: Read From Comma-Delimited Text Files in Visual Basic from MSDN

This example dispenses with the exception handling for reading clarity. But bad files should be expected and handled. There is a decent discussion at the bottom of the article about other considerations.

To create the TOC, topics, and snippets, Linq to XML is used. This has been discussed in previous blog entries. The procedures in the sample are fairly targeted. Generalized, overloaded procedures would be better. But reading clarity, the scopes of the procedures are narrow.

This example also assumes a specific project structure and existing folders. A working utility should check for folders and add folders if necessary. The flexibility to specify sub folders is also a plus. And of course we don’t want to limit ourselves to CSV. But rather than cloud the example, here is the code without all of that:

Here are the generated files in the folders:



Here is the TOC:

Here is a snippet:

And here is a topic:




Leave a Reply

Your email address will not be published. Required fields are marked *

HTML tags are not allowed.

204,720 Spambots Blocked by Simple Comments