cs::Web/Bookmarks - create and transcribe a hierachical category structure
use cs::Web::Bookmarks;
This module supplies methods for constructing a hierachical set of categories,
originally as the infrastructure for my nsbmparse(1) program which
transcribes my Netscape bookmark file into real HTML.
It also sees use as a tool for generating hierachical descriptions
of other things as in the updaliases(1) program where it makes
HTML pages enumerating the autogenerated mail aliases.
Derive a title key from a title for use as a ``#anchor'' tag or target name.
Create a new bookmark category named title. The optional argument attrs is a hashref ... The optional argument parent is a reference to another cs::Web::Bookmarks object.
Title()
Return the title string for this category.
TitleKey()
Return the title key for this category's title, as used to make ``#anchor'' tags and targets during transcription.
Entries()
Return an arrayref with this category's immediate entries.
SubCats()
Return an arrayref with this category's subcategories.
Create and return a new subcategory with the specified title.
Create and return a immediate entry for this category with the specified title. The optional parameter attrs is a hasref which can contain such things as an HREF URL field. The optional parameter unique will discard other entries in this category with the same title; unique defaults to false.
Locate and return the subcategory denoted by the name path, with is a slash (``/'') separated string of subcategory titles to descend. The optional parameter force may be set to true to create the named subcategory if it does not exist; force defaults to false. If the category does not exist and is not created via the force parameter then undef is returned otherwise a reference to the desired subcategory is returned.
Depth()
Compute the depth of the deepest subcategory. This is used as a heuristic for layout choices during transcription.
Write this category and its descendants to the specified file, which may be a filename or a cs::Sink object. The optional parameter title may be specified to override the default title of this category.
BUG: the html argument is unused and should be revoked.
Write this category and its descendants to the specified target. The optional parameter title may be specified to override the default title of this category.
If target is a directory or a symlink to a directory then the category top level and immediate entries will be transcribed to the file ``target/index.html'' and the subcategories will be transcribed to the targets ``target/subcat-title'' recursively.
Othewise the entire category and its subcategories are transcribed to the file ``target.html''.
In this way a large bookmark tree may be broken into subtrees (separately loading web pages) at arbitrary convenient points by making suitably named stub subdirectories before transcription.
Write this category and its descendants to the specified targetdir.
Write this category and its descendants to the specified cs::Sink object sink. The optional parameter title may be specified to override the default title of this category.
Transcribe and return this category and its subcategories to an HTML token list for use by cs::HTML::tok2s(3) and friends.
cs::HTML(3), nsbmparse(1), nsbmclean(1), updaliases(1)
Cameron Simpson <cs@zip.com.au>