Skip to content

Commit

Permalink
Merge pull request #3 from symptum/dev
Browse files Browse the repository at this point in the history
Editor v0.0.2
  • Loading branch information
ShankarBUS authored Mar 12, 2024
2 parents 6c35dbb + ef9a3b5 commit cff281e
Show file tree
Hide file tree
Showing 87 changed files with 4,077 additions and 1,806 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Symptum Community

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
File renamed without changes.
20 changes: 20 additions & 0 deletions src/Symptum.Core/Helpers/ObservableCollectionHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Collections.ObjectModel;
using Symptum.Core.Management.Resources;

namespace Symptum.Core.Helpers;

public static class ObservableCollectionHelper
{
private static Dictionary<NavigableResource, ObservableCollection<IResource>> collections = [];

public static void ObserveCollection(this NavigableResource navigableResource, ObservableCollection<IResource> collection)
{
if (collection == null) return;
collection.CollectionChanged += Collection_CollectionChanged;
collections[navigableResource] = collection;
}

private static void Collection_CollectionChanged(object? sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
}
}
15 changes: 7 additions & 8 deletions src/Symptum.Core/Helpers/ParserHelper.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
namespace Symptum.Core.Helpers
namespace Symptum.Core.Helpers;

public class ParserHelper
{
public class ParserHelper
{
public static readonly string QuestionIdDelimiter = "_";
public static readonly string QuestionIdDelimiter = "_";

public static readonly string ListDelimiter = ";";
public static readonly string ListDelimiter = ";";

public static readonly string BookLocationDelimiter = "#";
}
}
public static readonly string BookReferenceDelimiter = "#";
}
8 changes: 8 additions & 0 deletions src/Symptum.Core/IUniqueId.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Symptum.Core;

// Will be used for classes which function as Identifiers. Eg: Question Entries, Reference Values
// Will be helpful for navigation, bookmarking, etc.
public interface IUniqueId
{
static abstract IUniqueId? Parse(string? idText);
}
27 changes: 15 additions & 12 deletions src/Symptum.Core/Management/Deployment/IPackage.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
namespace Symptum.Core.Management.Deployment
using Symptum.Core.Management.Resources;

namespace Symptum.Core.Management.Deployment;

public interface IPackage
{
public interface IPackage
{
public string Name { get; set; }
string Title { get; set; }

string Description { get; set; }

public string Description { get; set; }
Version Version { get; set; }

public Version Version { get; set; }
IList<AuthorInfo>? Authors { get; set; }

public string Authors { get; set; }
IList<IResource>? Contents { get; set; }

public object Content { get; set; }
IList<IResource>? Dependencies { get; set; }

public string Dependencies { get; set; }
IList<string>? DependencyIds { get; set; }

public IList<string> Tags { get; set; }
}
}
IList<string>? Tags { get; set; }
}
12 changes: 12 additions & 0 deletions src/Symptum.Core/Management/Navigation/INavigable.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Symptum.Core.Management.Navigation;

public interface INavigable
{
//Uri Uri { get; set; }

//bool IsNavigationHandled { get; set; }

//Type PageType { get; set; }

//NavigationType NavigationType { get; set; }
}
13 changes: 0 additions & 13 deletions src/Symptum.Core/Management/Navigation/INavigatable.cs

This file was deleted.

11 changes: 5 additions & 6 deletions src/Symptum.Core/Management/Navigation/NavigationManager.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
namespace Symptum.Core.Management.Navigation
namespace Symptum.Core.Management.Navigation;

public class NavigationManager
{
public class NavigationManager
{
public NavigationManager()
{ }
}
public NavigationManager()
{ }
}
17 changes: 8 additions & 9 deletions src/Symptum.Core/Management/Navigation/NavigationType.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
namespace Symptum.Core.Management.Navigation
namespace Symptum.Core.Management.Navigation;

public enum NavigationType
{
public enum NavigationType
{
MarkdownContent,
ListOfContents,
QuestionBank,
TopLevel,
SubLevel
}
TopLevel,
SubLevel,
QuestionBank,
ListOfContents,
MarkdownContent
}
9 changes: 0 additions & 9 deletions src/Symptum.Core/Management/Resource/ContentFileType.cs

This file was deleted.

23 changes: 0 additions & 23 deletions src/Symptum.Core/Management/Resource/IContent.cs

This file was deleted.

7 changes: 0 additions & 7 deletions src/Symptum.Core/Management/Resource/ResourceManager.cs

This file was deleted.

8 changes: 8 additions & 0 deletions src/Symptum.Core/Management/Resources/AuthorInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Symptum.Core.Management.Resources;

public struct AuthorInfo
{
string Name { get; set; }

string Email { get; set; }
}
8 changes: 8 additions & 0 deletions src/Symptum.Core/Management/Resources/ContentFileType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Symptum.Core.Management.Resources;

public enum ContentFileType
{
Markdown,
Csv,
Image
}
22 changes: 22 additions & 0 deletions src/Symptum.Core/Management/Resources/IContent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace Symptum.Core.Management.Resources;

public interface IContent
{
public string Title { get; set; }

public string Description { get; set; }

public string Authors { get; set; }

public ContentFileType ContentFileType { get; set; }

public DateOnly DateModified { get; set; }

public IList<string> References { get; set; }

public IList<string> Tags { get; set; }

public IList<string> SeeAlso { get; set; }

public string Dependencies { get; set; }
}
35 changes: 35 additions & 0 deletions src/Symptum.Core/Management/Resources/IResource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
namespace Symptum.Core.Management.Resources;

public interface IResource
{
// Will be used mostly for navigation, will be overlapping with Id in most cases but Id will be different in case of cross linking and embedding
// Eg: Micro/Pedia/CM.ImmunizationSchedule will be different Ids but Uri will be same : mi/sm/notes/immunology/immunizationschedule
Uri Uri { get; set; } // symptum://subjects/an/sm/notes/abdomen/liver; symptum://subjects/an/qbank/1/abdomen#S_AN_12.3.4

// Will be used for dependency & resource file resolution and naming of packages
string Id { get; set; } // AUTOGEN: {Parent.Id}.{Title} -> Subjects.Anatomy.StudyMaterials.Notes.Abdomen.Liver

string Title { get; set; } // Liver

IResource? ParentResource { get; } // Id: Subjects.Anatomy.StudyMaterials.Notes.Abdomen

IList<IResource>? ChildrenResources { get; } // null if end resource

IList<IResource>? Dependencies { get; set; }

IList<string>? DependencyIds { get; set; }

void InitializeResource(IResource? parent);

bool CanHandleChildResourceType(Type childResourceType);

bool CanAddChildResourceType(Type childResourceType);

void AddChildResource(IResource childResource);

void RemoveChildResource(IResource childResource);

//IResource GetIResourceFromRelativeUri(Uri relativeUri);

//IResource GetIResourceFromRelativeId(string relativeId);
}
Loading

0 comments on commit cff281e

Please sign in to comment.