Skip to content

Commit

Permalink
Add support for viewing diagrams in GitHub pages (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
SlavaVedernikov authored May 5, 2024
2 parents b573f24 + 49d19a0 commit 1a40eab
Show file tree
Hide file tree
Showing 47 changed files with 18,953 additions and 32 deletions.
4 changes: 2 additions & 2 deletions C4InterFlow.Automation/C4InterFlow.Automation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<Deterministic>true</Deterministic>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Version>1.2.0</Version>
<Version>1.3.0</Version>
</PropertyGroup>

<PropertyGroup>
<PackageId>C4InterFlow.Automation</PackageId>
<PackageVersion>1.2.0</PackageVersion>
<PackageVersion>1.3.0</PackageVersion>
<Authors>Slava Vedernikov</Authors>
<Description>Revolutionise your Application Architecture Documentation with C4InterFlow. Designed for Architects and Engineers, this tool leverages the widely-recognised C4 Model (Architecture Visualisation framework), enhanced with unique features like Interface and Flow, to describe your Application Architecture as Code. Experience an intuitive, efficient way to document complex systems, ensuring clarity and consistency across your teams and products.</Description>
<Copyright>Copyright 2024 Slava Vedernikov</Copyright>
Expand Down
2 changes: 1 addition & 1 deletion C4InterFlow.Cli/C4InterFlow.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.2.0</Version>
<Version>1.3.0</Version>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
Expand Down
12 changes: 10 additions & 2 deletions C4InterFlow.Cli/CLI Commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ draw-diagrams --aac-input-paths "C:\C4InterFlow\Samples\Internet Banking System\

draw-diagrams --aac-input-paths "C:\C4InterFlow\Samples\Internet Banking System\CSV\Architecture\Json" --aac-reader-strategy "C4InterFlow.Automation.Readers.JsonAaCReaderStrategy,C4InterFlow.Automation" --interfaces BigBankPlc.SoftwareSystems.*.Containers.*.Interfaces.* --business-processes BigBankPlc.BusinessProcesses.* --levels-of-details context container --output-dir "C:\C4InterFlow\Samples\Internet Banking System\CSV\Diagrams"

draw-diagrams --aac-input-paths "C:\C4InterFlow\Samples\E-Commerce Platform\Yaml\Architecture" --aac-reader-strategy "C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation" --interfaces ECommercePlatform.SoftwareSystems.*.Interfaces.* ECommercePlatform.SoftwareSystems.*.Containers.*.Interfaces.* --levels-of-details context container --output-dir "C:\C4InterFlow\Samples\E-Commerce Platform\Yaml\Diagrams"

publish-site --site-source-dir "C:\C4InterFlow\Publishers\StaticSite" --output-dir "C:\C4InterFlow\Samples\E-Commerce Platform\Yaml\Diagrams"


draw-diagrams --aac-input-paths "C:\C4InterFlow\Samples\E-Commerce Platform\Yaml\Architecture" --aac-reader-strategy "C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation" --interfaces ECommercePlatform.SoftwareSystems.*.Interfaces.* ECommercePlatform.SoftwareSystems.*.Containers.*.Interfaces.* --levels-of-details context container --output-dir "C:\C4InterFlow\Samples\E-Commerce Platform\Yaml\Diagrams"
publish-site --site-source-dir "C:\C4InterFlow\Publishers\StaticSite" --output-dir "C:\architecture-as-code-samples-visualiser\e-commerce-platform" --environment-variables "HOMEPAGE=architecture-as-code-samples-visualiser/e-commerce-platform"

publish-site --site-source-dir "C:\C4InterFlow\Publishers\StaticSite" --output-dir "C:\architecture-as-code-samples-visualiser\dotnet-eshop" --environment-variables "HOMEPAGE=architecture-as-code-samples-visualiser/dotnet-eshop"

publish-site --site-source-dir "C:\C4InterFlow\Publishers\StaticSite" --output-dir "C:\architecture-as-code-samples-visualiser\internet-banking-system" --environment-variables "HOMEPAGE=architecture-as-code-samples-visualiser/internet-banking-system"

publish-site --site-source-dir "C:\C4InterFlow\Publishers\StaticSite" --output-dir "C:\architecture-as-code-samples-visualiser\todo-app" --environment-variables "HOMEPAGE=architecture-as-code-samples-visualiser/todo-app"

draw-diagrams --aac-input-paths "C:\C4InterFlow\Samples\E-Commerce Platform\Yaml\Architecture" --aac-reader-strategy "C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation" --interfaces ECommercePlatform.SoftwareSystems.BuyingAndMerchandisingApp.Interfaces.CreatePurchaseOrder --levels-of-details context --scopes software-system-interface --types c4-sequence --output-dir "C:\C4InterFlow\Samples\E-Commerce Platform\Yaml\Diagrams"
publish-site --site-source-dir "C:\C4InterFlow\Publishers\StaticSite" --output-dir "C:\architecture-as-code-samples-visualiser\trader-x" --environment-variables "HOMEPAGE=architecture-as-code-samples-visualiser/trader-x"
1 change: 1 addition & 0 deletions C4InterFlow.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
context.Add<QueryByInputCommand>();
context.Add<ExecuteAaCStrategyCommand>();
context.Add<GenerateDocumentationCommand>();
context.Add<PublishSiteCommand>();
});

await root.Run();
2 changes: 1 addition & 1 deletion C4InterFlow.Cli/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"C4InterFlow.Cli": {
"commandName": "Project",
"commandLineArgs": "draw-diagrams --business-processes BtcTurk.BusinessProcesses.* --levels-of-details container --types c4-sequence --aac-reader-strategy \"C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"C:\\Data\\Work\\BtcTurk\\Architecture\\Borsa Istanbul\\BIST Integration\\Architecture\" --output-dir \"C:\\Data\\Work\\BtcTurk\\Architecture\\Borsa Istanbul\\BIST Integration\\Diagrams\""
"commandLineArgs": "publish-site --site-source-dir \"C:\\C4InterFlow\\Publishers\\StaticSite\" --output-dir \"C:\\architecture-as-code-samples-visualiser\\e-commerce-platform\" --environment-variables \"HOMEPAGE=architecture-as-code-samples-visualiser/e-commerce-platform\" --site-content-sub-dirs \"Software Systems\" \".c4s\" --site-no-sitemap-sub-dirs \".c4s\""
}
}
}
5 changes: 3 additions & 2 deletions C4InterFlow/C4InterFlow.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<Deterministic>true</Deterministic>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Version>1.2.0</Version>
<Version>1.3.0</Version>
</PropertyGroup>

<PropertyGroup>
<PackageId>C4InterFlow</PackageId>
<PackageVersion>1.2.0</PackageVersion>
<PackageVersion>1.3.0</PackageVersion>
<Authors>Slava Vedernikov</Authors>
<Description>Revolutionise your Application Architecture Documentation with C4InterFlow. Designed for Architects and Engineers, this tool leverages the widely-recognised C4 Model (Architecture Visualisation framework), enhanced with unique features like Interface and Flow, to describe your Application Architecture as Code. Experience an intuitive, efficient way to document complex systems, ensuring clarity and consistency across your teams and products.</Description>
<Copyright>Copyright 2024 Slava Vedernikov</Copyright>
Expand Down Expand Up @@ -64,6 +64,7 @@

<ItemGroup>
<PackageReference Include="Fluid.Core" Version="2.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.CommandLine" Version="[2.0.0-beta4.22272.1,)" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions C4InterFlow/Cli/Commands/DrawDiagramsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ public static async Task<int> Execute(DiagramOptions diagramOptions, string[]? i
}
}

Console.WriteLine($"{COMMAND_NAME} command completed.");
Console.WriteLine($"'{COMMAND_NAME}' command completed.");
Console.WriteLine($"See diagram(s) in '{Path.GetFullPath(outputOptions.OutputDirectory)}'");
return 0;
}
catch (Exception e)
{
Console.WriteLine($"Diagram(s) generation failed with exception(s) '{e.Message}'{(e.InnerException !=null ? $", '{e.InnerException}'" : string.Empty)}.");
Console.WriteLine($"'{COMMAND_NAME}' command failed failed with exception(s) '{e.Message}'{(e.InnerException !=null ? $", '{e.InnerException}'" : string.Empty)}.");
return 1;
}
}
Expand Down
2 changes: 1 addition & 1 deletion C4InterFlow/Cli/Commands/ExecuteAaCStrategyCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private static async Task<int> Execute(string architectureRootNamespace, string
}
catch (Exception e)
{
Console.WriteLine($"Architecture As Code automation Strategy execution failed: '{e.Message}'");
Console.WriteLine($"'{COMMAND_NAME}' command execution failed: '{e.Message}'");
return 1;
}
}
Expand Down
4 changes: 2 additions & 2 deletions C4InterFlow/Cli/Commands/GenerateDocumentationCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ private static async Task<int> Execute(string[] structures, string templatesDire
}
}

Console.WriteLine($"{COMMAND_NAME} command completed.");
Console.WriteLine($"'{COMMAND_NAME}' command completed.");
return 0;
}
catch (Exception e)
{
Console.WriteLine($"Documentation generation failed with exception(s) '{e.Message}'{(e.InnerException != null ? $", '{e.InnerException}'" : string.Empty)}.");
Console.WriteLine($"'{COMMAND_NAME}' command failed with exception(s) '{e.Message}'{(e.InnerException != null ? $", '{e.InnerException}'" : string.Empty)}.");
return 1;
}
}
Expand Down
16 changes: 16 additions & 0 deletions C4InterFlow/Cli/Commands/Options/BatchFileOption.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.CommandLine;

namespace C4InterFlow.Cli.Commands.Options;

public static class BatchFileOption
{
public static Option<string> Get()
{
const string description =
$"The path to .bat (batch) file to be executed by the command";

var option = new Option<string>(new[] { "--batch-file", "-bf" }, description);

return option;
}
}
6 changes: 6 additions & 0 deletions C4InterFlow/Cli/Commands/Options/DiagramFormatsOption.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using C4InterFlow.Structures;
using System.CommandLine;

namespace C4InterFlow.Cli.Commands.Options;
Expand All @@ -23,4 +24,9 @@ public static Option<string[]> Get()

return option;
}

public static string[] GetAllDiagramFormats()
{
return new[] { PUML, SVG, PNG, MD };
}
}
21 changes: 21 additions & 0 deletions C4InterFlow/Cli/Commands/Options/EnvironmentVariablesOption.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System.CommandLine;
using System.CommandLine.Parsing;

namespace C4InterFlow.Cli.Commands.Options;

public static class EnvironmentVariablesOption
{
public static Option<string[]> Get()
{
const string description =
"The expressions to be used to set environment variables before external batch file is executed e.g. SOME_VARIABLE=some-value.";

var option = new Option<string[]>(new[] { "--environment-variables", "-ev" }, description)
{
AllowMultipleArgumentsPerToken = true
};
option.SetDefaultValue(null);

return option;
}
}
6 changes: 4 additions & 2 deletions C4InterFlow/Cli/Commands/Options/OutputDirectoryOption.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.CommandLine;
using System.CommandLine.Parsing;

namespace C4InterFlow.Cli.Commands.Options;

Expand All @@ -10,7 +9,10 @@ public static Option<string> Get()
const string description =
"The output directory for the current command.";

var option = new Option<string>(new[] { "--output-dir", "-od" }, description);
var option = new Option<string>(new[] { "--output-dir", "-od" }, description)
{
IsRequired = true
};

option.SetDefaultValue(Directory.GetCurrentDirectory());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static class OutputSubDirectoryOption
public static Option<string> Get()
{
const string description =
"The sub-directory where the Diagram(s) should be saved.";
"The output sub-directory for the current command";

var option = new Option<string>(new[] { "--output-sub-dir", "-osd" }, description);

Expand Down
16 changes: 16 additions & 0 deletions C4InterFlow/Cli/Commands/Options/SiteBuildDirectoryOption.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.CommandLine;

namespace C4InterFlow.Cli.Commands.Options;

public static class SiteBuildDirectoryOption
{
public static Option<string> Get()
{
const string description =
$"The directory where built site can be found";

var option = new Option<string>(new[] { "--site-build-dir", "-sbd" }, description);

return option;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.CommandLine;

namespace C4InterFlow.Cli.Commands.Options;

public static class SiteContentSubDirectoriesOption
{
public static Option<string[]> Get()
{
const string description =
$"The sub-directories where site content can be found.";

var option = new Option<string[]>(new[] { "--site-content-sub-dirs", "-scsds" }, description)
{
AllowMultipleArgumentsPerToken = true
};
option.IsRequired = true;

return option;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.CommandLine;

namespace C4InterFlow.Cli.Commands.Options;

public static class SiteNoSitemapSubDirectoriesOption
{
public static Option<string[]> Get()
{
const string description =
$"The sub-directories that shoud be excluded from a sitemap.";

var option = new Option<string[]>(new[] { "--site-no-sitemap-sub-dirs", "-snssds" }, description)
{
AllowMultipleArgumentsPerToken = true
};
option.SetDefaultValue(null);

return option;
}
}
19 changes: 19 additions & 0 deletions C4InterFlow/Cli/Commands/Options/SiteSourceDirectoryOption.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.CommandLine;

namespace C4InterFlow.Cli.Commands.Options;

public static class SiteSourceDirectoryOption
{
public static Option<string> Get()
{
const string description =
$"The directory where site source can be found";

var option = new Option<string>(new[] { "--site-source-dir", "-ssd" }, description)
{
IsRequired = true
};

return option;
}
}
Loading

0 comments on commit 1a40eab

Please sign in to comment.