1

In scribble, I can use defproc and defform to define the documentation for a function or macro. And then scribble uses the nearest defform in the file to determine what module the function/macro is defined in.

However, sometimes it sometimes makes sense to have the documentation for the same module split up across multiple scribble files.

(Say if you want the documentation for a init function to be in repl.scrbl, and you wan the documentation for find in api.scrbl. But both of them are defined in the same module, say repl.rkt.)

However, Scribble complains when there are multiple substantiations of the same defmodule in the docs:

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)

So, is there any way I can document both functions across multiple scribble files, even though they are defined in the same module?

4

1 回答 1

0

如果这两个文件都包含在另一个文件的子部分中,比如说main.rkt,您可以将 放在defproc该文件中,其他两个文件将使用它作为 和 的defproc模块defform

例如:

#lang scribble/manual

@title{Zordoz}

@defmodule[zordoz]
@include-section[repl.scrbl]
@include-section[api.scrbl]
于 2015-09-16T19:06:52.213 回答