mdoc(1)
π mdoc(1) β the Mono documentation management tool, bestie edition π
okay so you found the manual page for mdoc, from the General Commands Manual section of the Mono docs. Grab a strawberry π, sit down, we're gonna talk about documentation management and it's gonna be so good.
β¨ NAME β¨
mdoc β the Mono documentation management tool. yes that's the whole vibe. π
πΈ SYNOPSIS πΈ
mdoc command [options] [args]
π¦ OVERVIEW π¦
okay so mdoc is an assembly-based documentation management system. assembly-based!! it reads your compiled assembly, not your source. iconic behavior honestly.
mdoc lets you create and update documentation stubs based on the contents of an assembly. and the way that it does this is β it does not rely on documentation found within the source code. nope. not even a little. π«
and here's why that's lowkey genius, the advantages:
- Code readability. Good documentation is frequently (a) verbose, and (b) filled with examples. (For comparison β compare Microsoft .NET Framework documentation, which is often a page or more of docs for each member, to JavaDoc documentation, which can often be a sentence for each member.)
Inserting good documentation into the source code can frequently bloat the source file, as the documentation can be longer than the actual method that is being documented. like imagine your doc comment being longer than your whole function. embarrassing for the source file ngl.
- Localization. In-source documentation formats (such as
csc /doc) have no support for multiple human languages. If you need to support more than one human language for documentation purposes,mdocis useful as it permits each language's output to reside in its own directory, andmdoccan add types/members for each separate documentation directory. multilingual slay π - Administration. It's not unusual to have separate documentation and development teams. It's also possible that the documentation team will have minimal experience with the programming language being used. In such circumstances, inline documentation is not desirable as the documentation team could inadvertantly insert an error into the source code while updating the documentation. Alternatively, you may not want the documentation team to have access to the source code for security reasons.
mdocallows the documentation to be kept completely separate and distinct from the source code used to create the assembly. π«Ά (yes "inadvertantly" is spelled that way in the original, we don't fix, we respect the lore)
so documentation can be generated using the mdoc update command:
mdoc update -o docs/en ProjectName.dll
Once the documentation stubs have been generated (and hopefully later filled in with actual documentation), there are three ways to view the documentation:
- To generate a simple directory of HTML pages (one HTML file per type), use
mdoc export-html:
mdoc export-html -o /srv/www/htdocs/ProjectName docs/en
- To use an ASP.NET webapp to display the sources, see:
http://anonsvn.mono-project.com/source/trunk/monodoc/engine/web/.
From a monodoc source checkout, you can do this:
cd engine
make web
This will use xsp(1) to serve the ASP.NET webapp; Visit http://localhost:8080/ to view the documentation. localhost realness π»β¨
- To use the
monodoc(1)documentation browser, you must first assemble the documentation:
mdoc assemble -o ProjectName docs/en
The above command creates the files ProjectName.tree and ProjectName.zip. An additional ProjectName.sources file must be provided which describes where in the help system the documentation should be hooked up; it is a very simple XML file, like this:
<?xml version="1.0"?>
<monodoc>
<source provider="ecma" basefile="ProjectName"
path="various" />
</monodoc>
The above configuration file describes that the documentation is in ECMA format, that the base file name is ProjectName and that it should be hooked up in the "various" part of the documentation tree. If you want to look at the various nodes defined in the documentation, you can look at the monodoc.xml file which is typically installed in /usr/lib/monodoc/monodoc.xml.
Once you have all of the required files (.zip, .tree and .sources) you can install them into the system with the following command:
cp ProjectName.tree ProjectName.zip ProjectName.source \
`pkg-config monodoc --variable sourcesdir`
The above will copy the files into the directory that Monodoc has registered; you might need root permissions to do this. The actual directory is returned by the pkg-config invocation. π
π¨ bestie heads up: that last command might need root. don't just sudo blindly, okay? know what you're copying and where.
π MDOC COMMANDS π
mdoc assembleβ Compiles documentation for use within themonodoc(1)browser.
See the mdoc-assemble(1) man page for details.
mdoc export-htmlβ Exports documentation into a directory structure of HTML files.
See the mdoc-export-html(1) man page for details.
mdoc export-msxdocβ Exports documentation into the single-file Microsoft XML Documentation format.
See the mdoc-export-msxdoc(1) man page for details.
mdoc helpβ View internal help for a given command.
mdoc help assemble
is equivalent to:
mdoc assemble --help
Multiple sub-commands may be listed at once:
mdoc help assemble export-html update validate
multiple at once?? efficiency queen π
mdoc updateβ Updates documentation, adding and removing members based upon a reference assembly.
See the mdoc-update(1) man page for details.
mdoc validateβ Validates the documentation against the Mono documentation schema.
See the mdoc-validate(1) man page for details.
π SEE ALSO π
mdoc(5), mdoc-assemble(1), mdoc-export-html(1), mdoc-update(1), mdoc-validate(1)
π MAILING LISTS π
Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details. join the list, gossip about docs, it's giving community πΈ
π WEB SITE π
Visit http://www.mono-project.com/docs/tools+libraries/tools/mdoc/ for details
and that's the whole page, bestie β¨
<cute>this one lives in the mdoc(1) corner of the General Commands Manual β same mdoc(1) name in the footer, no extra version stamp or date printed down there, just the humble page tag. so if you see mdoc(1) twice, that's not a glitch, that's the manual being consistent. periodt. π</cute>
π¦ where this page comes from
- alpine 3.24: mono-doc 6.14.1-r1 Β· MIT
- arch rolling: mono 6.12.0.206-1 Β· GPL AND LGPL2.1 AND MPL
- debian bookworm: monodoc-base 6.8.0.105+dfsg-3.3+deb12u1 Β· MIT
- debian trixie: monodoc-base 6.12.0.199+dfsg-6 Β· MIT
- epel 10: monodoc 6.14.1-1.el10_2 Β· MIT
- epel 9: monodoc 6.12.0-5.el9 Β· MIT
- fedora 43: monodoc 6.12.0-21.fc43 Β· MIT
- fedora 44: monodoc 6.14.1-3.fc44 Β· MIT
- fedora 44: monodoc 6.14.1-4.fc44 Β· MIT
- nixos 26.05: mono 6.14.1
- nixpkgs unstable: mono 6.14.1
- opensuse-leap 16.0: monodoc-core 6.12.0-bp160.1.1 Β· LGPL-2.1-only
- opensuse-leap 16.0: monodoc-core 6.12.0-bp160.1.1 Β· LGPL-2.1-only
- opensuse-leap 16.0: monodoc-core 6.12.0-bp160.1.1 Β· LGPL-2.1-only
- opensuse-leap 16.0: monodoc-core 6.12.0-bp160.1.1 Β· LGPL-2.1-only
- ubuntu jammy: monodoc-base 6.8.0.105+dfsg-3.2 Β· MIT
- ubuntu noble: monodoc-base 6.8.0.105+dfsg-3.6ubuntu2 Β· MIT
- ubuntu questing: monodoc-base 6.12.0.199+dfsg-6
- ubuntu resolute: mono-devel 6.14.1+ds2-2 Β· MIT
- ubuntu stonking: mono-devel 6.14.1+ds2-3 Β· MIT
- (C) 2008 Jonathan Pryor
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms