From cb28766111341054e5f844f2bb9064d3767f0c18 Mon Sep 17 00:00:00 2001
From: rschoene <rene.schoene@tu-dresden.de>
Date: Thu, 24 Feb 2022 17:15:03 +0100
Subject: [PATCH] Documentation for adding it to some project.

---
 pages/docs/adding.md | 55 ++++++++++++++++++++++++++++++++++++++++++++
 pages/mkdocs.yml     |  2 ++
 2 files changed, 57 insertions(+)
 create mode 100644 pages/docs/adding.md

diff --git a/pages/docs/adding.md b/pages/docs/adding.md
new file mode 100644
index 0000000..e4c2a47
--- /dev/null
+++ b/pages/docs/adding.md
@@ -0,0 +1,55 @@
+# Add grammar2uml to your project
+
+To use `Grammar2uml`, add it as a dependency:
+
+```
+configurations {
+    grammar2umlClasspath
+}
+
+dependencies {
+    grammar2umlClasspath group: 'de.tudresden.inf.st', name: 'grammar2uml', version: '0.2.1'
+}
+```
+
+Then, add a task to create your visualization:
+
+```
+task grammar2uml(type: JavaExec) {
+    main = 'de.tudresden.inf.st.jastadd.grammar2uml.compiler.Compiler'
+    classpath = configurations.grammar2umlClasspath
+
+    args([
+            '--verbose',
+            '--defaultFolders',
+            'src/main/jastadd/YourGrammar.relast'
+    ])
+}
+```
+
+## Build from source
+
+If you want to build `Grammar2Uml` from source, first build the jar from the [repository](https://git-st.inf.tu-dresden.de/jastadd/grammar2uml):
+
+```bash
+git clone https://git-st.inf.tu-dresden.de/jastadd/grammar2uml.git
+cd grammar2uml
+./gradlew jar
+ls grammar2uml/build/libs/
+```
+
+Those JARs can then be copied to your project.
+
+```bash
+cp grammar2uml/build/libs/grammar2uml-<version>.jar ${YourProject}/libs/grammar2uml.jar
+```
+
+Finally, this JAR has to be integrated into your build process. In case [Gradle](https://gradle.org/) is used, the JAR file needs to be added as dependency using:
+
+```groovy
+dependencies {
+    grammar2umlClasspath fileTree(include: ['grammar2uml.jar'], dir: 'libs')
+}
+```
+
+The path to the JAR file may need to be changed according to your project structure.
diff --git a/pages/mkdocs.yml b/pages/mkdocs.yml
index 853b051..771bf57 100644
--- a/pages/mkdocs.yml
+++ b/pages/mkdocs.yml
@@ -3,6 +3,8 @@ repo_url: https://git-st.inf.tu-dresden.de/jastadd/grammar2uml
 site_dir: ../public
 
 nav:
+  - "Grammar2uml": index.md
+  - "Add to your project": adding.md
   - "API documentation": ragdoc/index.html
 
 theme:
-- 
GitLab