1.3. 定制 MHonArc

上面的步骤提及了 MHonArc 的模板配置文件 $HOME/.mhonarc.mrc。下面是我定制的一个模板。至于详细内容参考 MHonArc 的帮助。


<!--The MHonARC documentation on the web provides a good introduction to all the below -->

<SORT>		# List messages by date in main index
<REVERSE>	# Sort messages in the reverse order
<TSORT>		# Want thread index
<TREVERSE>	# Sort thread index in the reverse order
<MULTIPG>	# Split index page into multiple pages, each page contain $IDXSIZE$ articles
<IDXSIZE>
100
</IDXSIZE>


<LOCALDATEFMT>
%y/%m/%d %H:%M:%S
</LOCALDATEFMT>

<MSGLOCALDATEFMT>
%y/%m/%d %H:%M:%S
</MSGLOCALDATEFMT>

<GMTDateFmt>
%y/%m/%d %H:%M:%S GMT
</GMTDateFmt>

<TTITLE>
$IDXTITLE$(线索)
</TTITLE>


<CharsetConverters override>
plain;    mhonarc::htmlize
default;  mhonarc::htmlize 
</CharsetConverters>


<!--
 ***************************************************************
 Define a custom resource variable representing our link. 
 ***************************************************************
-->

<DefineVar>
HOME-LINK
[<a href="/">HOME</a>]
</DefineVar>

<IDXFNAME>
index.html
</IDXFNAME>

<IDXPREFIX>
index
</IDXPREFIX>

<TIDXFNAME>
threads.html
</TIDXFNAME>

<TIDXPREFIX>
threads
</TIDXPREFIX>

<TIDXLABEL>
<a href='threads.html'>依线索排序</a>
</TIDXLABEL>

<IDXLABEL>
<a href='index.html'>依日期排序</a>
</IDXLABEL>


<!--
 ***************************************************************
 Main Index Page
 ================
	IDXPGSSMARKUP
	IDXPGBEGIN
	    LISTBEGIN
		(AUTHORBEGIN |
		 DAYBEGIN |
		 SUBJECTBEGIN)?
		LITEMPLATE+
		(AUTHOREND |
		 DAYEND |
		 SUBJECTEND)?
	     LISTEND
	    DOC?
	IDXPGEND
 ***************************************************************
-->

<IdxPgBegin>
<!doctype html public "-//W3C//DTD HTML//EN">
<html>
<head>
  <meta http-equiv="Content-Language" content="zh-cn">
  <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  <link rel="STYLESHEET" type="text/css" href="/inc/css/main.css"/>
  <title>$IDXTITLE$ - $PAGENUM$/$NUMOFPAGES$</title>
</head>
<body>
<center>
<script language="javascript" src="/inc/jscript/header.js" type="text/javascript"></script>
<table border=0 width=90%>
  <tr><td>
<table border=0 width=100%>
  <tr>
   <td class="idxtitle">
     $IDXTITLE$
   </td>
  </tr>
  <tr>
    <td class="homelink">
      $HOME-LINK$
    </td>
  </tr>
</table>
<br>
</IdxPgBegin>


<IdxPgEnd>
  </td></tr>
</table>
<script language="javascript" src="/inc/jscript/footer.js" type="text/javascript">
write_footer("Page $PAGENUM$/$NUMOFPAGES$");
</script>
</center>
</body>
</html>
</IdxPgEnd>


<ListBegin>
<hr>
<table border=0 width=100%>
<ul>
  <li>更新日期: $LOCALDATE$,Articles: $NUMOFIDXMSG$/$NUMOFMSG$, Page: $PAGENUM$/$NUMOFPAGES$</li>
  <li>$TIDXLABEL$</li>
  <li>$PGLINK(PREV)$ | [<a href="$PG(FIRST)$">First Page</a>] | [<a href="$PG(LAST)$">Last Page</a>] | $PGLINK(NEXT)$</li>
</ul>
</table>
<hr>
<table border=0 width=100%>
  <tr>
    <td ALIGN=LEFT VALIGN="middle" width=2%></td>
    <td ALIGN=LEFT VALIGN="middle" width=68%><strong><U>标题</U></strong></td>
    <td ALIGN=LEFT VALIGN="middle" width=10%>[<strong><U>作者</U></strong>]</td>
    <td ALIGN=LEFT VALIGN="middle" width=20%>[<strong><U>日期</U></strong>]</td>
  </tr>
  <!-- Blank Row left out intentionally -->
  <tr>
    <td ALIGN=LEFT VALIGN="middle"></td>
    <td ALIGN=LEFT VALIGN="middle"></td>
    <td ALIGN=LEFT VALIGN="middle"></td>
    <td ALIGN=LEFT VALIGN="middle"></td>
  </tr>
</ListBegin>


<LISTEND>
</table>
<hr>
<table border=0 width=100%>
<ul>
  <li>更新日期: $LOCALDATE$,Articles: $NUMOFIDXMSG$/$NUMOFMSG$, Page: $PAGENUM$/$NUMOFPAGES$</li>
  <li>$TIDXLABEL$</li>
  <li>$PGLINK(PREV)$ | [<a href="$PG(FIRST)$">First Page</a>] | [<a href="$PG(LAST)$">Last Page</a>] | $PGLINK(NEXT)$</li>
</ul>
</table>
</LISTEND>


<LiTemplate> #this defoines the LI's of every list on the main index page
<tr>
  <td ALIGN=LEFT VALIGN="top">
    <strong>#</strong></td>
  <td ALIGN=LEFT VALIGN="top">
    <font class="msgtitle">$SUBJECT:65$</font></td>
  <td ALIGN=LEFT VALIGN="top">
    [<font class="msgauthor">$FROMNAME:10$</font>]</td>
  <td ALIGN=LEFT VALIGN="top">
    [<font class="msgdate">$MSGLOCALDATE$</font>]</td>
</tr>
</LiTemplate>


<!--
 ***************************************************************
 Thread Index Page
 =================
	TIDXPGSSMARKUP
	TIDXPGBEGIN
	    THEAD
		((TTOPBEGIN
		    TSUBLISTBEG
			((TLITXT
			    [possible subthread listing]
			  TLIEND)|
			(TLINONE
			    [possible subthread listing]
			 TLINONEEND))+
		    (TSUBJECTBEG
			((TLITXT
			    [possible subthread listing]
			  TLIEND)|
			(TLINONE
			    [possible subthread listing]
			 TLINONEEND))+
		     TSUBJECTEND)?
		    TSUBLISTEND
		  TTOPEND)
		 |
		 TSINGLETXT)* [message w/o references or follow-ups]
	    TFOOT
	    DOC?
	TIDXPGEND
 ***************************************************************
-->

<TIdxPgBegin> #Every index page will have this at the begining
<!doctype html public "-//W3C//DTD HTML//EN">
<html>
<head>
  <meta http-equiv="Content-Language" content="zh-cn">
  <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  <link rel="STYLESHEET" type="text/css" href="/inc/css/main.css"/>
  <title>$TIDXTITLE$ - $PAGENUM$/$NUMOFPAGES$</title>
</head>
<body>
<center>
<script language="javascript" src="/inc/jscript/header.js" type="text/javascript"></script>
<table border=0 width=90%>
  <tr><td>
<table border=0 width=100%>
  <tr>
   <td class="idxtitle">
     $TIDXTITLE$
   </td>
  </tr>
  <tr>
    <td class="homelink">
      $HOME-LINK$
    </td>
  </tr>
</table>
<br>
</TIdxPgBegin>


<TIdxPgEnd>
  </td></tr>
</table>
<script language="javascript" src="/inc/jscript/footer.js" type="text/javascript">
write_footer("Page $PAGENUM$/$NUMOFPAGES$");
</script>
</center>
</body>
</html>
</TIdxPgEnd>


<THead>
<hr>
<table border=0 width=100%>
<ul>
  <li>更新日期: $LOCALDATE$,Articles: $NUMOFIDXMSG$/$NUMOFMSG$, Page: $PAGENUM$/$NUMOFPAGES$</li>
  <li>$IDXLABEL$</li>
  <li>$PGLINK(TPREV)$ | [<a href="$PG(TFIRST)$">First Page</a>] | [<a href="$PG(TLAST)$">Last Page</a>] | $PGLINK(TNEXT)$</li>
</ul>
</table>
<hr>
<ul>
</THead>


<TFoot>
</ul>
<hr>
<table border=0 width=100%>
<ul>
  <li>更新日期: $LOCALDATE$,Articles: $NUMOFIDXMSG$/$NUMOFMSG$, Page: $PAGENUM$/$NUMOFPAGES$</li>
  <li>$IDXLABEL$</li>
  <li>$PGLINK(TPREV)$ | [<a href="$PG(TFIRST)$">First Page</a>] | [<a href="$PG(TLAST)$">Last Page</a>] | $PGLINK(TNEXT)$</li>
</ul>
</table>
</TFoot>


<TTopBegin>
<li>
  <font class="msgtitle">$SUBJECT:65$</font>,
  <font class="msgauthor">$FROMNAME:10$</font>,
  <font class="msgdate">$MSGLOCALDATE$</font>
</TTopBegin>


<TTopEnd>
</li>
</TTopEnd>


<TContBegin>
<li>
  <font class="msgtitle">$SUBJECT:65$</font>, <EM>(continued)</EM>,
  <font class="msgauthor">$FROMNAME:10$</font>,
  <font class="msgdate">$MSGLOCALDATE$</font>
</TContBegin>


<TContEnd>
</li>
</TContEnd>


<TSubListBeg>
<ul>
</TSubListBeg>


<TSubListEnd>
</ul>
</TSubListEnd>


<TLiTxt>
<li>
  <font class="msgtitle">$SUBJECT:65$</font>,
  <font class="msgauthor">$FROMNAME:10$</font>,
  <font class="msgdate">$MSGLOCALDATE$</font>
</TLiTxt>


<TLiEnd>
</li>
</TLiEnd>


<TLiNone>
<li><em>Message not available</em>
</TLiNone>


<TLiNoneEnd>
</li>
</TLiNoneEnd>


<TSubjectBeg>
<li>&lt;Possible follow-up(s)&gt;</li>
</TSubjectBeg>


<TSUBJECTEND>
</TSUBJECTEND>


<TSingleTxt>
<li>
  <font class="msgtitle">$SUBJECT:65$</font>,
  <font class="msgauthor">$FROMNAME:10$</font>,
  <font class="msgdate">$MSGLOCALDATE$</font>
</TSingleTxt>


<!--
 ***************************************************************
 Message Page
 ============
 The message page contains a single message converted to HTML and archive navigational links.
	MSGPGSSMARKUP
	MSGPGBEGIN
	    MSGHEAD
	    TOPLINKS
	    SUBJECTHEADER
	    Converted message header
	    HEADBODYSEP
	    Converted message body
	    MSGBODYEND
	    (FOLUPBEGIN
		FOLUPLITXT+
	     FOLUPEND)?
	    (REFSBEGIN
		REFSLITXT+
	     REFSEND)?
	    BOTLINKS
	    MSGFOOT
	MSGPGEND
 ***************************************************************
-->
<MsgPgBegin>
<!doctype html public "-//W3C//DTD HTML//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="STYLESHEET" type="text/css" href="/inc/css/main.css"/>
<title>$SUBJECTNA:20$</title>
</head>

<body>
  <center>
  <script language="javascript" src="/inc/jscript/header.js" type="text/javascript"></script>

  <table border=0 width=90%>
    <tr><td>
  <table border=0 width=100%>
    <tr>
      <td class="idxtitle">
        $SUBJECTNA$
      </td>
    </tr>
    <tr>
      <td class="homelink">
        $HOME-LINK$
      </td>
    </tr>
  </table>
  <br>
</MsgPgBegin>


<MsgPgEnd>
    </td></tr>
  </table>
  <script language="javascript" src="/inc/jscript/footer.js" type="text/javascript">
    write_footer("$LOCALDATE$");
  </script>
  </center>
</body>
</html>
</MsgPgEnd>


<MSGHEAD>
</MSGHEAD>


<MSGFOOT>
</MSGFOOT>


<TopLinks>
<hr>
<ul>
  <li>$BUTTON(PREV)$$BUTTON(NEXT)$$BUTTON(TPREV)$$BUTTON(TNEXT)</li>
  <li>$[<a href="$IDXFNAME$#$MSGNUM$">Date Index</a>][<a href="$TIDXFNAME$#$MSGNUM$">Thread Index</a>]</li>
</ul>
</TopLinks>


<SubjectHeader>
<h1>$SUBJECTNA$</h1>
</SubjectHeader>


<HEADBODYSEP>
<hr>
</HEADBODYSEP>


<MSGBODYEND>
<hr>
</MSGBODYEND>


<FOLUPBEGIN>
<ul><li><strong>跟帖</strong>:
<ul>
</FOLUPBEGIN>


<FOLUPLITXT>
<li><strong>$SUBJECT$</strong>
<ul><li><em>From:</em> $FROM$</li></ul></li>
</FOLUPLITXT>


<FOLUPEND>
</ul></li></ul>
</FOLUPEND>


<REFSBEGIN>
<ul><li><strong>参考</strong>:
<ul>
</REFSBEGIN>


<REFSLITXT>
<li><strong>$SUBJECT$</strong>
<ul><li><em>From:</em> $FROM$</li></ul></li>
</REFSLITXT>


<REFSEND>
</ul></li></ul>
</REFSEND>


<BotLinks>
<ul>
  $LINK(PREV)$$LINK(NEXT)$
  $LINK(TPREV)$$LINK(TNEXT)$
  <li>Index(es):
    <ul>
      <li><a href="$IDXFNAME$#$MSGNUM$">
      <strong>日期排序</strong></a></li>
      <li><a href="$TIDXFNAME$#$MSGNUM$">
      <strong>线索排序</strong></a></li>
    </ul>
  </li>
</ul>
</BotLinks>


与该模板对应的 css 文件


p {font-size:9pt}
h1 {font-size:18pt;line-height:130%;font-weight:"bold";align:"center";color:"red";}

td,li,select,input {font-size:9pt}
.sect1 {font-size:9pt;line-height:150%;color:#333333;background-color:#E1E1E1;font-weight:bolder;}
.datetime {font-size:9pt;color:"red"}
.star  {font-size:9pt;color:"red"}
.gray {font-size:9pt;color:"gray"}
.cvskw {font-size:9pt}
.footer           {font-size:9pt;font-weight:bolder}
.footer A:link    {font-size:9pt;font-weight:bolder}
.footer A:active  {font-size:9pt;font-weight:bolder}
.footer A:visited {font-size:9pt;font-weight:bolder}
.footer A:hover   {font-size:9pt;font-weight:bolder}
A:link {color: #000000;}
A:visited {color: #000000;}
A:active,A:hover {color : #000000}
HTML BODY { LINE-HEIGHT: 1.2; MARGIN: 0 0 2em 0 }
UL { list-style-image: url("/images/dot.gif") }

.em           {font-size:"9pt";color:"red";font-weight:"bolder";font-style:"normal";letter-spacing:"2px";}
.em A:link    {color: "red";letter-spacing:"4px";}
.em A:active  {color: "red";letter-spacing:"4px";}
.em A:visited {color: "red";letter-spacing:"4px";}
.em A:hover   {color: "red";letter-spacing:"4px";font-size:"12pt";}

.idxtitle {text-align:"center";text-valign:"middle";background-color:"#006666";font-size:"12pt";font-weight:"bold";color:"#FFFFFF";}
.homelink {text-align:"right";text-valign:"middle";font-size:"9pt";color:"#AB0000";}

hr		{border:dashed; color:blue; height:1px;}

.msgtitle	{font-size:"9pt";color:"black";font-weight:"bolder";font-style:"normal";}
.msgauthor	{font-size:"9pt";color:"black";font-weight:"normal";font-style:"italic";}
.msgdate	{font-size:"9pt";color:"gray"; font-weight:"normal";font-style:"normal";}