Skip to content

Commit 0ffc7e9

Browse files
committed
Update API documentation generation.
1 parent c919b24 commit 0ffc7e9

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/apidocs.fsx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,40 @@ ApiDocs.GenerateHtml(
391391
substitutions = []
392392
)
393393

394+
(**
395+
### Adding extra dependencies
396+
397+
When building a library programmatically, you might require a reference to an additional assembly.
398+
You can pass this using the `otherFlags` argument.
399+
*)
400+
401+
let projectAssembly = Path.Combine(root, "bin/X.dll")
402+
403+
let projectInput = ApiDocInput.FromFile(projectAssembly)
404+
405+
ApiDocs.GenerateHtml(
406+
[ projectInput ],
407+
output = Path.Combine(root, "output"),
408+
collectionName = "Project X",
409+
template = Path.Combine(root, "templates", "template.html"),
410+
substitutions = [],
411+
otherFlags = [ "-r:/root/ProjectY/bin/Debug/net6.0/Y.dll" ]
412+
)
413+
414+
(**
415+
or use `libDirs` to pass to include all assemblies from an entire folder.
416+
Tip: A combination of `<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>` in the fsproj file and setting `libDirs` to the compilation output path leads to only one folder with all dependencies referenced.
417+
This might be easier especially for large projects with many dependencies.
418+
*)
419+
420+
ApiDocs.GenerateHtml(
421+
[ projectInput ],
422+
output = Path.Combine(root, "output"),
423+
collectionName = "Project X",
424+
template = Path.Combine(root, "templates", "template.html"),
425+
substitutions = [],
426+
libDirs = [ "ProjectX/bin/Debug/netstandard2.0" ]
427+
)
394428

395429
(**
396430
## Rebasing Links

0 commit comments

Comments
 (0)