Using MadCap's CLI to build a PDF or webdoc?

This forum is for all Flare issues related to getting started and installing the application.
Post Reply
sdcinvan
Propellus Maximus
Posts: 1260
Joined: Wed Aug 21, 2013 11:46 am
Location: Vancouver, Canada

Using MadCap's CLI to build a PDF or webdoc?

Post by sdcinvan »

Hello all,

I am days away from purchasing MadPak. In my proposal process, I was asked if:
a) Is it possible to pull down (from source control - we use git), a MadCap project to make some text edits to the XML
b) Compile the project directly from MadCap's CLI

I am presuming that MadCap uses some form of makefile?

Never mind asking why... ha ha... I am just interested in an accurate answer. :-)

The sort of why (if you are curious) is perhaps it is because I work in a 99% pure software engineering company where I nearly the only person using Windows and a GUI! :shock:


Thank you.... and especially thank you if you can provide a link to more information (I search the forums and found some references to much older versions of Flare - I think around v4).
Shawn in Vancouver, Canada
Main tools used: Flare 11.x, InDesign, Google Docs, Lectora, Captivate.
Report bugs: https://www.madcapsoftware.com/feedback/bugs.aspx ▪ Feature requests: https://www.madcapsoftware.com/feedback ... quest.aspx[/i]
sdcinvan
Propellus Maximus
Posts: 1260
Joined: Wed Aug 21, 2013 11:46 am
Location: Vancouver, Canada

Re: Using MadCap's CLI to build a PDF or webdoc?

Post by sdcinvan »

FYI, there are detailed CLI instructions here: http://forums.madcapsoftware.com/viewto ... &sk=t&sd=a

But this post is from 2006. Is this post still relevant for MadCap v9?
Shawn in Vancouver, Canada
Main tools used: Flare 11.x, InDesign, Google Docs, Lectora, Captivate.
Report bugs: https://www.madcapsoftware.com/feedback/bugs.aspx ▪ Feature requests: https://www.madcapsoftware.com/feedback ... quest.aspx[/i]
Psider
Propellus Maximus
Posts: 902
Joined: Wed Jul 06, 2011 1:32 am

Re: Using MadCap's CLI to build a PDF or webdoc?

Post by Psider »

I've never used the command line, but perhaps this help topic covers your needs?

http://webhelp.madcapsoftware.com/flare ... d_Line.htm
sdcinvan
Propellus Maximus
Posts: 1260
Joined: Wed Aug 21, 2013 11:46 am
Location: Vancouver, Canada

Re: Using MadCap's CLI to build a PDF or webdoc?

Post by sdcinvan »

Psider wrote:I've never used the command line, but perhaps this help topic covers your needs?

http://webhelp.madcapsoftware.com/flare ... d_Line.htm

Thank you for that.

So far, so good. I discovered that some (or much) of the work needs to be done inside Flare... as in configuring the Targets.

Next, I built a shell script to basically build any project available (anything pulled from the git repo).

Code: Select all

#! /bin/sh

mkdir -p output
for x in $(find -name *.flprj) ; 
do
  madbuild.exe -project ${x}
  
  dir_path=`dirname ${x}`
  cp -rv ${dir_path}/Output/*/* output
done
It is working quite well... except I just learned that Flare can record build logs. I just need to investigate how to initiate those logs.
Shawn in Vancouver, Canada
Main tools used: Flare 11.x, InDesign, Google Docs, Lectora, Captivate.
Report bugs: https://www.madcapsoftware.com/feedback/bugs.aspx ▪ Feature requests: https://www.madcapsoftware.com/feedback ... quest.aspx[/i]
sdcinvan
Propellus Maximus
Posts: 1260
Joined: Wed Aug 21, 2013 11:46 am
Location: Vancouver, Canada

Re: Using MadCap's CLI to build a PDF or webdoc?

Post by sdcinvan »

I don't know if this is useful to anyone but here is the final change to my MadBuild shell script:

Code: Select all

#! /bin/bash

SCRIPT_DIR=$(dirname $(readlink -e $0))
cd ${SCRIPT_DIR}

mkdir -p output
for x in $(/bin/find . -name *.flprj) ;
do
  madbuild.exe -project ${x} -log true

  dir_path=`dirname ${x}`
  rsync --exclude=Temporary -avzrP ${dir_path}/Output/*/* ${dir_path}/Project/Reports output
done
When I push content to our repo, any changed documents will get automatically built and placed in a public directory. Each project in its named folder and now a MadBuild log folder, as well.

Note: When using MadBuild, I cannot empathize enough the importance of creating a log (using the CLI parameters "-log true"). This is needed for MadBuild to communicate any problems that may occur during the publishing cycle.
Shawn in Vancouver, Canada
Main tools used: Flare 11.x, InDesign, Google Docs, Lectora, Captivate.
Report bugs: https://www.madcapsoftware.com/feedback/bugs.aspx ▪ Feature requests: https://www.madcapsoftware.com/feedback ... quest.aspx[/i]
Msquared
Propellus Maximus
Posts: 848
Joined: Mon Aug 06, 2012 10:19 am
Location: Southampton, UK

Re: Using MadCap's CLI to build a PDF or webdoc?

Post by Msquared »

I believe MadBuild returns error codes. I'm sure there is something in the online help about the error codes. I'm not at my PC at present to check.

But be warned if you check them. I had a least one instance where something went wrong in my build (possibly some missing files), and the error was significant enough to make the log, but not significant enough to change the MadBuild return status from success.
Marjorie

My goal in life is to be as good a person as my dogs already think I am.
Post Reply