Skip to content

Commit

Permalink
Moved taglist outside of page class
Browse files Browse the repository at this point in the history
  • Loading branch information
weissm committed Nov 28, 2024
1 parent 5eb4641 commit a4e4ada
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 29 deletions.
3 changes: 2 additions & 1 deletion OneMore/Commands/File/Markdown/MarkdownConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace River.OneMoreAddIn.Commands
using River.OneMoreAddIn.Models;
using River.OneMoreAddIn.Styles;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml.Linq;
Expand Down Expand Up @@ -195,7 +196,7 @@ public MarkdownConverter RewriteTodo(IEnumerable<XElement> paragraphs)
else
{
// look for all other tags
foreach (var t in page.taglist)
foreach (var t in Page.taglist)
{
// check for other tags
if (text.Value.Contains(t.name))
Expand Down
2 changes: 1 addition & 1 deletion OneMore/Commands/File/Markdown/MarkdownWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ private string WriteTag(XElement element, bool contained)
.Select(e => int.Parse(e.Attribute("symbol").Value))
.FirstOrDefault();
var retValue = "";
var tagSymbol = page.taglist.Find(x => x.id == symbol.ToString());
var tagSymbol = Page.taglist.Find(x => x.id == symbol.ToString());
switch (symbol)
{
case 3: // to do
Expand Down
54 changes: 27 additions & 27 deletions OneMore/Models/Page.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,6 @@ internal partial class Page

private const string HashAttributeName = "omHash";

public List<(string name, string id, string topic, int type)> taglist = new List<(string name, string id, string topic, int type)>
{
// (":todo:", "3", "todo" , 0),
(":question:", "6", "question" , 0),
(":star:", "13", "important", 0 ),
(":exclamation:", "17", "critical", 0),
(":phone:", "18", "phone", 0),
(":bulb:", "21", "idea", 0),
(":house:", "23", "address", 0),
(":three:", "33", "three", 0),
(":zero:", "39", "zero", 0),
(":two:", "51", "two", 0),
(":arrow_right:", "59", "main agenda item", 0),
(":one:", "70", "one", 0),
(":information_desk_person:","94", "discuss person a/b", 21),
(":bellsymbol:", "97", "bellsymbol", 0),
(":busts_in_silhouette:", "116", "busts_in_silhouette", 0),
(":bell:", "117", "bell", 0),
(":letter:", "118", "letter", 0),
(":musical_note:", "121", "musical_note", 0),
(":secret:", "131", "idea", 0),
(":book:", "132", "book", 0),
(":movie_camera:", "133", "movie_camera", 0),
(":zap:", "140", "lightning_bolt", 0),
(":o:", "1", "default", 0)
};

/// <summary>
/// Initialize a new instance with the given page XML root
/// </summary>
Expand Down Expand Up @@ -148,6 +121,33 @@ public void OptimizeForSave(bool keep)

public bool IsValid => Root != null;

public static List<(string name, string id, string topic, int type)> taglist = new List<(string name, string id, string topic, int type)>
{
// (":todo:", "3", "todo" , 0),
(":question:", "6", "question" , 0),
(":star:", "13", "important", 0 ),
(":exclamation:", "17", "critical", 0),
(":phone:", "18", "phone", 0),
(":bulb:", "21", "idea", 0),
(":house:", "23", "address", 0),
(":three:", "33", "three", 0),
(":zero:", "39", "zero", 0),
(":two:", "51", "two", 0),
(":arrow_right:", "59", "main agenda item", 0),
(":one:", "70", "one", 0),
(":information_desk_person:","94", "discuss person a/b", 21),
(":bellsymbol:", "97", "bellsymbol", 0),
(":busts_in_silhouette:", "116", "busts_in_silhouette", 0),
(":bell:", "117", "bell", 0),
(":letter:", "118", "letter", 0),
(":musical_note:", "121", "musical_note", 0),
(":secret:", "131", "idea", 0),
(":book:", "132", "book", 0),
(":movie_camera:", "133", "movie_camera", 0),
(":zap:", "140", "lightning_bolt", 0),
(":o:", "1", "default", 0)
};


/// <summary>
/// Gets the namespace used to create new elements for the page
Expand Down

0 comments on commit a4e4ada

Please sign in to comment.