.\" Copyright (C) 1999 Jose M. Vidal .\" .\" Permission is granted to any individual or institution to use, copy, or .\" redistribute this software so long as all of the original files are .\" included, that it is not sold for profit, and that this copyright notice .\" is retained. .\" http://bk2site.sourceforge.net .\" bk2site-dev@lists.sourceforge.net .\" groff -man -Tascii bk2site.1 .\" .de EX \"Begin example .ne 5 .if n .sp 1 .if t .sp .5 .nf .in +.5i .. .de EE .fi .in -.5i .if n .sp 1 .if t .sp .5 .. .ta .3i .6i .9i 1.2i 1.5i 1.8i .TH bk2site 1 "25 February 2001" .SH NAME bk2site \- convert a Netscape Navigator bookmark file into a yahoo-like website with slashdot-like news. .SH SYNOPSIS .B bk2site [-nd] [-f .I config-file .B ] [-d .I dest-dir .B ] [-t .I name .B ] [-f1 .I basetemplate .B ] [-f1 .I othertemplate .B ] [-o .I outputfile .B ] .B ] [-xbel .I outputfile .B ][-ns] [-nc] [-old .I days .B ] [--help] [ .I mainbookmarkfile .B ] [ .I bookmarkfile .B ...] .SH DESCRIPTION Converts a Netscape Navigator bookmark file into a yahoo-like website with slashdot-like news. It is typically run as a cron job so as to keep your website automatically updated. Customization is achieved thru the template files and the .bk2siterc file, as explained below. All the options can also be given in the .bk2siterc file. .SH OPTIONS .IP -n Don't use a subdirectory hierachy. Use ugly long filenames. This option is useful for tree depth limited providers like geocities. .IP "-f config-file" Use the configuration file .I config-file instead of .IR ~/.bk2siterc and .IR /usr/local/etc/bk2site/dot.bk2siterc . .IP "-d dest-dir" Local directory for generated files. Default is /home/httpd/html/ or as given in .IR /usr/local/etc/bk2site/dot.bk2siterc and .IR ~/.bk2siterc .IP "-t name" Name of top-level bookmark folder to use. If ommited bk2site will convert whole bookmark file. .IP "-f1 basetemplate" Index template file for top index. .IP "-f2 othertemplate" Template for the other pages. .IP "-o outputfile" Output bookmark file. All the bookmarks that form the website are output to this file in Netscape bookmark file format. .IP "-xbel outputfile" Output bookmark file in XML Bookmarks Exchange Language (XBEL). All the bookmarks that form the website are output to this file. .IP -ns Do NOT generate the website. This is useful if you just want to generate the bookmarkfile or some other files, as specified in ~/.bk2siterc. .IP -nc Do NOT put HTML comments in the output. .IP "-old days" Number of days (default is 30) after which a bookmark is no longer new. .SH FILES .I /usr/local/etc/bk2site/dot.bk2siterc .RS The system configuration file. It is always read first. .RE .I ~/.bk2siterc .RS The user configuration file. It is read after the global configuration file and before the one specified in the -f argument. Values set later always override previously set values. That is, the user configuration file overrides values set in the globla configuration file. .SH Quick Start The minimum .I ~/.bk2siterc you will need, if you run your own webserver with files in /home/http/html (as is the default in most distributions) is: .EX destdir /home/httpd/html search /home/httpd/cgi-bin/urls.db extrafilebase /usr/local/etc/bk2site/newbase.html extrafilename new.html .EE .SH SUMMARY bk2site simply reads your bookmarks file and generates a bunch of files which form a yahoo-like site, with the option of using one of your folders to generate a set of slashdot-like news. In order to customize its output, you need to set up (at least) three files. .I indexbase.html .I otherbase.html and your own .I ~/.bk2siterc. Samples of these three files are included with the distribution and should be found under /usr/local/etc/bk2site or /usr/doc/bk2site. .IP indexbase.html This file forms the template for your top-level index. That is, the page everyone will see first. This file must be a legal html file and contain the comments as described below. .IP otherbase.html It is the template for all the other files. It also needs to have comments, as described below. .IP ~/.bk2siterc. Edit the .I /usr/local/etc/bk2site/dot.bk2siterc file and copy it to .I ~/.bk2siterc The sample file has lots of comments, so read it. Also, a sample .I ~/.bk2siterc is given at the end of this manual page. This file tells bk2site where to find indexbase.html and otherbase.html .PP There can also be extra configuration files if you wish to generate extra output (for example, you might wish to generate an xml file to be read by MyNetscape.com, or a plain text file to be used in an automate monthly newsletter). The extra template files are given with the "extrafilebase" and "extrafilename" variables in your .I ~/.bk2siterc Basically, bk2site supports 5 different sections in your document. Each section refers to the type of URLS that will be output by bk2site at that point. They are: .IP folder folders from your bookmarkfile .IP url urls (leafs) from your bookmarkfile .IP newadd urls of the most recently, sorted by most-recently-created .IP news urls from the newstopfolder, sorted by most-recently-created. .IP tophits urls with the most hits, sorted by number of hits (as given by urllog) .IP newsandnewadd combines the urls in news and newadd and sorts them by most-recently-created. .PP Each section is replaced by bk2site with the appropiate urls. For example, the folder section is replaced with the URLs for the appropiate folders, while the url section is replaced by the leaf urls. Exactly how these URLs will look depends on the values you give to the different variables within each section. The easiest way to understand how it works is to look at at the sample files. Lets look at the folders (in Yahoo! these are known as the "categories"). In the sample otherbase.html you will find something like: .EX .EE These comments guide how bk2site generates the html for the folders. Each section must always start with the and end with . Within each section section-type--> there are a number of variables (e.g. top, template, section-type--> separator), each one of these variables is followed by section-type--> the value we are assigning to it. The whole section will be replaced, in the output file, by the code generated by bk2site. The section begins with: .IP "" Tells bk2site that this is the place where we want to place the folders. .PP After the begin statemend we see a number of variables, each one is assigned a value. The function of each variable is: .IP top If there are folders to print, print the value of this variable (in this case