Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a sample UML diagram and model descriptions to ical-tasks #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ronaldtse
Copy link
Contributor

Originally ported from:

For @douglm .

This PR adds the following to the iCal-Tasks document:

  • A UML diagram
  • Two UML classes, a "Calendar" and an "Event". It would be easy to rename them into "VCalendar" and "VTodo" and add the appropriate attributes, etc.

The UML syntax used is called LutaML:

Structure

The diagram is stored at:

  • ical-tasks/sources/views/calendar_view.lutaml

The class definitions are at:

  • ical-tasks/sources/model/calendar.lutaml
  • ical-tasks/sources/model/event.lutaml

The LutaML structure works like this:

  • A diagram is needed to wrap any classes
  • A diagram can include many classes
  • A class can be "associated" with another class via UML relationships such as "generalization", "association", etc (see syntax)

Rendering in text

In the new file sections/70-model.adoc, it looks like this:

== Model
=== General

lutaml_diagram::views/calendar_view.lutaml[]

// Calendar
[lutaml_uml_class,views/calendar_view.lutaml,Calendar]

// Event
[lutaml_uml_class,views/calendar_view.lutaml,Event]

== Class attribute tables

[lutaml_uml_attributes_table,views/calendar_view.lutaml,Calendar]

[lutaml_uml_attributes_table,views/calendar_view.lutaml,Event]

lutaml_diagram

This line: lutaml_diagram::views/calendar_view.lutaml[]

Makes Metanorma render the diagram.

lutaml_uml_class

This line: [lutaml_uml_class,views/calendar_view.lutaml,Calendar]

Makes Metanorma render a clause that contains the descriptions and definitions of the UML class "Calendar" class.

lutaml_uml_attributes_table

This line: [lutaml_uml_attributes_table,views/calendar_view.lutaml,Calendar]

Makes Metanorma render a table of UML attributes for the "Calendar" class in the calendar_view.lutaml view.

That's it

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant