; AmigaguideToHTML - Converts Amigaguide documents into HTML format; Copyright (C) 2004 Safalra (Stephen Morley);; This program is Free software; you can redistribute it and/or modify; it under the terms of the GNU General Public License as published by; the Free Software Foundation; either version 2 of the License, or; (at your option) any later version.;; This program is distributed in the hope that it will be useful,; but WITHOUT ANY WARRANTY; without even the implied warranty of; MERCHANTABILITY OR FITNESS For A PARTICULAR PURPOSE. See the; GNU General Public License For more details.;; You should have received a copy of the GNU General Public License; along with this program; if not, write to the Free Software; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.; Version string for the 'version' commandver$="$VER:1.0 (06/10/2004)"; Goto help subroutine if necessary   help <>1  help ܗ((1))="help"  help; Attempt to open file (0,(1)) ݂ "Error: The specified file could not be opened"  0; Create the output file directory "makedir "+(1)+"_html",0,0; This makes the code simplerܙ ; Initialise global and node variablesoutsidenode=smartwrap=version$=""copyright$=""author$=""help$=""indexnode$="" (0) text$=(1000) outsidenode ; We're outside a node ltext$=ܗ(text$) ܁(ltext$,6)="@$ver:" version$=ܑ(text$,1) ܁(ltext$,4)="@(c)" copyright$=ܑ(text$,5) ܁(ltext$,7)="@author" author$=ܑ(text$,8) ܁(ltext$,5)="@help" help$=ܑ(text$,6) ܁(ltext$,6)="@index" indexnode$=ܑ(ltext$,7) ܁(ltext$,10)="@smartwrap" smartwrap= ܁(ltext$,5)="@node" outsidenode= nextspace=܉(text$," ",7) nextspace=0 nodename$=ܑ(ltext$,6) title_node$=nodename$ " nodename$=܃(ltext$,7,nextspace-7) title_node$=ܑ(text$,nextspace) " ; We're inside a node ݂ "Converting node "+nodename$ output$="" keywords_node$="" next_node$="" prev_node$="" toc_node$="main" help_node$=help$ indexnode_node$=indexnode$ smartwrap_node=smartwrap ; The brackets on the next line shouldn't be necessary ; Blitz does not implement order of precedence as described ( (0)) B outsidenode text$=(1000) ltext$=ܗ(text$) ܁(ltext$,1)="@" B ܁(ltext$,2)<>"@{" ܁(ltext$,8)="@endnode" outsidenode= ܁(ltext$,5)="@help" help_node$=ܑ(ltext$,6) ܁(ltext$,6)="@index" indexnode_node$=ܑ(ltext$,7) ܁(ltext$,9)="@keywords" keywords_node$=ܑ(text$,10) ܁(ltext$,5)="@next" next_node$=ܑ(ltext$,6) ܁(ltext$,5)="@prev" prev_node$=ܑ(ltext$,6) ܁(ltext$,6)="@title" title_node$=ܑ(text$,7) ܁(ltext$,4)="@toc" toc_node$=ܑ(ltext$,5) ܁(ltext$,10)="@smartwrap" smartwrap_node= " text$=܊(text$,"@{bg back}","") text$=܊(text$,"@{bg background}","") text$=܊(text$,"@{bg fill}","") text$=܊(text$,"@{bg filltext}","") text$=܊(text$,"@{bg highlight}","") text$=܊(text$,"@{bg shadow}","") text$=܊(text$,"@{bg shine}","") text$=܊(text$,"@{bg text}","") text$=܊(text$,"@{fg back}","") text$=܊(text$,"@{fg background}","") text$=܊(text$,"@{fg fill}","") text$=܊(text$,"@{fg filltext}","") text$=܊(text$,"@{fg highlight}","") text$=܊(text$,"@{fg shadow}","") text$=܊(text$,"@{fg shine}","") text$=܊(text$,"@{fg text}","") text$=܊(text$,"@{b}","") text$=܊(text$,"@{i}","") text$=܊(text$,"@{u}","") text$=܊(text$,"@{ub}","") text$=܊(text$,"@{ui}","") text$=܊(text$,"@{uu}","") text$=܊(text$,"@{amigaguide}","AmigaguideToHTML - http://www.safalra.com/hypertext/amigaguide/html.html") text$=܊(text$,"@{jcenter}","
") text$=܊(text$,"@{jleft}","
") text$=܊(text$,"@{jright}","") text$=܊(text$,"@{line}","
") text$=܊(text$,"@{par}","

") text$=܊(text$,"@{plain}","") ; now for links ܉(text$,"@{")>0 p1=܉(text$,"@{") p2=܉(text$,"link",p1) p3=܉(text$,"}",p2) p1>1 output$=output$+܁(text$,p1-1) output$=output$+"" output$=output$+܃(text$,p1+2,p2-p1-3) output$=output$+"" p3<܏(text$) text$=ܑ(text$,p3) " ; This avoids problems with smartwrap text$=" " output$=output$+text$ smartwrap_node ܏(text$)=0 output$=output$+"

" " output$=output$+"
" okay=(1,(1)+"_html/"+nodename$+".html")  1 ݂ "" ݂ "" ݂ ""+title_node$+"" ܏(version$)>0 ݂ "" ܏(author$)>0 ݂ "" ܏(copyright$)>0 ݂ "" ܏(keywords_node$)>0 ݂ "" ݂ "" ݂ "" toc_node$<>"" ݂ "

Contents

" indexnode_node$<>"" ݂ "

Index

" help_node$<>"" ݂ "

Help

" prev_node$<>"" ݂ "

Browse <

" mext_node$<>"" ݂ "

Browser >

" ݂ output$ ݂ "

Converted by AmigaguideToHTML

" ݂ "" ݂ "" (1)  ݂ "Conversion complete"; Close file 0; Don't run into subroutines; Help information.help݂ "AmigaguideToHTML "+ܑ(ver$,5)݂ ""݂ "Usage: AmigaguideToHTML file"݂ "Where file is the Amigaguide file to convert"݂ "Files will be created in the directory file_html"