2015-10-25 50 views
1

我要生成Erlang的模塊上的文檔, 下面是模塊的代碼:如何在edoc中顯示進程pid <0.20071.1>?

%% @doc <strong>sysDtop</strong> is a tool for presenting information about erlang processes similar to the information presented by "top" in UNIX. 
%% 
%% <p><code>sysDtop</code> presents <code>top</code>-like information for an AXD301 CP.</p> 
%% <code>sysDtop</code> info looks like this: 
%% <pre> 
%% [email protected]   size 40(36)M, cpu% 3, procs 582, runq 0 14:42:28 
%% memory[kB]: proc 9614, atom 1742, bin  128, code 18315, ets 5305 
%% pid   name      current   msgq  mem reds 
%% <0.20071.1> sysDtop     sysDtop:pinf/3  0 301416 99384 
%% </pre> 
%% <p>The info on the first status line is:<br></br>erlang node name, size in Mbyte (allocated(used)), cpu load, number of erlang processes, processes in erlang run queue, current time.</p> 
%% <p>the second status line shows used memory in kBytes for different data types.</p> 
%% <p>the info on the process lines is:<br></br>erlang pid, process name/entry point, current function, number of messages in message queue, size of process heap in Bytes, number of reductions last 5 seconds.</p> 
%% <p>standard unix process info (from <code>ps</code>) follows.</p> 

但是當我使用edoc:file生成EDOC,這是一個錯誤:

43> edoc:file("/vobs/mgwblade/SYF/SYF_CRA1190070/SYS_CNA11333/src/sysDtop.erl"). 
2991- fatal: {invalid_name,"0.2007"} 
/vobs/mgwblade/SYF/SYF_CRA1190070/SYS_CNA11333/src/sysDtop.erl, in module header: at line 10: error in XML parser: {fatal,{{invalid_name,"0.2007"}, 
          {file,file_name_unknown}, 
          {line,18}, 
          {col,4}}}. 
** exception exit: error 
    in function edoc_tags:parse_tag/4 (edoc_tags.erl, line 279) 
    in call from edoc_tags:parse_tags/5 (edoc_tags.erl, line 262) 
    in call from edoc_extract:get_tags/6 (edoc_extract.erl, line 572) 
    in call from edoc_extract:source1/5 (edoc_extract.erl, line 129) 
    in call from edoc:read/2 (edoc.erl, line 538) 
    in call from edoc:file/2 (edoc.erl, line 116) 

錯誤顯示目前的fo <0.20071.1>是錯誤的,我該如何修改它?

+2

您是否試圖用'&lt'和'&gt'逃避'<' and '>'字符? –

+0

@ŁukaszPtaszyński是的,你是對的,我已經做到了。 – BlackMamba

回答

2

EDoc支持XHTML markup language,其結果之一是解析器將pid <0.20071.1>作爲標記,因此需要首先轉義以形成&lt0.20071.1&gt

相關問題