Skip to content

Commit bda1f0e

Browse files
committed
Moved taglist outside of page class
1 parent 55540e0 commit bda1f0e

File tree

3 files changed

+30
-29
lines changed

3 files changed

+30
-29
lines changed

OneMore/Commands/File/Markdown/MarkdownConverter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ namespace River.OneMoreAddIn.Commands
77
using River.OneMoreAddIn.Models;
88
using River.OneMoreAddIn.Styles;
99
using System.Collections.Generic;
10+
using System.Globalization;
1011
using System.Linq;
1112
using System.Text.RegularExpressions;
1213
using System.Xml.Linq;
@@ -195,7 +196,7 @@ public MarkdownConverter RewriteTodo(IEnumerable<XElement> paragraphs)
195196
else
196197
{
197198
// look for all other tags
198-
foreach (var t in page.taglist)
199+
foreach (var t in Page.taglist)
199200
{
200201
// check for other tags
201202
if (text.Value.Contains(t.name))

OneMore/Commands/File/Markdown/MarkdownWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ private string WriteTag(XElement element, bool contained)
438438
.Select(e => int.Parse(e.Attribute("symbol").Value))
439439
.FirstOrDefault();
440440
var retValue = "";
441-
var tagSymbol = page.taglist.Find(x => x.id == symbol.ToString());
441+
var tagSymbol = Page.taglist.Find(x => x.id == symbol.ToString());
442442
switch (symbol)
443443
{
444444
case 3: // to do

OneMore/Models/Page.cs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,33 +28,6 @@ internal partial class Page
2828

2929
private const string HashAttributeName = "omHash";
3030

31-
public List<(string name, string id, string topic, int type)> taglist = new List<(string name, string id, string topic, int type)>
32-
{
33-
// (":todo:", "3", "todo" , 0),
34-
(":question:", "6", "question" , 0),
35-
(":star:", "13", "important", 0 ),
36-
(":exclamation:", "17", "critical", 0),
37-
(":phone:", "18", "phone", 0),
38-
(":bulb:", "21", "idea", 0),
39-
(":house:", "23", "address", 0),
40-
(":three:", "33", "three", 0),
41-
(":zero:", "39", "zero", 0),
42-
(":two:", "51", "two", 0),
43-
(":arrow_right:", "59", "main agenda item", 0),
44-
(":one:", "70", "one", 0),
45-
(":information_desk_person:","94", "discuss person a/b", 21),
46-
(":bellsymbol:", "97", "bellsymbol", 0),
47-
(":busts_in_silhouette:", "116", "busts_in_silhouette", 0),
48-
(":bell:", "117", "bell", 0),
49-
(":letter:", "118", "letter", 0),
50-
(":musical_note:", "121", "musical_note", 0),
51-
(":secret:", "131", "idea", 0),
52-
(":book:", "132", "book", 0),
53-
(":movie_camera:", "133", "movie_camera", 0),
54-
(":zap:", "140", "lightning_bolt", 0),
55-
(":o:", "1", "default", 0)
56-
};
57-
5831
/// <summary>
5932
/// Initialize a new instance with the given page XML root
6033
/// </summary>
@@ -148,6 +121,33 @@ public void OptimizeForSave(bool keep)
148121

149122
public bool IsValid => Root != null;
150123

124+
public static List<(string name, string id, string topic, int type)> taglist = new List<(string name, string id, string topic, int type)>
125+
{
126+
// (":todo:", "3", "todo" , 0),
127+
(":question:", "6", "question" , 0),
128+
(":star:", "13", "important", 0 ),
129+
(":exclamation:", "17", "critical", 0),
130+
(":phone:", "18", "phone", 0),
131+
(":bulb:", "21", "idea", 0),
132+
(":house:", "23", "address", 0),
133+
(":three:", "33", "three", 0),
134+
(":zero:", "39", "zero", 0),
135+
(":two:", "51", "two", 0),
136+
(":arrow_right:", "59", "main agenda item", 0),
137+
(":one:", "70", "one", 0),
138+
(":information_desk_person:","94", "discuss person a/b", 21),
139+
(":bellsymbol:", "97", "bellsymbol", 0),
140+
(":busts_in_silhouette:", "116", "busts_in_silhouette", 0),
141+
(":bell:", "117", "bell", 0),
142+
(":letter:", "118", "letter", 0),
143+
(":musical_note:", "121", "musical_note", 0),
144+
(":secret:", "131", "idea", 0),
145+
(":book:", "132", "book", 0),
146+
(":movie_camera:", "133", "movie_camera", 0),
147+
(":zap:", "140", "lightning_bolt", 0),
148+
(":o:", "1", "default", 0)
149+
};
150+
151151

152152
/// <summary>
153153
/// Gets the namespace used to create new elements for the page

0 commit comments

Comments
 (0)