Thanks for the pointers. This helps already, although I now realize that I didn't phrase my question precise enough.
With dynamic-require
I can assign the doc
to a variable and then reference the part (or other content) as I want to, so that's good. I now have two follow-up questions:
- When I render both documents, I now have a warning about multiple keys (
WARNING: collected information for key multiple times
). Is there an easy way of renaming the tags that I include? - Is there a more convenient way of referencing other content? Ideally I could use something like the tagging function from scribble, but instead of linking to the content, it would just include it.
Currently, my files are as follows.
use.scrbl
:
#lang scribble/base
@(require scribble/core)
@(define x (dynamic-require "doc.scrbl" 'doc))
@(car (part-blocks x))
@(car (part-parts x))
and doc.scrbl
:
#lang scribble/base
text
@section{s1}
content
When I now call scribble {doc,use}.scrbl
I get the following output/warning:
WARNING: collected information for key multiple times: '(index-entry (part "s1")); values: (list '("s1") (list (element #f '("s1"))) (part-index-desc)) (list '("s1") (list (element #f '("s1"))) (part-index-desc))
WARNING: collected information for key multiple times: '(part "s1"); values: '#(("s1") (part "s1") (1) #<path:doc.html> #f) '#(("s1") (part "s1") (1) #<path:use.html> #f)
[Output to doc.html]
[Output to use.html]
I am not sure if the warning is important, but I suppose if I now wanted to link to the section, then scribble would rightfully trip up as it does not know which one to refer to. So I suppose renaming would be a good idea.
To expand on this point a bit more, in the document above, I can now reference the section s1
via @secref["s1"]
and get a link to the part/section. What would be nice is another function that essentially works like secref
but instead includes the content (possibly renaming the tag to a unique string) in the document where the function is called.