`)
Ins_Newline(1)
while (! AT_EoF) {
Search(" : ", NOERR+ERRBREAK)
Del_Char(3)
Reg_Copy_Block(103, Bol_Pos, Cur_Pos, DELETE) // date
Search(" : ")
Del_Char(3)
Reg_Copy_Block(104, BoL_Pos, Cur_Pos, DELETE) // name => SUBname remains
BoL
Ins_Text('| ')
Reg_Ins(104)
Ins_Text(' | (')
Reg_Ins(105)
Ins_Text(') | ')
Reg_Ins(103)
Ins_Text(' |
')
}
Ins_Newline(1)
Reg_Ins(94) // table footer
BoF
Reg_Ins(91) // HTML-header
Save_Pos()
Replace("@HTMLTITLE@", "|@(90)", REVERSE+NOERR)
Restore_Pos()
Ins_Text("Full index sorted by modification date
")
Ins_Newline(1)
Ins_Text('[ main | index-by-name | index-by-date ] (Time is CET (GMT+1))
')
Ins_Newline(1)
EoF
Ins_Text('
[ main | index-by-name | index-by-date ] (Time is CET (GMT+1))
')
Reg_Ins(95) // HTML-footer
File_Save(NOMSG)
Buf_Quit(OK)
//----------------------------------------------------------------
Buf_Switch(#85) // temp. buffer
Buf_Empty(OK)
if (File_Exist("|@(89)/index.html", NOERR)) {
File_Open("|@(89)/index.html")
Search("(Last changed at", NOERR+ADVANCE)
if (! Error_Match) {
#103=Cur_Pos
Search_Block(")", Cur_Pos, EoL_Pos, NOERR)
if (! Error_Match) {
Del_Block(#103, Cur_Pos)
Ins_Text(" ")
Out_Ins()
Date(REVERSE+NOCR+NOMSG) // yyyy-mm-dd
Out_Ins(CLEAR)
File_Save(NOMSG)
}
}
}
Buf_Quit(OK)
Buf_Switch(Buf_Free)
Reg_Ins(80, BEGIN) // list of macros
while (! At_EoF) {
Ins_Text("copy ")
EoL
Ins_Text(" ")
Reg_Ins(87) // target website root directory
Ins_Text("\")
Reg_Ins(88) // target website macros directory
Line(1, ERRBREAK)
}
Ins_Text("copy ")
Reg_Ins(89)
Ins_Text("\*.html ")
Reg_Ins(87) // target website root directory
File_Save_As("copy-to-website.cmd", OK+NOMSG)
Buf_Quit(OK)
Buf_Switch(#92) // definition file
File_Save(NOMSG)
if (#99 == -1) {
BoF
// Buf_Quit(OK) // ?
} else {
Restore_Pos()
}
return
//=============================================================================
:FORMATBLOCK:
BoF
#104=Cur_Pos
while(Search("", NOERR+ADVANCE) > 0) { // just after
#105=Cur_Col-5 // Cur_Col of
Set_Marker(9, Cur_Pos)
Replace_Block("|<|W","", #104, Cur_Pos, BEGIN+ALL+NOERR) // remove leading whitespace up to here
Goto_Pos(Marker(9)) // just after
Line(1, NOERR)
#104=Cur_Pos // first line of after the tag itself
Search("", NOERR+ADVANCE)
if (EM) {
EoF
Set_Marker(9, Cur_Pos)
} else {
Set_Marker(9, Cur_Pos)
Char(-6) // To do : see below
}
BoL
while (Cur_Pos >= #104) { // backwards up to first line of pre block
Search("|!|W", NOERR)
if (EM) {
} else {
if (Cur_Col > #105) {
Del_Char(-#105+1) // del spaces to the left
} else {
Del_Char(-Cur_Col+1) // del spaces to the left
}
}
Line(-1)
}
Goto_Pos(Marker(9)) // after
#104=Cur_Pos
}
Replace("|<|W","", ALL+NOERR) // remove leading whitespace in remainder of buffer
Replace("|N|[|W]_|[|W]"," ", BEGIN+ALL+NOERR) // remove line continuations incl. CR/LF
Replace("|N","
", BEGIN+ALL+NOERR) // replace NewLines with
return
//=============================================================================
// Show some help instructions (the inline doco from top of the macro)
:SHOWHELP:
Key_Purge()
Win_Clear
#103=Buf_Num
Buf_Switch(XBUF1)
Reg_Ins(Macro_Num)
BoF
Search("|H3CDOC>", NOERR) // the leading "<" is masked out intentionally!
if (EM) {
Message("\n\n No inline help found.")
} else {
Line(1)
Del_Block(0,Cur_Pos)
Search("|H3C/DOC>", NOERR)
if (!EM) {
BoL
Del_Block(Cur_Pos, File_Size)
}
Replace("^/+", BEGIN+ALL+REGEXP+NOERR) // remove leading comment characters
BoF
while(! At_EoF) { // shorten lines longer than window width (not perfect, but ...)
Goto_Col(Win_Cols)
Del_Block(Cur_Pos, EoL_Pos)
Line(1, NOERR+ERRBREAK)
}
EoF
#106=Cur_Line - 1 // number of lines to display
#105=Win_Lines - 1 // number of lines displayable in the window
BoF
repeat(ALL) {
Win_Clear
Type(#105, NORESTORE)
if (Cur_Line >= #106) {
break
}
#104=Get_Key("\nPress any key to continue or to quit ...", STATLINE+RAW)
if (#104==27) {
break
}
}
}
Update
Buf_Quit(OK)
Buf_Switch(#103)
Visual_Macro(NOMSG)
if (#104 != 27) {
Get_Key("\nPress any key to close help...", STATLINE+RAW)
}
return
//=========================================================================================
// Key-Assignment: If in definition file: Load the file where the cursor is on
:LOADFILE:
if (Buf_Num == #92) {
Save_Pos()
BoL
if ((Cur_Char == '*') || At_EoL) { return } // To do: check inactives
Search("|{|:,|X}", NOERR)
if (EM) {
Restore_Pos()
return
}
Search("|! ", REVERSE+ADVANCE)
Reg_Copy_Block(103, BoL_Pos, Cur_Pos)
Restore_Pos()
if (#103==0) {
File_Open("|@(103)")
#97=Buf_Num+1000
} else {
Reg_Set(121, @103)
Call("Open_URL")
}
} else {
if (#103==0) {
if (Buf_Num == (#97-1000)) {
File_Close(CONFIRM+NOMSG)
Buf_Quit()
Buf_Switch(#92)
}
}
}
return
//=========================================================================================
// Key-Assignment: If in definition file: Delete the file where the cursor is on
:DELFILE:
if (Buf_Num == #92) {
Save_Pos()
BoL
if ((Cur_Char == '*') || At_EoL) { return }
Search("|{|:,|X}", NOERR)
if (EM) {
Restore_Pos()
return
}
Search("|! ", REVERSE+ADVANCE)
Reg_Copy_Block(103, BoL_Pos, Cur_Pos)
Restore_Pos()
if (File_Exist("|@(103)", NOERR)) {
#104=Dialog_Input_1(104,"`Deletion of file`,
`Should the file |@(103) really be deleted?`,
`[&Yes]`,`[&No]`",APP+CENTER,0,0)
if (#104 == 1) {
File_Delete("|@(103)", OK)
BoL
Reg_Ins(85) // make entry inactive
Ins_Text(" [deleted] ")
}
} else {
#104=Dialog_Input_1(104,"`Deletion of file`,
`The file |@(103) doesn't exist.`,
`[&OK]`",APP+CENTER,0,0)
}
}
return
//=======================================================================================
//
// SETUP-HTTP - Set @106 with best shell command to run the current
// web-browser. Set #106 with any needed Sys() options.
//
:SETUP-HTTP:
Registry_Get_Item(106,"HKEY_CLASSES_ROOT\http\shell\open\command\")
if (Reg_Size(106)<5) {
Reg_Set(106,"start ")
#106 = 0 // No options for Win95/98/ME
if (Is_WinNT) { // In WinNT/2000/XP...
#106 = DOS+SUPPRESS+SIMPLE // "start" only works from cmd box
}
return
}
//
// Strip any command options specified in the registry. Needed for Opera.
//
// Not only old versions of Opera have options (New ones does not?!)
// New Netscapes (e.g. 7.1) have '-url "%1"'
// IExplorer has '-nohome'
// ==> since "%1" has to be replaced with the real URL we can
// do exactly that, or easier: remove the "%1" here at all:
// And the URL is appended in the code above.
//
#106=Buf_Num
Buf_Switch(Buf_Free(EXTRA))
Buf_Empty(OK)
Reg_Ins(106)
Replace("/|M|>","",BEGIN+NOERR)
Replace('|["]%1|["]','',BEGIN+ALL+NOERR)
BOF
Reg_Copy(106,1)
Buf_Quit(OK)
Buf_Switch(#106)
#106 = 0 //No Sys() options needed
return
//
// OPEN_URL - Open the file/URL named in T-Reg 121 in the standard web browser
//
:Open_URL:
Call("SETUP-HTTP")
if (File_Exist(@121,NOERR) > 0) { //If file exists...
#104=File_Check(@121) //Remember the status if already open
File_Open("|@(121)") //Open it (temporarily)
Reg_Set(121,"file://")
Reg_Set(121,PATHNAME, APPEND) //@121 = full pathname to file
if (#104==-1) { Buf_Quit(OK) } //If just opened it, close it
}
Sys(`|@(106) "|@(121)"`,#106+NOWAIT) //Open URL in browser
return
//=========================================================================================
:CREATE_HIST_LINK:
// inp: @79 MAIN:EDIT:TEST
// @82 CURRENT
// outp: @103
// Navigation: main > edit > test
#103=Buf_Num
Buf_Switch(Buf_Free)
Reg_Ins(79)
BoF
#104=Cur_Pos
while(search(":", NOERR) > 0) {
Reg_Copy_Block(104, #104, Cur_Pos)
Case_Lower_Block(#104, Cur_Pos)
Ins_Text(`.html">`)
Reg_Ins(104)
Ins_Text(` > `)
Reg_Ins(104)
Ins_Text(` > `)
Reg_Ins(82)
Ins_Text(` ]
`)
BoF
// Ins_Text(`Level history for navigation: Heading line of main page
Template definition file
*MAIN}
index.txt : this file itself (if it's named index.txt)
* Entries marked with *> are "deactivated entries".
* That means: If the file is found on disk this entry is activated again
* by removal of *>.
* And vice versa: If a file is active here in the list, but not found on
* disk, it's deactivated here with insertion of *>.
file1
file2
* Really commented out entries are completely ignored:
* file3
*************************************************************************************************************************
*{SUB(MAIN):CATEGORY1: First category
This category contains ...
*SUB}
*************************************************************************************************************************
*{TAB:Group 1}
file4
file5
*************************************************************************************************************************
*{SUB(MAIN:CATEGORY1):SUBCATEGORY1: First sub category
*SUB}
*************************************************************************************************************************
file6
file7
file8
*************************************************************************************************************************
*{SUB(MAIN):CATEGORY2: Second category
Here are ...
*SUB}
*************************************************************************************************************************
*{TAB:Name of Group 2}