import com.structurizr.documentation.Format; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
// a Structurizr workspace is the wrapper for a software architecture model, views and documentation
Workspace workspace = new Workspace("Getting Started", "This is a model of my software system.");
Model model = workspace.getModel();
// add some elements to your software architecture model
Person user = model.addPerson("User", "A user of my software system.");
SoftwareSystem softwareSystem = model.addSoftwareSystem("Software System", "My software system.");
user.uses(softwareSystem, "Uses");
// define some views (the diagrams you would like to see)
ViewSet views = workspace.getViews();
SystemContextView contextView = views.createSystemContextView(softwareSystem, "SystemContext", "An example of a System Context diagram.");
contextView.setPaperSize(PaperSize.A5_Landscape);
contextView.addAllSoftwareSystems();
contextView.addAllPeople();
// add some documentation
StructurizrDocumentationTemplate template = new StructurizrDocumentationTemplate(workspace);
template.addContextSection(softwareSystem, Format.Markdown,
"Here is some context about the software system...\n" +
"\n" +
"![](embed:SystemContext)");
// add some styling
Styles styles = views.getConfiguration().getStyles();
styles.addElementStyle(Tags.SOFTWARE_SYSTEM).background("#1168bd").color("#ffffff");
styles.addElementStyle(Tags.PERSON).background("#08427b").color("#ffffff").shape(Shape.Person);
uploadWorkspaceToStructurizr(workspace);
}