diff --git a/OmegaLeo.HelperLib.XmlDocGenerator/EXAMPLE.md b/OmegaLeo.HelperLib.XmlDocGenerator/EXAMPLE.md index 6814fd9..83f9a7b 100644 --- a/OmegaLeo.HelperLib.XmlDocGenerator/EXAMPLE.md +++ b/OmegaLeo.HelperLib.XmlDocGenerator/EXAMPLE.md @@ -1,5 +1,27 @@ # Documentation Attribute IDE Tooltip Example +## Recommended: Use Markdown for Code Examples + +For the best IDE experience, we **strongly recommend using markdown code fences** in your `codeExample` parameter: + +```csharp +[Documentation( + "MyMethod", + "Does something cool", + new[] { "param: Description" }, + @"```csharp +// Use markdown code fences like this! +MyMethod(""example""); +```" +)] +``` + +This provides: +- ✅ Proper syntax highlighting in IDEs +- ✅ Better formatting in IntelliSense tooltips +- ✅ Consistent appearance across Visual Studio, Rider, and VS Code +- ✅ Markdown rendering in documentation generators + ## Before (Without XML Doc Generator) When using the `DocumentationAttribute` without the XML Doc Generator, IDEs would not show the documentation: diff --git a/OmegaLeo.HelperLib.XmlDocGenerator/README.md b/OmegaLeo.HelperLib.XmlDocGenerator/README.md index 0f22ddc..5fa1211 100644 --- a/OmegaLeo.HelperLib.XmlDocGenerator/README.md +++ b/OmegaLeo.HelperLib.XmlDocGenerator/README.md @@ -22,12 +22,37 @@ If you want to use the XmlDocGenerator standalone: dotnet add package OmegaLeo.HelperLib.XmlDocGenerator ``` +## Usage Best Practices + +### ✨ Recommended: Use Markdown in Code Examples + +For the best IDE experience, **use markdown code fences** in your `codeExample` parameter: + +```csharp +[Documentation( + "MyMethod", + "Does something cool", + new[] { "param: Description" }, + @"```csharp +// Markdown code fence provides syntax highlighting! +MyMethod(""example""); +```" +)] +public void MyMethod(string param) { } +``` + +**Benefits:** +- ✅ Proper syntax highlighting in Visual Studio, Rider, and VS Code +- ✅ Better formatting in IntelliSense tooltips +- ✅ Professional appearance +- ✅ Works with documentation generators + ## How It Works 1. **MSBuild Integration**: The package includes MSBuild targets that are automatically imported -2. **Build-Time Generation**: Runs after CoreCompile to analyze your compiled assembly +2. **Build-Time Generation**: Runs after Build to augment your final XML documentation 3. **Attribute Reading**: Uses reflection to read DocumentationAttribute instances -4. **XML Generation**: Creates/augments XML documentation files +4. **XML Generation**: Creates/augments XML documentation files in your output directory 5. **IntelliSense Ready**: IDEs automatically pick up the generated XML ## Features diff --git a/OmegaLeo.HelperLib.XmlDocGenerator/build/OmegaLeo.HelperLib.XmlDocGenerator.targets b/OmegaLeo.HelperLib.XmlDocGenerator/build/OmegaLeo.HelperLib.XmlDocGenerator.targets index dc54012..4cbfb98 100644 --- a/OmegaLeo.HelperLib.XmlDocGenerator/build/OmegaLeo.HelperLib.XmlDocGenerator.targets +++ b/OmegaLeo.HelperLib.XmlDocGenerator/build/OmegaLeo.HelperLib.XmlDocGenerator.targets @@ -2,14 +2,15 @@ $(MSBuildThisFileDirectory)..\tools\net8.0\OmegaLeo.HelperLib.XmlDocGenerator.dll - $(IntermediateOutputPath)$(TargetFileName) - $(IntermediateOutputPath)$(TargetName).xml + + $(TargetDir)$(TargetFileName) + $(TargetDir)$(TargetName).xml $(MSBuildThisFileDirectory)OmegaLeo.HelperLib.XmlDocGenerator/bin/$(Configuration)/net8.0/OmegaLeo.HelperLib.XmlDocGenerator.dll - $(IntermediateOutputPath)$(TargetFileName) - $(IntermediateOutputPath)$(TargetName).xml + + $(TargetDir)$(TargetFileName) + $(TargetDir)$(TargetName).xml + +