Keep templates of your own

Templates beside the arks’ own: copy, list, clone and delete.

A project’s arks each have a bound template, and it can keep others beside them: copies you made, unbound, ready to be cloned, or tidied away when you don’t need them.

List #

$ vendor/bin/barnark template:list
Barn: …/hotel
 ---------------------------- ---------------
  Name                         What it is
 ---------------------------- ---------------
  Hotel                        Bound to /src
  Reservations                 Yours
  Domain Driven Design         Shipped
  Feature Based Architecture   Shipped
  Model View Controller        Shipped
  Library                      Shipped
  Package App                  Shipped
  Blank project                Shipped
 ---------------------------- ---------------

The second column says what each is: Bound to /src for the project’s own, Yours for an unbound copy of yours, Shipped for the catalogue. Your own come first.

Copy #

template:copy <from> <name> copies any template (a shipped one, one of yours, or the bound one, members included) into a new unbound template of your own. It makes no folder.

$ vendor/bin/barnark template:copy Hotel Reservations
Barn: …/hotel

 [OK] Copied 'Hotel' into 'Reservations'.

Its first revision is the copy. Changing one never changes the other.

Make an ark from one of yours #

An unbound template of yours makes an ark, its members’ folders included. The ark’s own template is a further copy, named after the ark.

$ vendor/bin/barnark template:clone "Our Library" Pricing ./lib
Barn: …/hotel

Making the ark 'Pricing' from a copy of 'Our Library' in ./lib
==============================================================

  ./lib
  …

 [OK] Made the ark 'Pricing' in ./lib.

Bound to its own template 'Pricing' in .barn/barnark/tracked-folders.json — check it any time with `barnark template:check`.

Delete #

template:delete removes one of your own templates with every revision. Only git brings it back, so it asks first. With -n (--no-interaction) it goes ahead without asking. The project’s own template and the shipped ones can’t be deleted.

$ vendor/bin/barnark template:delete "Our Library"
Barn: …/hotel

 Delete 'Our Library' with every revision? Only git brings it back. (yes/no) [no]:
 > Nothing was changed.
$ vendor/bin/barnark template:delete Reservations -n
Barn: …/hotel

 [OK] Deleted 'Reservations'.
$ vendor/bin/barnark template:delete Pricing -n
Barn: …/hotel

 [ERROR] 'Pricing' is the project's template, bound to '/lib', and cannot be
         deleted.

In the browser app #

The browser app calls templates scaffolds. Click one under Barnark scaffolds to see its tree, with Copy to Your scaffolds. Click one under Your scaffolds to see its History, with Copy, Create ark and Delete. An ark and its folder have no Remove.