OSK.UML.Exporters.PlantUML 0.1.0

dotnet add package OSK.UML.Exporters.PlantUML --version 0.1.0                
NuGet\Install-Package OSK.UML.Exporters.PlantUML -Version 0.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OSK.UML.Exporters.PlantUML" Version="0.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OSK.UML.Exporters.PlantUML --version 0.1.0                
#r "nuget: OSK.UML.Exporters.PlantUML, 0.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install OSK.UML.Exporters.PlantUML as a Cake Addin
#addin nuget:?package=OSK.UML.Exporters.PlantUML&version=0.1.0

// Install OSK.UML.Exporters.PlantUML as a Cake Tool
#tool nuget:?package=OSK.UML.Exporters.PlantUML&version=0.1.0                

OSK.UML

The project provides the core logic to creating Uml diagrams from a file or directory by using the Framework project as a basis. A UmlParser will utilize a IUmlDefinition and an IFileTokenReader to parse files into respective Uml Diagrams. Consumers wanting to access the Uml Generator will need to add the dependencies of the project to their dependency container by using the AddUmlDiagrams extension. A Uml generator implementation is provided by the library as well as an integration that utilizes PlantUml for exporting the uml diagram to a viewable file. The generator should be seen as the focal point of entry into the library, by using the GenerateUmlAsync function.

OSK.UML.Framework

This project defines a set of interfaces and implementations that parse and track the state of UmlElements as file tokens are processed. UmlInterpreters work in conjunction with a UmlDefinition to parse file tokens into a Uml Element. The definitions are meant to describe the different modifiers, types, and other descriptive information that can be encountered when parsing a programming language file. A UmlDefinition can be viewed as the way a programming language generally describes its syntax, by using a UmlSyntaxRuleTemplate. These templates allow an interpreter to read file tokens and refer to the rules referenced by the template to determine if a method, property, constructor, etc. has been encountered in a file as it is being processed. A base class UmlDefinition exists to provide an example and potential inheritance point for creating other definitions for other languages, and a default definition, DefaultUmlDefinition, is provided that should support most C# language use cases. For an example of how to define a syntax template, we will look at one syntax template that could be used to describe a method in a class file:

new UmlSyntaxTemplate(SyntaxRuleType.Visibility, SyntaxRuleType.Modifiers,
                        SyntaxRuleType.Type, SyntaxRuleType.Name, SyntaxRuleType.Parameters)
                    {
                        ElementType = UmlElementType.Method
                    }

In the above, we can see that a template for a method has been provided which consistts of some specific SyntaxRuleTypes. This is describing a tepmlate of defining a method that should be read in the following order: visibility keywords, modifier keywords, Type name, object Name, and Parameters. Syntax rule types are designed to differentiate what each file token an interpreter is looking at belongs to in a given UmlElement diagram. The keywords mentioned are also defined in a IUmlDefinition and are referenced by the interpreter to correctly identify and place them on the resulting Uml diagram that is generated. The UmlSyntaxTemplates defined in the default utilize a constructor that will create the UmlSyntaxRule objects using standard C# conventions, such as allowing multiple keywords for modifiers, a singular response type or object name, etc. but there is an overload for the template object that allows a consumer to specify their own custom syntax rules that are not tied to C#.

Key Note: the core classes available for use from this project, beyond the stated interfaces that can be used interchangeably within the core logic, are the UmlDefinition and DefaultUmlDefinition objects. Consumers should create new definition files for other languages beyond C#, if they are needed, and the base class for definitions can hopefully offer an easier way to integrate with the library if it is necessary.

OSK.UML.Exporters.PlantUML

The exporter project is meant to provide an implementation of an IUmlExporter that utilizes the PlantUml library. To use this exporter, consumers will want to add it using the AddPlantUml dependency extension.

For more information regarding this library, you can visit https://plantuml.com/

OSK.UML.CommandLine

The command line tool currently supports UML generations for C# projects, but should be configurable to target other languages/files based on user integration with required interfaces. The tool can be targeted to a file or directory and will generate a UML image for the files discovered. An example generation command below:

umlgenerator -p path/to/directory/or/file -o /output/directory

Note: When using the PlantUML integration for UML export, the path given should be an absolute path within the file system used or PlanUML will generate the related UML image into a directory that may not be caught by the tool. See https://plantuml.com/command-line for more information.

Example UML output

domainModel

Docker supprt

A docker image has been deployed to https://hub.docker.com/repository/docker/blankdev117/umlgenerator and can be used to generate UML diagrams within a container

Contributions and Issues

Any and all contributions are appreciated! Please be sure to follow the branch naming convention OSK-{issue number}-{deliminated}-{branch}-{name} as current workflows rely on it for automatic issue closure. Please submit issues for discussion and tracking using the github issue tracker.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 73 12/18/2024
0.0.1 134 6/23/2024