Welcome to the MtconnectTranspiler.Sinks.ScribanTemplates
repository, an abstract sink implementation designed to facilitate file generation using the MtconnectTranspiler framework and the Scriban templating engine. This library serves as a foundation for developers looking to create custom ITranspilerSink
implementations, leveraging the powerful Scriban syntax to generate files from the deserialized SysML model provided by the MtconnectTranspiler library.
The MtconnectTranspiler framework enables the deserialization of SysML models into a structured, object-oriented format conducive for further processing. The MtconnectTranspiler.Sinks.ScribanTemplates
library extends this capability by providing a template-based approach to generating output files, making it an ideal starting point for developers wishing to create custom outputs from the SysML model, such as code files, documentation, or configuration files.
Utilizing Scriban, a fast, powerful, and versatile templating engine (https://github.com/scriban/scriban), this library offers an "Abstract Sink" which developers can reference to complete the implementation of the ITranspilerSink
interface defined in the MtconnectTranspiler project.
- Scriban Templating: Leverages Scriban's templating engine to transform the deserialized SysML model into various output formats.
- Abstract Sink Implementation: Provides a skeletal framework that developers can extend to implement the
ITranspilerSink
interface, tailored to their specific output requirements. - Example-Driven: Illustrated through the
MtconnectTranspiler.Sinks.CSharp
repository, demonstrating a practical implementation of generating C# code.
To utilize the MtconnectTranspiler.Sinks.ScribanTemplates
in your project, follow these steps:
-
Prerequisites:
- Familiarity with the MtconnectTranspiler framework and its capabilities.
- Basic understanding of Scriban's templating syntax.
-
Installation:
- Clone this repository into your project.
- Ensure you have the MtconnectTranspiler library and Scriban installed and configured in your development environment.
-
Creating Your Custom Sink:
- Extend the abstract classes provided by this library to implement your own
ITranspilerSink
. - Utilize Scriban templates to define the output structure for your specific use case.
- Extend the abstract classes provided by this library to implement your own
-
Integration:
- Integrate your custom sink with the MtconnectTranspiler framework to start generating output from SysML models.
This section would provide a simple example of extending the MtconnectTranspiler.Sinks.ScribanTemplates
abstract sink to create a custom implementation. It will demonstrate how to define a Scriban template and use it to generate output files.
(Example code and instructions would go here)
Contributions to the MtconnectTranspiler.Sinks.ScribanTemplates
library are welcome! Please read our contributing guidelines for more information on how to report issues, submit pull requests, and contribute to the library's development.
This project is licensed under the Apache-2.0 License - see the LICENSE file for details.
- The MtconnectTranspiler project for providing the framework for deserializing SysML models.
- The Scriban project for offering a versatile templating engine.