mdoc-update(1)
π mdoc-update(1) β the manual page, but make it slay π
okay so bestie, welcome to mdoc-update, aka the mdoc update command from the General Commands Manual section 1. she's giving documentation-format support for mdoc(5) and honestly? she's iconic. let's get into it π«Ά
β¨ NAME β¨
mdoc update β mdoc(5) documentation format support π
π SYNOPSIS π
mdoc update [OPTIONS]* ASSEMBLIES
πΈ DESCRIPTION πΈ
so like, mdoc update has a whole to-do list and she does NOT skip items. here's what she's responsible for:
- Creating documentation stubs based on
ASSEMBLIES. the stub-creation process will create brand newmdoc(5)XML files for each type withinASSEMBLIES, and it'll provide documentation stubs for each member of those types. every single one. no member left behind π - Update documentation stubs based on
ASSEMBLIES. existingmdoc(5)documentation can be updated to reflect changes withinASSEMBLIES, like added types and members, while preserving existing documentation. your hard work stays put, bestie.
in some limited circumstances, renames will be tracked, which minimizes the documentation burden when e.g. a parameter is renamed. lowkey a lifesaver π
mdoc update does not rely on documentation found within source code, though it can import XML Documentation Comments via the -i option. versatile queen β¨
see mdoc(1) and mdoc(5) for more information. iykyk π
π OPTIONS π
--deleteβ Allowmdoc updateto delete members from documentation files. The only members deleted are members which are no longer present withinASSEMBLIESand are not present in any other assembly versions.
If a type is no longer present, the documentation file is not deleted, but is instead renamed to have a .remove extension.
Version detection is done with the //AssemblyVersion elements; if there are no //AssemblyVersion elements for a given <Type> or <Member/>, then the <Type> will be renamed and/or the <Member/> will be removed.
--exceptions[=SOURCES]β EXPERIMENTAL. This is not 100% reliable, but is intended to serve as an aid for documentation writers.
Inspect member bodies to determine what exceptions can be generated from the member.
SOURCES is an optional comma-separated list of the following sources that should be searched for exceptions:
addedβ Only generate<exception/>elements for members added during the current program execution. This keepsmdoc-updatefrom re-generating<exception/>elements for all members (and thus prevents re-insertion for members that had the<exception/>elements removed).allβ Find exceptions created in the member itself, references to members in the same assembly, and references to members in dependent assemblies.asmβ Find exceptions created in the member itself and references to members within the same assembly as the member.depasmβ Find exceptions created in the member itself and references to members within dependent assemblies.
If SOURCES isn't provided (the default), then only exceptions created within the member itself will be documented.
LIMITATIONS: Exception searching is currently implemented by looking for the exception types that are explicitly created based on the known compile-time types. This has the following limitations:
- This will not find exceptions which are implicit to the IL, such as
NullReferenceExceptionandIndexOutOfRangeException. - This will find exceptions which are not thrown, e.g.
public void CreateAnException ()
{
Exception e = new Exception ();
}
- This will not "follow" delegate and interface calls:
public void UsesDelegates ()
{
Func<int, int> a = x => {throw new Exception ();};
a (4);
}
The function UsesDelegates() won't have any exceptions documented.
- This will find exceptions which "cannot happen", such as
ArgumentNullExceptionsfor arguments which are "known" to be non-null:
public void A ()
{
B ("this parameter isn't null");
}
public void B (string s)
{
if (s == null)
throw new ArgumentNullException ("s");
}
For the above, if --exceptions=asm is provided then A() will be documented as throwing an ArgumentNullException, which cannot happen. π
-f=FLAGβ Specify a flag to alter behavior. Valid flags include:no-assembly-versionsβ See the-fno-assembly-versionsdocumentation, below.
-fno-assembly-versionsβ Do not generate/Type/AssemblyInfo/AssemblyVersionand/Type/Members/Member/AssemblyInfoelements.
This is useful to prevent "churn" during updates. Normally, if a type or member hasn't changed but the assembly version has changed, then all types and members will be updated to include a new //AssemblyVersion element, thus increasing the amount of changes that need review before committing (assuming all changes are actually reviewed before commit). π
WARNING: This will interact badly with the--deleteoption, as--deleteuses the//AssemblyVersionelements to track version changes. Thus, if you have a member which is present in an early assembly version and is removed in a subsequent assembly version, such asSystem.Text.UTF8Encoding.GetBytes(string)(which is present in .NET 1.0 but not in .NET 2.0), then the member will be removed when the--delete -fno-assembly-versionsoptions are specified, the member was present in an earlier version of the assembly, and the current version of the assembly does not contain the member.
Consequently, this option should only be specified if types and members will never be removed from an assembly. periodt.
-i,--import=FILEβ Import documentation found withinFILE.
FILE may contain either csc /doc XML or ECMA-335 XML.
-L,--lib=DIRECTORYβ AddDIRECTORYto the assembly search path, so that dependencies ofASSEMBLIEScan be found without documenting those assemblies. π¦-o,--out=DIRECTORYβ Place the generated stubs intoDIRECTORY.
When updating documentation, DIRECTORY is also the source directory.
-r=ASSEMBLYβASSEMBLYis a dependency for one ofASSEMBLIESwhich should not be documented but is required to process one ofASSEMBLIES. Add the directory containingASSEMBLYto the assembly search path.
This option is equivalent to specifying -L `dirname ASSEMBLY` .
--since=VERSIONβ When updating documentation for an assembly, if a type or member is encountered which didn't exist in the previous version of the assembly a<since version="VERSION"/>element will be inserted. β--type=TYPEβ Only update documentation for the typeTYPE.-h,-?,--helpβ Display a help message and exit. the classic π«Ά
π SEE ALSO π
mdoc(1), mdoc(5), mdoc-assemble(1), mdoc-export-html(1), mdoc-validate(1),
π MAILING LISTS π
Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details.
π§ WEB SITE π§
Visit http://www.mono-project.com for details
okay that's the whole page bestie, you ate that π
and for the cute sign-off: this lil masterpiece is mdoc-update(1) from the General Commands Manual, so go forth and document your assemblies, you main character πβ¨π
π¦ 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