Loadable Variable Files at Publish time

Nothing is perfect! This is where you can post your ideas and wishes for functions you'd like to see in Help & Manual. Current version only please (H&M7).

Moderators: Alexander Halser, Tim Green

Post Reply
User avatar
Rob Davis
Posts: 146
Joined: Tue Sep 06, 2011 9:45 am

Loadable Variable Files at Publish time

Unread post by Rob Davis »

HI
Raising an old wish -that is still relevant.
Would it be possible to handle variable files in a similar way to the Publishing/Build Settings -
What I envisage is that the Publish/Settings screen would have a structure similar to the Search Path screen, available at publish time, where you could include (and reorder) a list of file names, each with a Overwrite/Merge option, where the listed files refer to text files that are in the same format as your Import/Export option in the Text variables field.
Overwrite would replace the value (taking the highest entry in the list as priority), Merge would add any variables that are not already there, but not overwrite ones that are already in the list.

I know that some of this functionality can be achieved using the Command Line method, but there are number of reasons where the above idea would help a lot!

I'd be very happy to discuss how I envisage using this, in order to generate more ideas (or solve my problem in a different way)
Rob
User avatar
Tim Green
Site Admin
Posts: 23154
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Loadable Variable Files at Publish time

Unread post by Tim Green »

Hi Rob,

What are you referring to with "variable files" here? Do you mean the graphics and snippet files that are located with the Project Search Path or something else?
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Simon_Dismore
Posts: 205
Joined: Thu Jul 13, 2017 2:57 pm

Re: Loadable Variable Files at Publish time

Unread post by Simon_Dismore »

Rob Davis wrote:Overwrite would replace the value (taking the highest entry in the list as priority), Merge would add any variables that are not already there, but not overwrite ones that are already in the list.
Can't "Merge" be achieved just by sequencing the include files appropriately, like #include in C?
User avatar
Rob Davis
Posts: 146
Joined: Tue Sep 06, 2011 9:45 am

Re: Loadable Variable Files at Publish time

Unread post by Rob Davis »

Taking your two questions:

By 'Files', I mean such as exporting the Variable Text file from a project as a .txt file, and/or Importing a variable text file.

The reason for 'Merge' is (as I see my file structure) - a Project has its 'local' variable, but both the pdf template and the Repository files, and even snippets from other sources might have other variables which would normally be 'default', so you dont even have to include those variables explicitly in the project, unless you know that you might sometimes override them. If you imported the variables as multiple separate txt files, the values set in the external file would be loaded, and you would still have the chance to 'override' them for a particular build.
What I visualize is something like the 'Search Path', but referencing separate .txt files which each contain sets of project variables.
Not sure if I explained that clearly enough.

The reason this is coming up again, and more 'urgently' from my point of view:- I previously looked after a few very large Help (and .pdf print files). These came out in a couple of Brandings, so I used variables and build conditions quite a lot.
Lately, I am working more on 'box'-product projects, with a few product families, a dozen or more models in each family, and several model variants. Each model and its variants have a shared 100+page user manual, individual shorter Installation Guides, Spec sheets, a short technical Specification, and various 'catalogs' which extract similar information from each of the Product libraries. The opportunities for content re-use are tremendous, as are the benefits of having fixed single locations for different types of boilerplate material, lists of regulations, tables of shared characteristics, libraries of graphics, diagrams etc. etc.
All this documentation was done in Word, with only rudimentary cut-and-paste for content re-use. Diagrams and pictures were embedded, heavy use of PowerPoint (!) as the graphics medium, etc.
There is vast scope for content reuse and graphics libraries, and I am trying to 'architect' how best to build a new structure.
Simon_Dismore
Posts: 205
Joined: Thu Jul 13, 2017 2:57 pm

Re: Loadable Variable Files at Publish time

Unread post by Simon_Dismore »

Is this what you have in mind...?
  • You almost always want later re-definitions of a variable to override previous definitions. On this basis anything defined in the project file itself would be at the lowest level and would be overridden by any definitions in external variable files. You can already achieve this with multiple variables-only skins referenced on the command line.
  • But occasionally you want to change a variable quickly for a specific build. You could do this by creating a top-most override file for that specific build, but you don't want to do that.
If that's right, I can imagine several alternative ways of going about it:
  • Your "merge" model, where you can specify that some import files only apply to undefined variables, but don't override existing definitions. That would be a great way of setting default values if and only if they haven't been defined by the project. Maybe it could be done with a special command line switch instead of /O=
  • Have a variable file be imported automatically as top-most if it exists, but no error if it doesn't. That might be a bit fragile.
  • Have a way to mark individual variables in your project so they are protected against redefinition. That would be good if you need to manage a variable in a very specific way for just one build, or if all your skins are doing some incorrect redefinition that you want to correct easily, etc.
I think this comes down to how often or rarely you need to reverse the normal order of overrides.
User avatar
Tim Green
Site Admin
Posts: 23154
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Loadable Variable Files at Publish time

Unread post by Tim Green »

Hi Rob,

What you are trying to achieve still isn't entirely clear to me, but as far as I understand it you want external files with definitions of the variables for use in your published projects. Are you aware that this facility already exists? You need to use command line publishing and write batch files to use it, but you can define an external text file containing a list of variable definitions using the /V= switch in the command line and that will override all other definitions of those variables for that publish operation (provided no skin reference with other variable definitions comes after it).
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Rob Davis
Posts: 146
Joined: Tue Sep 06, 2011 9:45 am

Re: Loadable Variable Files at Publish time

Unread post by Rob Davis »

Thanks for the responses, ideas, etc.

I don't know how better to describe what I am thinking of than "using a loadable files containing variable lists (i.e. in the formats that you already use for importing and exporting variables), ordered like a Search Path, so that at compile time , you would populate a consolidated list of variables, in the priority set by a stack that is presented to the user in the same way as you currently handle the search path stack.

I still see that as a desirable feature, but possibly I am being myopic, and just craving 'my version'.

I remember that you gave the 'command line' solution when I first asked about this. Given the structure of our projects (which I mostly inherited when I joined) and the number of different brandings and product variants we use, I still have difficulty with the idea of using the correct command line for each compile that I do.

Maybe one day there will be an opportunity to sit together and brainstorm, so that either -
1) I could get my head around the command line methods I would need,
or
2) you would suddenly say - "wow - we can do that - it'll be COOL! ;-)"

Thanks again for the responses!

Rob
User avatar
Tim Green
Site Admin
Posts: 23154
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Loadable Variable Files at Publish time

Unread post by Tim Green »

Hi Rob,

Basically you just need a different batch file for each job you want to do. You save each of them withe the .cmd or .bat extension to export with the appropriate set of variables. To do this you use the /V=variables.txt switch to reference the file containing your variables definition.

Code: Select all

"<Path>\HELPMAN.EXE" "<Path>\project.hmxz" /HTML=<Path>\index.html /V=variables.txt
If you don't include a path with the variables file (it can have any name you like) it needs to be in the same folder as the project. You can include a path to put it anywhere you like, then you also need to enclose it in quotes.

The variables definition file looks like this

Code: Select all

TITLE=Widget Editor V2.8
EDITORS=John and Jane Doe
COPYRIGHT=Widgets Inc., all rights reserved
One line per definition, no quotes, no spaces on either side of the = sign.

For full instructions see the chapter on command line publishing in the Publishing chapter of the help. :)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Post Reply