# Why does Scribble give this duplicate information warning with \`defmodulelang\`, and how do I avoid it?

**URL:** <https://racket.discourse.group/t/why-does-scribble-give-this-duplicate-information-warning-with-defmodulelang-and-how-do-i-avoid-it/561>\
**Category:** Questions & Answers\
**Tags:** raco, scribble\
**Created:** [January 12, 2022, 5:07pm UTC](https://racket.discourse.group/t/why-does-scribble-give-this-duplicate-information-warning-with-defmodulelang-and-how-do-i-avoid-it/561 "2022-01-12T17:07:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [January 12, 2022, 5:07pm UTC](https://racket.discourse.group/t/why-does-scribble-give-this-duplicate-information-warning-with-defmodulelang-and-how-do-i-avoid-it/561/1 "2022-01-12T17:07:48Z")

</div>

There's [a gist of code available (replace `scribblings-*` with `scribblings/*`, since gists apparently can't have directories)](https://gist.github.com/benknoble/239814f37c38f7f1fc0c5c8ff79e4f6f). If you get that setup properly and do `raco pkg install`, you'll see output like in [scribble defmodulelang duplicate tag · GitHub](https://gist.github.com/benknoble/239814f37c38f7f1fc0c5c8ff79e4f6f#file-install-and-setup-log).

* * *

I wanted to create a multi-page document for a large tool (it has 2 languages and a CLI, and the languages re-export chunks of a library). However, even just stubbing out some basic pages and adding `defmodule` and `defmodulelang` (actually `defmodulelang*` in the full-version, but there was no difference) gives the warnings in the log.

- Why?
- How do I avoid it?

I have read [4.2.2&nbsp;Documenting Modules](https://docs.racket-lang.org/scribble/doc-modules.html#%28form._%28%28lib._scribble%2Fmanual..rkt%29._defmodule%29%29) which says

> Besides generating text, unless #:no-declare appears as an option, this form expands to a use of [declare-exporting](https://docs.racket-lang.org/scribble/doc-modules.html#%28form._%28%28lib._scribble%2Fmanual..rkt%29._declare-exporting%29%29) with module-paths; the #:use-sources clause, if provided, is propagated to [declare-exporting](https://docs.racket-lang.org/scribble/doc-modules.html#%28form._%28%28lib._scribble%2Fmanual..rkt%29._declare-exporting%29%29). Consequently, [defmodule](https://docs.racket-lang.org/scribble/doc-modules.html#%28form._%28%28lib._scribble%2Fmanual..rkt%29._defmodule%29%29) should be used at most once in a section without #:no-declare, though it can be shadowed with [defmodule](https://docs.racket-lang.org/scribble/doc-modules.html#%28form._%28%28lib._scribble%2Fmanual..rkt%29._defmodule%29%29)s in sub-sections. Use #:no-declare form when you want to provide a more specific list of modules (e.g., to name both a specific module and one that combines several modules) via your own [declare-exporting](https://docs.racket-lang.org/scribble/doc-modules.html#%28form._%28%28lib._scribble%2Fmanual..rkt%29._declare-exporting%29%29) declaration

But the second `defmodulelang` is in a document inserted via `include-section` so it should be in a sub-section, no? Or have I misunderstood something?

* * *

Somewhat relatedly, which I or a mod can split off to a new topic if desired: since the lang re-exports things original presented from the library, how can I reasonably document the bindings in both places? One option is to say "lang re-exports all of X, Y, Z" and conversely "these bindings are provided by lib X and lang." But I saw `#:use-sources` and

> Use #:use-sources sparingly, but it is needed when
> 
> - bindings are documented as originating from a module M, but the bindings are actually re-exported from some module P; and
> - other documented modules also re-export the bindings from P, but they are documented as re-exporting from M.

and this is just confusing enough for me that I haven't tried to draw the ideas yet to figure out if I need it or how to use it.

---

<div class="post-metadata">

**Author:** ![jbclements](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jbclements/32/11_2.png) [@jbclements](https://racket.discourse.group/u/jbclements)\
**Post date:** [January 15, 2022, 1:23am UTC](https://racket.discourse.group/t/why-does-scribble-give-this-duplicate-information-warning-with-defmodulelang-and-how-do-i-avoid-it/561/2 "2022-01-15T01:23:29Z")

</div>

Shooting in the dark, haven't even read your message carefully, but is there any way this could be related to

> <https://github.com/racket/scribble/commit/7be6ce536b961d96a4ed7c82ce6827af5e0a783b>
>
> Also, improve the shortcut that avoids \`pre-part\` on immediate
> strings.

which is a change that will be a part of the 8.4 release?

Again, haven't done my homework on this, probably unrelated, just a thought.

EDIT: pretty sure I'm on the wrong track here, my apologies.

---

<div class="post-metadata">

**Author:** ![mflatt](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/mflatt/32/6_2.png) [@mflatt](https://racket.discourse.group/u/mflatt)\
**Post date:** [January 15, 2022, 1:04pm UTC](https://racket.discourse.group/t/why-does-scribble-give-this-duplicate-information-warning-with-defmodulelang-and-how-do-i-avoid-it/561/3 "2022-01-15T13:04:34Z")

</div>

It looks like your "info.rkt" specifies two documents: "dupe-tag-doc.scrbl" and "dupe-tag-lang.scrbl". At the same time, "dupe-tag-doc.scrbl" includes "dupe-tag-lang.scrbl" via `@include-section{dupe-tag-lang.scrbl}`, which means that the redered form has a copy of "dupe-tag-lang.scrbl". So, anything defined in "dupe-tag-lang.scrbl" will be defined twice.

The intended approach to this kind of documentation is that "dupe-tag-lang.scrbl" would define some bindings and "dupe-tag-doc.scrbl" would just link to the "dupe-tag-lang.scrbl" documentation, instead of having its own copy. For example, it module X reexports everything from module Y, a typical approach is to write something like "The `@racketmodname[X]` module reprovides all bindings of `@racketmodname[Y]`, in addition to the bindings documented here."

---

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [January 19, 2022, 12:33am UTC](https://racket.discourse.group/t/why-does-scribble-give-this-duplicate-information-warning-with-defmodulelang-and-how-do-i-avoid-it/561/4 "2022-01-19T00:33:20Z")

</div>

Hm, it seems I didn't understand the typical patterns for Scribble, then.

I was hoping to have a multi-page "main documentation" for an overview plus a series of related documented interfaces to the same core ideas (this includes, basically, a language and a library). But I was hoping that the language and API documents could also be separate, so that the local installation's documentation page would have "Foo" (the multi-page tutorial + other docs), _and_ "Foo lang", "Foo API" in the relevant sections.

It seems that's not a supported (or at least intended use), so I will re-think this idea.
