forked from steve-hickman-epistimis/xtext-docs-gen
-
Notifications
You must be signed in to change notification settings - Fork 1
/
GenerateDomainmodel.mwe2
48 lines (42 loc) · 1.28 KB
/
GenerateDomainmodel.mwe2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
module org.example.domainmodel.GenerateDomainmodel
import org.eclipse.xtext.xtext.generator.*
import org.eclipse.xtext.xtext.generator.model.project.*
import com.epistimis.xtextdocs.xtext.fragment.DocsGeneratorFragment
import com.epistimis.xtextdocs.xtext.formatter.MarkdownFormatter
var rootPath = ".."
Workflow {
component = XtextGenerator {
configuration = {
project = StandardProjectConfig {
baseName = "org.example.domainmodel"
rootPath = rootPath
createEclipseMetaData = true
}
code = {
encoding = "UTF-8"
lineDelimiter = "\r\n"
fileHeader = "/*\n * generated by Xtext \${version}\n */"
}
}
language = StandardLanguage {
name = "org.example.domainmodel.Domainmodel"
fileExtensions = "domain"
serializer = {
generateStub = false
}
validator = {
// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
}
// xtext-docs-gen
fragment = DocsGeneratorFragment auto-inject {
outputFileName = "docs.md"
formatter = com.epistimis.xtextdocs.xtext.formatter.MarkdownDocsFormatter {
includeDotReferenceGraph = true
includeSimplifiedGrammar = true
mainTitle = "Domain model grammar documentation"
titleLevelOffset = "1" // top level title will be prefixed with ##
}
}
}
}
}