diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7c0dcfc --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea +config.json +life.md \ No newline at end of file diff --git a/config.example.json b/config.example.json index 83ce44a..927988d 100644 --- a/config.example.json +++ b/config.example.json @@ -1,5 +1,6 @@ { "customStylesheetURL": null, "yearLength": 120, - "hideAge": false + "hideAge": false, + "hideTags": false } \ No newline at end of file diff --git a/index.html b/index.html index b868c72..76f602a 100644 --- a/index.html +++ b/index.html @@ -112,6 +112,7 @@

Life

config: { yearLength: 120, // 120px per year hideAge: false, // Hide age from year axis + hideTags: false, customStylesheetURL: null // Custom stylesheet }, start: function(){ @@ -161,10 +162,15 @@

Life

list.forEach(function(l){ var matches = l.match(/\-\s+([\d\/\-\~]+)\s(.*)/i); var time = matches[1]; - var text = matches[2]; + var tags = []; + var text = matches[2].replace(/#(\w+)/gi, function (hashtag, cleantag) { + tags.push('tag-' + cleantag); + return (life.config.hideTags ? '' : hashtag); + }); data.push({ time: life.parseTime(time), - text: text + text: text, + tags: tags }); }); return data; @@ -258,7 +264,7 @@

Life

d.text = d.text.replace(link[0], "" + link[1] + ""); } - return '
' + return '
' + '
' + '' + d.time.title + ' ' + d.text + '  ' + '
';