Stylesheet Export

Command line:
tlapi ‑cEXPSTYL [‑osLocation] [‑OsPathFile] sPub
Library call:
nStatus = TLexportStylesheet (sPub, sLocation, 0L, NULL, psOutput, nOutLen, pErrfn)
Scripting call:
sOutFile = ExportStylesheet (sPub, sLocation)

Function

Save the current stylesheet data for a publication in an archive file.

Arguments

sPub

The path to the publication, relative to the TopLeaf repository root.

sLocation

The determines where the archive file is created, as follows:

  • If omitted (NULL or empty string for the library and scripting calls) the archive is created in the __ARCHIVE subdirectory of the publication, using a generated name.

  • If this is the path of a directory, the archive is created in the directory using a generated name.

  • Otherwise the archive is created using this value as its path.

The generated name is the same as the path of the publication within the repository using ‘_’ as a separator followed by a timestamp. Generated names are such that archive files for a publication can be compared alphabetically to determine which is more recent.

sPathFile

If present, a text file will be created at the location specified by the path. The file will contain a single line giving the path to the created archive.

psOutput

This is the address of a buffer used to return the path of the archive file. It may be NULL if the path is not required.

nOutLen

If psOutput is not NULL, this is the buffer size in bytes. otherwise it is ignored.

pErrfn

If this is not NULL, it must be the address of a function which will be called to report errors. The function must take two arguments: a char pointer containing the format string and a void pointer containing an optional argument.

For additional command line arguments see “Common Flag Arguments”.

Scripting Call Return

The return value is a string containing the path to the output file. This is always an absolute path. It is also available as the value of the OutputFile property.

If the output cannot be generated, an empty string is returned.

Examples

Command line:

tlapi ‑cEXPSTYL manuals/guide

Library call:

status = TLexportStylesheet("manuals/guide", "/tmp/ss.zip", 0L, NULL, NULL, 0, NULL);

Scripting call:

file = topleaf.ExportStylesheet("manuals/guide");