---
name: "Publican"
section: "3pm"
platform: "linux"
package: "publican"
version: "4.3.2-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Publican"
---

# Publican(3pm)

Used to control settings for sub modules.

## NAME

Publican - Used to control settings for sub modules.

## VERSION

This document describes Publican version `$VERSION`

## SYNOPSIS

```
    use Publican;
    my $publican = Publican->new({DEBUG => 1});
```

## DESCRIPTION

Handles general configuration of all sub modules.

## INTERFACE

### \_load\_config

Private method for loading a config file

### \_validate\_config

Private method for validating configuration

### new

Create a Publican object.

my `$publican` = Publican-\>new({debug =\> 1});

*Parameters:*

```
   configfile       Override Configuration file to use.
   debug            Use debug mode for messages.
   common_config    Override path to coomo configuration files.
   common_content   Override path to common content files.
```

### debug\_msg

Print out debugging information.

### param

Return the current value of a configuration parameter

`$publican`-\>param('debug');

### help\_config

Display a list of config file parameters and a short description of them.

### dir\_list

list all the files in a directory, and its sub-directories, matching the supplied regex.

### get\_all\_langs

Get all valid language directories.

### logger

Log something, currently emits to STDOUT

TODO: consider using Log::Dispatch or similar

### valid\_lang

Is the requested language valid according to I18N::LangTags::List

### maketext

Get localised strings

### run\_xslt

Apply the supplied xslt file to the supplied XML and return a string of the output.

### new\_tree

Create a new XML::TreeBuilder object with the required attributes for DocBook.

TODO: Make XmlClean use this.

### dtd\_string

Returns a valid DTD for the DocBook tag supplied.

Parameters:\
 	tag	 The root tag for this file\
 	dtdver	 The DTD version\
 	ent\_file An entity file to include (optional)

\## BUGBUG this should be moved to the DocBook sub classes

### print\_banned\_tags

Print a list of tags that are not supported.

### add\_revision

Add a full entry in to the revision history.

\## BUGBUG this should be moved to the DocBook sub classes

### get\_ed\_rev

Get the current edition (version) and release from the Revision History file.

Parameters: language, bump.

If bump is set the returned revision will increment before it's returned.

\## BUGBUG this should be moved to the DocBook sub classes

### fcopy

UTF8 escape calls to File::Copy::Recursive

### fmove

UTF8 escape calls to File::Copy::Recursive

### rcopy

UTF8 escape calls to File::Copy::Recursive

### rcopy\_glob

UTF8 escape calls to File::Copy::Recursive

### dircopy

UTF8 escape calls to File::Copy::Recursive

### dirmove

UTF8 escape calls to File::Copy::Recursive

### params\_as\_docbook

Returns DocBook chunks describing all the configuration options. Used to generate autodocs.

## DIAGNOSTICS

- "unknown args %s"

  All subs with named parameters will return this error when unexpected named arguments are provided.

- "%s is a required argument"

  Any sub with a mandatory parameter will return this error if the parameter is undef.

- "Config file not found: %s"

  publican can not find the named configuration file.

- "Failed to load config file: %s"

  The named configuration file could not be loaded.

- "Can't locate required file: %s"

  A file required for processing could not be found.

- "title not found in Info file"

  The \<type\>\_Info.xml file does not contain a title tag.

- "productname not found in Info file"

  The \<type\>\_Info.xml file does not contain a productname tag.

- "productnumber not found in Info file"

  The \<type\>\_Info.xml file does not contain a productnumber tag.

- "pubsnumber not found in Info file"

  The \<type\>\_Info.xml file does not contain a pubsnumber tag.

- "Failed to load brand default config file"

  A detected defaults.cfg for the current brand could not be loaded.

- "Failed to load brand overrides config file"

  A detected overrides.cfg for the current brand could not be loaded.

- "Could not create a Publican::Localise object"

  Could not create a Publican::Localise object

- "Can't open directory"

  ## CONFIGURATION AND ENVIRONMENT

Publican requires no configuration files or environment variables.

## DEPENDENCIES

Carp version Config::Simple XML::TreeBuilder I18N::LangTags::List Term::ANSIColor File::Find::Rule; Publican::Localise;

## INCOMPATIBILITIES

None reported.

## BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests to `"publican-list@redhat.com"`, or through the web interface at \<https://bugzilla.redhat.com/bugzilla/enter\_bug.cgi?product=Publican&amp;component=publican\>.

## AUTHOR

Jeff Fearn  `"<jfearn@redhat.com>"`
