-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added generation of DataTypes.md documentation.
This file is copied to the IDS repository to complete the official documentation suite.
- Loading branch information
Showing
5 changed files
with
499 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Xbim.Common.Metadata; | ||
|
||
namespace IdsLib.codegen | ||
{ | ||
internal class IfcSchema_DocumentationGenerator | ||
{ | ||
internal static string Execute(Dictionary<string, typeMetadata> dataTypeDictionary) | ||
{ | ||
StringBuilder sb = new StringBuilder(); | ||
var schemas = new string[] { "Ifc2x3", "Ifc4", "Ifc4x3" }; | ||
|
||
foreach (var dataType in dataTypeDictionary.Values.OrderBy(x=>x.Name)) | ||
{ | ||
var checks = schemas.Select(x => dataType.Schemas.Contains(x) ? "✔️ " : "❌ "); | ||
|
||
sb.AppendLine($"| {dataType.Name,-45} | {string.Join(" | ", checks),-24} | {dataType.XmlBackingType,-21} |"); | ||
} | ||
|
||
var source = stub; | ||
source = source.Replace($"<PlaceHolderTable>", sb.ToString()); | ||
return source; | ||
// Program.Message($"no change.", ConsoleColor.Green); | ||
} | ||
|
||
private const string stub = @"# DataTypes | ||
Property dataTypes can be set to any values according to the following table. | ||
Columns of the table determine the validity of the type depending on the schema version and the required `xs:base` type for any `xs:restriction` constraint. | ||
| dataType | Ifc2x3 | Ifc4 | Ifc4x3 | Restriction base type | | ||
| --------------------------------------------- | ------ | ------ | ------ | --------------------- | | ||
<PlaceHolderTable> | ||
Please note, this document has been automatically generated via the IDS Audit Tool repository, any changes should be initiated there. | ||
"; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.