This is a template repository for generating documentation from Xcore metamodels. Documentation can be generated manually using Nasdanika CLI and then published to GitHub pages if desired. It can also be generated using GitHub actions calling Nasdanika CLI.
To use the first approach set up GitHub Pages source to "Deploy from a branch", select a branch and then "docs" folder.
To use publish with a GitHub Actions workflow set the source to "GitHub Actions".
The generator creates my.drawio Draw.io diagram and publishes it to the root of the site.
You can download it, edit it and include into the site.
All of this can be done in the browser if you don't want to clone the repository to your local environment.
To generate and commit doc stubs you will have to either clone the repository to you local environment or use GitHub Codespaces.
Once you install Nasdanika CLI the first step isto generate the web site (HTML Application) model with xcore/doc/save command pipeline:
nsd xcore my.xcore doc --diagram=my.drawio --doc-stubs --doc-dir=doc save my.xmi
Remove --diagram=my.drawio if you've already generated a diagram file before and manually adjusted it.
You may re-generate a diagram file if there are changes in the source file - added or deleted classifiers.
--doc-stubs option works with `--doc-dir`` option and tells the command to generate empty markdown files for model elements.
You can then write documentation file-by-file, possibly collaborating with others.
Then generate a web site from the XMI file using model/labels/site command pipeline:
nsd model root-action.yml labels site -r=-1 -F page-template.yml docs
You can also mount it to a larger site.
GitHub actions generate a documentation site, a diagram, and a doc stubs zip:
- Documentation: https://nasdanika-templates.github.io/xcore-doc/index.html
- Generated diagram file: https://nasdanika-templates.github.io/xcore-doc/my.drawio
- Doc stubs zip: https://nasdanika-templates.github.io/xcore-doc/doc-stubs.zip - unzip and upload using GitHub Web interface if you are not using a local repository clone.
This template repository generates just documentation. You can "upgrade" it to also generate Java code and model documentation in addition to metamodel documentation. You can use the SQL Model as a template/reference.