在拆分多个文件时声明defproc或变形模块(函数/宏文档)

时间:2015-09-16 18:54:39

标签: documentation racket scribble

在scribble中,我可以使用defprocdefform来定义函数或宏的文档。然后scribble使用文件中最近的defform来确定定义函数/宏的模块。

但是,有时将同一模块的文档拆分为多个scribble文件有时是有意义的。

(假设您希望init函数的文档位于repl.scrbl,并且您想要findapi.scrbl的文档。但它们都是在同一模块中定义,比如说repl.rkt。)

然而,当文档中有相同defmodule的多个证据时,Scribble会抱怨:

WARNING: collected information for key multiple times: '(index-entry (mod-path "zordoz")); values: (list '("zordoz") (list (link-element (style "RktModLink" (list 'tt-chars #0=(list (css-addition '(collects #"scribble" #"racket.css")) (tex-addition '(collects #"scribble" #"racket.tex"))))) (cached-element (style "RktSym" (list 'tt-chars #0#)) "zordoz... (list '("zordoz") (list (link-element (style "RktModLink" (list 'tt-chars #0=(list (css-addition '(collects #"scribble" #"racket.css")) (tex-addition '(collects #"scribble" #"racket.tex"))))) (cached-element (style "RktSym" (list 'tt-chars #0#)) "zordoz...
WARNING: collected information for key multiple times: '(mod-path "zordoz"); values: '#(("REPL") (mod-path "zordoz") (2) (doc #"main" #"index.html") #f) '#(("API") (mod-path "zordoz") (3) (doc #"main" #"index.html") #f)
raco setup: rendering: <pkgs>/zordoz/scribblings/main.scrbl
WARNING: collected information for key multiple times: '(index-entry (mod-path "zordoz")); values: (list '("zordoz") (list (link-element (style "RktModLink" (list 'tt-chars #0=(list (css-addition '(collects #"scribble" #"racket.css")) (tex-addition '(collects #"scribble" #"racket.tex"))))) (cached-element (style "RktSym" (list 'tt-chars #0#)) "zordoz... (list '("zordoz") (list (link-element (style "RktModLink" (list 'tt-chars #0=(list (css-addition '(collects #"scribble" #"racket.css")) (tex-addition '(collects #"scribble" #"racket.tex"))))) (cached-element (style "RktSym" (list 'tt-chars #0#)) "zordoz...
WARNING: collected information for key multiple times: '(mod-path "zordoz"); values: '#(("REPL") (mod-path "zordoz") (2) (doc #"main" #"index.html") #f) '#(("API") (mod-path "zordoz") (3) (doc #"main" #"index.html") #f)

那么,有没有什么方法可以在多个scribble文件中记录这两个函数,即使它们是在同一个模块中定义的?

1 个答案:

答案 0 :(得分:0)

如果这两个文件都包含在另一个文件的子部分中,例如main.rkt,则可以将defproc放在该文件中,另外两个文件将其用作{{1}的模块}和defproc

例如:

defform