📄 bk2site.1
字号:
removed..IP %NHCOMMENT the comment but with everything between < and > stripped outthat is, all the HTML stripped out (No HTML Comment). Also on 80 columns..IP %FSCOMMENTthe first sentence of the comment, that is, everything up to thefirst period. A single letter with a period will be skipped. If there isno period then the whole comment..IP %JSCOMMENTthe comment but with the appropiate characters escaped so that it canbe used as a JavaScript string..IP %JSFSCOMMENTthe first sentence of the comment, that is, everything up to thefirst period. A single letter with a period will be skipped. If there isno period then the whole comment. Special characters are escaped so thatthe comment can be used as a JavaScript string..IP %DAYCREthe day created.IP %DAYVISthe day last visited.IP %DAYMODMthe day last Modified.IP %MONTHCRE1the month created, in number.IP %MONTHCRE2the month created, in English.IP %MONTHVIS1the month visited, in number.IP %MONTHVIS2the month visited, in English.IP %MONTHMOD1the month modified, in number.IP %MONTHMOD2the month modified, in English.IP %YEARCRElast two digits of the year created.IP %YEARFCREthe year created, including all digits (the full number)..IP %YEARVISlast two digits of the year visited.IP %YEARFVISthe year visited, including all digits (the full number)..IP %YEARFMODlast two digits of the year modified.IP %YEARMODthe year modified, including all digits (the full number)..IP %LEAFSthe total number of leafs under it (for folders only).IP %NEWthe new.gif, if the time is right..IP %TIMEFCREthe time created in full Wed Jun 30 21:49:03 1993.IP %TIMEFMODthe time modified in full Wed Jun 30 21:49:03 1993.IP %TIMEFVISthe time visited in full Wed Jun 30 21:49:03 1993.IP %CONDDASHprints a dash "-" if the comment is not null.IP %IFCOMHAS(string)(html)if the comment has "string" then insert "html" at point.also eliminate "string" from comment.e.g. %IFCOMHAS(*coolsite*)(<img src="/images/cool.gif">) or%IFCOMHAS(-neat-)(<font color="red">Neat Site</font>)If you use it, you must use it for ALL templates.IP %HITSthe number of hits this url has receives, as gathered from urllogfile.PPThere are also functions you can use. Right now, these functionsare NOT available for search.pl so you should not use them inyour searchurltemplate variable in your .bk2siterc. Each function takes one or more arguments and gets replaced by theresults of applying that function to the given arguments. The function are:.IP &FILL[arg|cols]where arg is a string and cols is an integer. This function auto-fillsthe given argument to cols columns. e.g. &FILL[%COMMENT]..IP &NOHTML[arg]where arg is a string. Gets rid of all the HTML in the argument. That is,everything between < and >..IP &REPLACE[arg|from|to]where arg, from, and to are strings. It replaces all instances of "from" with "to" in "arg"..IP &CUT[arg|chars]where arg is a string and chars is an integer. It returns the first"chars" characters in "arg"..IP &NOLINEBREAKS[arg]where arg is a string. It replaces all newlines, returns and tabswith spaces, in arg..IP &NOACCENTS[arg]where arg is a string. It replaces all accented characters with theirnon-accented counterparts. It also gets rid of other troublesomecharacters..IP &FS[arg]where arg is a string. It returns the first sentence in arg..PPThese functions can be nested, as in &CUT[&NOHTML[%COMMENT]|500]. Thestrings used as arguments to these functions cannot include the characters[, ], or | since that will confuse the parser..SH Netscape Navigator CommentsAs you know, navigator allows you to give comments to bookmars andfolders. We use these to guide the behavior of bk2site (see below andread dot.bk2siterc, esp %IFCOMHAS) and we also print them.You can also use HTML in the comment and it will work, but:*********WARNING********************WARNING***********DO NOT PUT "HREF=" IN YOUR COMMENT. There is a bug in Navigator thatwill make it mungle your bookmarks if you do that. The bug has beenreported. If you must, use "HREF =". The space is VERY important. I actuallylike to use "href =". The use of lowercase and a space makes me feeldoubly safe.*********WARNING********************WARNING***********.SH Using Aliasesbk2site supports url aliases, as used by navigator. It also implements directory aliases. Since Navigator does not allowus to create an alias for a folder/directory, we must do it with alittle hack.Say you have a folder called "people" and you want to put an alias toit somewhere else. You should go to where you want the alias to appear and create an empty folder called "people", then add the comment ALIASin the comment box for that folder.That's it, the empty folder "people" will now appear with an @ at theend of it (in the website) and will point to the real "people"folder. You can have as many ALIAS folders as you want, pointing tothe same or different folders.There's also support for directory aliases where the ALIAS name isdifferent from the real folder. So if you have a folder called"robots" as a subfolder of your "Business" folder and you want to put analias to it called "Commercial" into your "AI" / "robotics" folder,go to "robotics", create an empty folder called "Commercial", and finallyadd the comment "ALIAS robots" in the comment box for that folder..SH Setting Private FoldersIf there is a particular entry or folder that you want bk2site toignore simply give it the comment PRIVATE. The comment must be allin capital letters and must be the only text on the comment field..SH Sorting BookmarksYou can also have bk2site automatically sort the bookmarks in afolder. This is done by adding the appropiate comments to thefolder. The valid values are:.IP "sort title normal"sorts based on title, alphabetically..IP "sort title inverse"in inverse alphabetical on title..IP "sort creation normal"Sort based on the time when the bookmark wascreated. The more recent ones come first..IP "sort creation inverse"more recent come last..IP "sort modified normal"Sort based on the time when the bookmark waslast modified. The more recent ones comefirst..IP "sort modified inverse"more recent come last..IP "sort visit normal"Sort based on the time when the bookmark waslast visited. The more recent ones comefirst..IP "sort visit inverse"more recent come last..IP "sort hits normal"Sort based on the number of hits, as determinedby reading the urllog file. The ones with more hitscome first.IP "sort hits inverse"Less hits come first..PPThese comments are case-insensitive.Remember that the folders only have a title and a creation date, sosorting them on visit or modified will not do anything to them..SH Output of Bookmark fileYou can use the -o switch, or the "outputbookmarkfile" variable in.bk2siterc, to tell bk2site to output a bookmark file that containsonly the bookmarks that are shown on the website. That is, it excludesthose that were not under the main folder and those that where underPRIVATE folders. For example.EXbk2site -o /tmp/published-bookmarks.html.EEwill write out to /tmp/published-bookmarks.html. This is useful if youwant to give someone else a bookmark file containing only your publicbookmarks. Netscape can read these bookmark files.The -ns switch prevents bk2site from actually generating a website. Itis useful when you just want to generate the output bookmarkfilewithout creating a website:.EXbk2site -ns -o /tmp/published-bookmarks.html bookmarkfile1.html file2.html file3.html.EEThere are a couple of problems with this output. bk2site will (1) Ignoreany <HR> in the original. (2) Replace all <BR> with a space (they arethere, trust me). (3) Get rid of "sort" comments, instead thebookmarks will be sorted with the appropiate order..SH Merging Bookmark Filesbk2site can merge several bookmark files. For example:.EXbk2siste -o /tmp/merged-bookmarks.html ~/.netscape/bookmarks.html /home/joe/.netscape/bookmarks.html.EEwill merge your bookmarks (~/.netscape/bookmarks.html)with Joe's (/home/joe/.netscape/bookmarks.html)In order for this to happen, Joe's bookmarks must have some folderswith the comment PUBLISH on them. Each one of these folders will bematched (using its name) with a folder on your bookmark file. The twofolders, along with any subfolders, will be merged. If Joe has extrasubfolders, they will be created and added.If a new bookmark has the same (identical) URL as one already in thatfolder, it will be ignored.The new bookmarks are added at the end of the folder. If you want tochange the order, use the sort commands above.This technique works fine if you and Joe are coordinating---Joe mustplace the PUBLISH comments in the appropiate folders. But, what if youdownloaded a bookmarks.html file from the web and want to add it, asis, to your site. This can be accomplished with the INCLUDE keyword.You simply create a folder where you want to include the newbookmarfile, and give it the comment:.EXINCLUDE /tmp/filename.html.EEor you can use a url like.EXINCLUDE http://www.multiagent.com/multiagent-bookmarks.html.EEThe file will be read and merged under that folder. Since they aremerged, you can also add your own bookmarks under the folder.To summarize: Merging can be done either by:1- Specifying many files on the command line. The first one is theroot bookmark file, the rest of them must have folders marked"PUBLISH", which will be merged with the folders on the root bookmarkfile with the same name.2- Including the comment "INCLUDE url" in some of your folders,where url is the name of some other bookmark file to includeunder that folder. You can also add your own bookmarks under thisfolder..SH Generating extra files.If you want to generate more files, for example, a file just thetophits or just the new additions, this can be done using the"extrafilebase" and "extrafilename" variables in your .bk2siterc. .IP "extrafilebase"The base file for an extra file you wish to generate..IP "extrafilename" The name of the output file..PPThese two variables need to appear in pairs and in order, for example: .EXextrafilebase /etc/bk2site/newbase.htmlextrafilename new.html.EEThis means that the base file is newbase.html and the output filegenerated by processing this base file will be written tonew.html. Note that the files you create need not be html. In fact,this feature can be used to generate any kind of text file(e.g. my.netscape channels, email newsletters, etc.). .SH Displaying channels[For the uninitated, channels are simply xml files that summarize asite's contents. Many popular news sites like slashdot and freshmeatmake these available for anyone to download and use, as long as yougive them proper credit. Please read and obey each individual site'suse restrictions for their content.]Another fun feature is to read and display other people's my.netscapechannels in your pages. This can be done by first setting threevariables in your .bk2siterc for each channel that you whish toshow. The variables are..IP "channelname"The name you will use to refer to this channel. Pick something you can remember..IP "channelurl"The url where we can download this channel. bk2site only supportshttp: and file: methods. ftp will have to wait..IP "channelfile"A file to which we write the channel we just read. Also, if thechannel cannot be downloaded from the url, bk2site will read this file instead. This way you avoid having empty channels in your pages..PPFor example, to set up a slashdot channel you would do:.EXchannelname slashdotchannelurl http://slashdot.org/slashdot.rdfchannelfile /tmp/slashdot-channel.EENow, this sets up the channel but it does not display it. In order todisplay the channel you must define a section like the ones we usedbefore but using the channel name instead of a section name. Forexample, to display the slashdot channel you would place the followingin one (or more) of your base files:.EX<!--bk2site:begin slashdot-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -