Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Deploy docs to GitHub Pages

on:
push:
branches:
- main
workflow_dispatch:


jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest

defaults:
run:
working-directory: website

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
cache-dependency-path: website/package-lock.json

- name: Build javadoc
working-directory: .
run: ./gradlew aggregateJavadoc

- name: Install dependencies
run: npm ci
- name: Build website
run: npm run build

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: website/build

deploy:
name: Deploy to GitHub Pages
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
30 changes: 30 additions & 0 deletions .github/workflows/test-docs-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test docs deployment

on:
pull_request:
branches:
- main

jobs:
test-docs-deploy:
name: Test deployment
runs-on: ubuntu-latest

defaults:
run:
working-directory: website

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
cache-dependency-path: website/package-lock.json

- name: Install dependencies
run: npm ci
- name: Test build website
run: npm run build
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/.idea
**/.DS_Store
2 changes: 2 additions & 0 deletions examples-csharp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/bin/*
**/obj/*
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using LionWeb.Core;
using LionWeb.Core.M1;
using LionWeb.Core.M3;
using LionWeb.Core.VersionSpecific.V2024_1;

public class AuthoringDynamicLanguage
{
public static void Run()
{

var language = new DynamicLanguage("lang", LionWebVersions.v2024_1)
{
Key = "key-lang",
Version = "0",
Name = "ComplaintsLanguage",
};
var complaintsBook = new DynamicConcept("complaints-book", LionWebVersions.v2024_1, language)
{
Partition = true,
Key = "complaints-book",
Name = "ComplaintsBook",
};
var complaint = new DynamicConcept("complaint", LionWebVersions.v2024_1, language)
{
Key = "complaint",
Name = "Complaint",
};
var date = new DynamicPrimitiveType("date", LionWebVersions.v2024_1, language)
{
Key = "date",
Name = "Date"
};
language.AddEntities([complaintsBook, complaint, date]);

var bookComplaints =
new DynamicContainment("complaints-book-complaints", LionWebVersions.v2024_1, complaintsBook)
{
Key = "complaints-book-complaints",
Name = "Complaints",
Optional = false,
Multiple = true,
Type = complaint
};
complaintsBook.AddFeatures([bookComplaints]);

var complaintDate = new DynamicProperty("complaint-date", LionWebVersions.v2024_1, complaint)
{
Key = "complaint-date",
Name = "Date",
Optional = true,
Type = date
};
var complaintDescription = new DynamicProperty("complaint-description", LionWebVersions.v2024_1, complaint)
{
Key = "complaint-description",
Name = "Description",
Optional = false,
Type = BuiltInsLanguage_2024_1.Instance.String,
};
var complaintUrgent = new DynamicProperty("complaint-urgent", LionWebVersions.v2024_1, complaint)
{
Type = BuiltInsLanguage_2024_1.Instance.Boolean,
Key = "complaint-urgent",
Name = "Urgent?",
Optional = false,
};
complaint.AddFeatures([complaintDate, complaintDescription, complaintUrgent]);

var serializationChunk = new SerializerBuilder().WithLionWebVersion(LionWebVersions.v2024_1).Build()
.SerializeToChunk([language]);

var options = new JsonSerializerOptions
{
WriteIndented = true,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
};

var filePath = "ComplaintsLanguage.json";
File.WriteAllText(filePath, JsonSerializer.Serialize(serializationChunk, options));

Console.WriteLine($"Serialized JSON saved to: {Path.GetFullPath(filePath)}");
}
}
10 changes: 10 additions & 0 deletions examples-csharp/Example.LanguageAuthoring/Demo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Example.LanguageAuthoring;

public class Demo
{
public static void Main()
{
AuthoringDynamicLanguage.Run();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LionWeb-CSharp" Version="0.3.0-rc.5" />
</ItemGroup>

</Project>
22 changes: 22 additions & 0 deletions examples-csharp/LionWebExamples.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example.LanguageAuthoring", "Example.LanguageAuthoring\Example.LanguageAuthoring.csproj", "{D1471ADC-7A33-419C-B5F6-9D8A573924EC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D1471ADC-7A33-419C-B5F6-9D8A573924EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D1471ADC-7A33-419C-B5F6-9D8A573924EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D1471ADC-7A33-419C-B5F6-9D8A573924EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D1471ADC-7A33-419C-B5F6-9D8A573924EC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
3 changes: 3 additions & 0 deletions examples-csharp/LionWebExamples.sln.DotSettings.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADynamicTypes_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F3deaebab6ac7ab7764847df633514fa8b2d736cbd535a517ca0b6761e6ece89_003FDynamicTypes_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AJsonSerializer_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F7c07e79c0ba74526b05bb6bf612373b919a400_003F3b_003Fb5fd6824_003FJsonSerializer_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>
1 change: 1 addition & 0 deletions examples-ts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
80 changes: 80 additions & 0 deletions examples-ts/nodes-heterogeneous.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"serializationFormatVersion": "2023.1",
"languages": [
{
"key": "Task Language",
"version": "1.0"
}
],
"nodes": [
{
"id": "51a0b122-9460-48de-9563-87920ae6e4fa",
"classifier": {
"language": "Task Language",
"version": "1.0",
"key": "TaskList"
},
"properties": [],
"containments": [
{
"containment": {
"language": "Task Language",
"version": "1.0",
"key": "tasks"
},
"children": [
"cf1ed13f-cd3e-4a2f-a368-cfe671ea9cf0",
"6330dbc9-75cb-4ce5-b232-38e82c97d6a5"
]
}
],
"references": [],
"annotations": [],
"parent": null
},
{
"id": "cf1ed13f-cd3e-4a2f-a368-cfe671ea9cf0",
"classifier": {
"language": "Task Language",
"version": "1.0",
"key": "Task"
},
"properties": [
{
"property": {
"language": "Task Language",
"version": "1.0",
"key": "name"
},
"value": "My Task #1"
}
],
"containments": [],
"references": [],
"annotations": [],
"parent": "51a0b122-9460-48de-9563-87920ae6e4fa"
},
{
"id": "6330dbc9-75cb-4ce5-b232-38e82c97d6a5",
"classifier": {
"language": "Task Language",
"version": "1.0",
"key": "Task"
},
"properties": [
{
"property": {
"language": "Task Language",
"version": "1.0",
"key": "name"
},
"value": "My Task #2"
}
],
"containments": [],
"references": [],
"annotations": [],
"parent": "51a0b122-9460-48de-9563-87920ae6e4fa"
}
]
}
Loading