imdone-core 1.50.3 → 1.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/devops/containers/setup-remote.sh +4 -1
- package/lib/adapters/markdown.js +81 -20
- package/lib/adapters/parsers/file/LocalFileParserFactory.js +4 -4
- package/lib/adapters/parsers/file/ReadStreamCodeParser.js +7 -1
- package/lib/adapters/parsers/file/ReadStreamTaskParser.js +5 -10
- package/lib/adapters/readers/FileSystemProjectReader.js +6 -2
- package/lib/adapters/storage/config.js +1 -1
- package/lib/card.js +28 -19
- package/lib/config.js +1 -10
- package/lib/default-settings.js +1 -0
- package/lib/file.js +12 -3
- package/lib/list.js +4 -1
- package/lib/migrate-config.js +6 -6
- package/lib/mixins/repo-fs-store.js +4 -1
- package/lib/mixins/repo-watched-fs-store.js +7 -1
- package/lib/plugins/epic-plugin.js +1 -3
- package/lib/project.js +10 -3
- package/lib/repository.js +8 -2
- package/lib/task.js +12 -3
- package/lib/tools.js +0 -13
- package/lib/usecases/get-imdone-url.js +6 -0
- package/package.json +1 -1
|
@@ -14,8 +14,11 @@ docker run \
|
|
|
14
14
|
|
|
15
15
|
docker exec git-remote mkdir /home/git/authorized_keys
|
|
16
16
|
|
|
17
|
-
# TODO
|
|
17
|
+
# TODO Generate a key in the container and use that instead of copying the key from the host
|
|
18
18
|
# Update to use `GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa_example" git clone example`
|
|
19
|
+
# <!--
|
|
20
|
+
# order:0
|
|
21
|
+
# -->
|
|
19
22
|
|
|
20
23
|
|
|
21
24
|
docker cp ~/.ssh/id_rsa.pub git-remote:/home/git/authorized_keys
|
package/lib/adapters/markdown.js
CHANGED
|
@@ -1,32 +1,93 @@
|
|
|
1
1
|
const checkbox = require('markdown-it-checkbox')
|
|
2
2
|
const imageSize = require('markdown-it-imsize')
|
|
3
|
-
const emoji = require('markdown-it-emoji')
|
|
3
|
+
const emoji = require('markdown-it-emoji')
|
|
4
4
|
const mark = require('markdown-it-mark')
|
|
5
|
-
const removeMD = require('remove-markdown')
|
|
5
|
+
const removeMD = require('remove-markdown')
|
|
6
6
|
const wikilinks = require('@kwvanderlinde/markdown-it-wikilinks')
|
|
7
|
+
const path = require('path');
|
|
7
8
|
|
|
8
9
|
const MarkdownIt = require('markdown-it')
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
let _platform = process.platform
|
|
11
|
+
|
|
12
|
+
function extractWikilinkTopics(markdown) {
|
|
13
|
+
const wikilinkRegex = /\[\[([\w\s/]+)(\|([\w\s/]+))?\]\]/g; // Match [[Topic]] or [[Topic|Display Text]]
|
|
14
|
+
const topics = [];
|
|
15
|
+
let match;
|
|
16
|
+
|
|
17
|
+
// Use RegExp.exec to iterate through all matches
|
|
18
|
+
while ((match = wikilinkRegex.exec(markdown)) !== null) {
|
|
19
|
+
topics.push(match[1].trim()); // Extract the topic (first capture group) and trim whitespace
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return topics;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function getRenderer(projectPath) {
|
|
26
|
+
const md = new MarkdownIt({html: true, breaks: true})
|
|
27
|
+
|
|
28
|
+
md.use(checkbox)
|
|
29
|
+
.use(mark)
|
|
30
|
+
.use(emoji)
|
|
31
|
+
.use(imageSize)
|
|
32
|
+
.use(wikilinks(
|
|
33
|
+
{
|
|
34
|
+
linkPattern: /\[\[([\w\u00C0-\u017F\s\d-/]+)(\|([\w\u00C0-\u017F\s\d-/]+))?\]\]/,
|
|
35
|
+
uriSuffix: '.md',
|
|
36
|
+
postProcessPageName (pagename) {
|
|
37
|
+
return pagename.trim()
|
|
38
|
+
}
|
|
21
39
|
}
|
|
40
|
+
))
|
|
41
|
+
.use(replaceImagePaths(projectPath))
|
|
42
|
+
.validateLink = () => true
|
|
43
|
+
|
|
44
|
+
return md
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function replaceImagePaths(projectPath) {
|
|
48
|
+
|
|
49
|
+
return function(md) {
|
|
50
|
+
const defaultRender = md.renderer.rules.image || function(tokens, idx, options, env, self) {
|
|
51
|
+
return self.renderToken(tokens, idx, options);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
md.renderer.rules.image = function(tokens, idx, options, env, self) {
|
|
55
|
+
const token = tokens[idx];
|
|
56
|
+
const srcIndex = token.attrIndex('src');
|
|
57
|
+
|
|
58
|
+
if (srcIndex >= 0) {
|
|
59
|
+
const src = token.attrs[srcIndex][1];
|
|
60
|
+
if (!src.startsWith('http')) {
|
|
61
|
+
const filePath = projectPath ? path.join(projectPath, src) : path.resolve(src);
|
|
62
|
+
const fileUrl = pathToFileURL(filePath);
|
|
63
|
+
token.attrs[srcIndex][1] = fileUrl;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return defaultRender(tokens, idx, options, env, self);
|
|
68
|
+
};
|
|
22
69
|
}
|
|
23
|
-
|
|
24
|
-
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function pathToFileURL(absolutePath) {
|
|
73
|
+
if (_platform === 'win32') {
|
|
74
|
+
absolutePath = '/' + absolutePath.replace(/\\/g, '/');
|
|
75
|
+
}
|
|
76
|
+
return `file://${absolutePath}`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function renderCancelledTasks(markdown) {
|
|
80
|
+
return markdown.replace(/- \[-\] (.+)/gm, '- :no_entry_sign: ~~$1~~');
|
|
81
|
+
}
|
|
25
82
|
|
|
26
83
|
module.exports = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
84
|
+
_setPlatform(platform) {
|
|
85
|
+
_platform = platform
|
|
86
|
+
},
|
|
87
|
+
renderMarkdown (markdown, projectPath) {
|
|
88
|
+
markdown = renderCancelledTasks(markdown)
|
|
89
|
+
return getRenderer(projectPath).render(markdown)
|
|
30
90
|
},
|
|
91
|
+
extractWikilinkTopics,
|
|
31
92
|
removeMD
|
|
32
|
-
}
|
|
93
|
+
}
|
|
@@ -5,7 +5,8 @@ const languages = require('../../../languages')
|
|
|
5
5
|
const ReadStreamCodeParser = require('./ReadStreamCodeParser')
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
function getLang(
|
|
8
|
+
function getLang(config, filePath) {
|
|
9
|
+
const languages = getLanguages(config)
|
|
9
10
|
var lang = languages[path.extname(filePath)]
|
|
10
11
|
return lang || { name: 'text', symbol: '' }
|
|
11
12
|
}
|
|
@@ -15,13 +16,12 @@ function getLanguages(config) {
|
|
|
15
16
|
return { ...languages, ...configLanguages }
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
module.exports.getLang = getLang
|
|
19
20
|
module.exports.getFileParser = async function getFileParser (filePath, config, readStream) {
|
|
20
21
|
if (!readStream) {
|
|
21
22
|
readStream = createReadStream(filePath)
|
|
22
23
|
}
|
|
23
|
-
const
|
|
24
|
-
const lang = getLang(languages, filePath)
|
|
24
|
+
const lang = getLang(config, filePath)
|
|
25
25
|
if (lang.name === 'text') {
|
|
26
26
|
return new ReadStreamMarkdownParser(readStream, config)
|
|
27
27
|
} else {
|
|
@@ -18,6 +18,9 @@ module.exports = class ReadStreamCodeParser extends ReadStreamTaskParser {
|
|
|
18
18
|
async init() {
|
|
19
19
|
const code = await streamToString(this.readStream)
|
|
20
20
|
// TODO Getting tokens from lists should be done higher up in the controller
|
|
21
|
+
// <!--
|
|
22
|
+
// order:-10
|
|
23
|
+
// -->
|
|
21
24
|
const tokens = this.lists.filter(list => !list.filter).map(list => list.name)
|
|
22
25
|
this.cards = this.parseCards(code, tokens)
|
|
23
26
|
}
|
|
@@ -33,7 +36,10 @@ module.exports = class ReadStreamCodeParser extends ReadStreamTaskParser {
|
|
|
33
36
|
Object.keys(comments).forEach((comment) => {
|
|
34
37
|
const { begin, end, content } = comments[comment];
|
|
35
38
|
const line = begin;
|
|
36
|
-
const lastLine = end - 1
|
|
39
|
+
const lastLine = end; // DOING lastLine should not be - 1
|
|
40
|
+
// <!--
|
|
41
|
+
// order:0
|
|
42
|
+
// -->
|
|
37
43
|
const lines = content.split('\n');
|
|
38
44
|
|
|
39
45
|
// Check if the comment contains "TODO"
|
|
@@ -89,17 +89,12 @@ module.exports = class ReadStreamTaskParser {
|
|
|
89
89
|
|
|
90
90
|
trimLinesToEndTask() {
|
|
91
91
|
if (!this.task) return
|
|
92
|
-
if (
|
|
93
|
-
this.blankLines == blankLinesToEndTask
|
|
94
|
-
) {
|
|
95
|
-
this.task.description.length = this.task.description.length - (this.blankLines - 1)
|
|
96
|
-
} else if (this.nextTask){
|
|
97
|
-
this.task.description.length = this.task.description.length - (this.blankLines + 1)
|
|
98
|
-
} else {
|
|
99
|
-
this.task.description.length = this.task.description.length - this.blankLines
|
|
100
|
-
}
|
|
101
92
|
|
|
102
|
-
|
|
93
|
+
// Remove the empty strings from the end of the task description
|
|
94
|
+
while (this.task.description[this.task.description.length - 1] === '') {
|
|
95
|
+
this.task.description.pop()
|
|
96
|
+
}
|
|
97
|
+
this.task.lastLine = this.task.line + this.task.description.length
|
|
103
98
|
}
|
|
104
99
|
|
|
105
100
|
close() {
|
|
@@ -7,7 +7,9 @@ module.exports = class FileSystemProjectReader {
|
|
|
7
7
|
// BACKLOG ## Load the config file
|
|
8
8
|
// #adapter
|
|
9
9
|
// [lib/adapters/readers/FileSystemProjectReader.js](lib/adapters/readers/FileSystemProjectReader.js)
|
|
10
|
-
// <!-- epic:"Release 2.0"
|
|
10
|
+
// <!-- epic:"Release 2.0"
|
|
11
|
+
// order:-590
|
|
12
|
+
// -->
|
|
11
13
|
const files = await this.getFilesFromDirectory(projectPath)
|
|
12
14
|
|
|
13
15
|
// BACKLOG ## Parse project files
|
|
@@ -18,7 +20,9 @@ module.exports = class FileSystemProjectReader {
|
|
|
18
20
|
// - After tasks are parsed trim the description appropriately and look for Check style tasks in what's left of the description
|
|
19
21
|
// #adapter
|
|
20
22
|
// [lib/adapters/readers/FileSystemProjectReader.js](lib/adapters/readers/FileSystemProjectReader.js)
|
|
21
|
-
// <!-- epic:"Release 2.0"
|
|
23
|
+
// <!-- epic:"Release 2.0"
|
|
24
|
+
// order:-600
|
|
25
|
+
// -->
|
|
22
26
|
|
|
23
27
|
}
|
|
24
28
|
|
package/lib/card.js
CHANGED
|
@@ -10,7 +10,7 @@ const eol = require('eol')
|
|
|
10
10
|
const allEmoji = require('markdown-it-emoji/lib/data/full.json')
|
|
11
11
|
const { getIsoDateWithOffset } = require('./adapters/date-time')
|
|
12
12
|
|
|
13
|
-
const { removeMD
|
|
13
|
+
const { removeMD } = require('./adapters/markdown')
|
|
14
14
|
|
|
15
15
|
const CONTENT_TOKEN = '__CONTENT__'
|
|
16
16
|
const lf = String(eol.lf)
|
|
@@ -45,6 +45,7 @@ module.exports = function newCard(task, _project, dontParse) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
init(totals = project.totals) {
|
|
48
|
+
this.topics = project.extractWikilinkTopics(this.interpretedContent)
|
|
48
49
|
this.updateLastLine()
|
|
49
50
|
this.totals = totals
|
|
50
51
|
this.onTaskUpdate()
|
|
@@ -58,6 +59,9 @@ module.exports = function newCard(task, _project, dontParse) {
|
|
|
58
59
|
onTaskUpdate() {
|
|
59
60
|
// TODO We should be mapping to the imdone-api task
|
|
60
61
|
// #imdone-1.45.0
|
|
62
|
+
// <!--
|
|
63
|
+
// order:-20
|
|
64
|
+
// -->
|
|
61
65
|
const interpretedContent = pluginManager.onTaskUpdate(this)
|
|
62
66
|
if (interpretedContent && interpretedContent.length > 0) {
|
|
63
67
|
this.interpretedContent = interpretedContent
|
|
@@ -126,11 +130,16 @@ module.exports = function newCard(task, _project, dontParse) {
|
|
|
126
130
|
'projectPath',
|
|
127
131
|
'relPath',
|
|
128
132
|
'fullPath',
|
|
129
|
-
'totals'
|
|
133
|
+
'totals',
|
|
134
|
+
'topics'].sort()
|
|
130
135
|
),
|
|
131
136
|
}
|
|
132
137
|
}
|
|
133
138
|
|
|
139
|
+
// TODO Add isInCodeFile property to card
|
|
140
|
+
// <!--
|
|
141
|
+
// order:-115
|
|
142
|
+
// -->
|
|
134
143
|
initData() {
|
|
135
144
|
const props = { ...this.props, content: CONTENT_TOKEN }
|
|
136
145
|
const computed = { ...this.computed }
|
|
@@ -250,7 +259,7 @@ module.exports = function newCard(task, _project, dontParse) {
|
|
|
250
259
|
.replace(/%%[\s\S]*?%%/g, '')
|
|
251
260
|
.replace(/<\!--\s*?-->/gs, '')
|
|
252
261
|
.trim()
|
|
253
|
-
taskMD = this.replaceImagePaths(taskMD)
|
|
262
|
+
// taskMD = this.replaceImagePaths(taskMD)
|
|
254
263
|
// - Split on eol and append lines until visible line count equals lines
|
|
255
264
|
const displayContent = []
|
|
256
265
|
const rawContent = []
|
|
@@ -271,28 +280,28 @@ module.exports = function newCard(task, _project, dontParse) {
|
|
|
271
280
|
return { totalLines, markdown, rawMarkdown }
|
|
272
281
|
}
|
|
273
282
|
|
|
274
|
-
replaceImagePaths(content) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
283
|
+
// replaceImagePaths(content) {
|
|
284
|
+
// return content.replace(
|
|
285
|
+
// /(!\[.*?\]\()(.*?)(\))/g,
|
|
286
|
+
// (match, p1, imagePath, p3) => {
|
|
287
|
+
// if (/^http/.test(imagePath)) return match
|
|
288
|
+
// imagePath = _path.join(
|
|
289
|
+
// _path.dirname(this.fullPath),
|
|
290
|
+
// imagePath
|
|
291
|
+
// ).replace(/ /g, '%20')
|
|
292
|
+
// const imageURL = `file://${imagePath}`
|
|
293
|
+
// return p1 + imageURL + p3
|
|
294
|
+
// }
|
|
295
|
+
// )
|
|
296
|
+
// }
|
|
288
297
|
|
|
289
298
|
getHtml(content) {
|
|
290
|
-
const html = renderMarkdown(content)
|
|
299
|
+
const html = project.renderMarkdown(content)
|
|
291
300
|
const mdArray = eol.split(content)
|
|
292
301
|
let truncHtml = null
|
|
293
302
|
if (mdArray.length > this.truncLines) {
|
|
294
303
|
mdArray.length = this.truncLines
|
|
295
|
-
truncHtml = renderMarkdown(mdArray.join(eol.lf))
|
|
304
|
+
truncHtml = project.renderMarkdown(mdArray.join(eol.lf))
|
|
296
305
|
}
|
|
297
306
|
return { html, truncHtml }
|
|
298
307
|
}
|
package/lib/config.js
CHANGED
|
@@ -6,16 +6,7 @@ const _get = require('lodash.get')
|
|
|
6
6
|
const {
|
|
7
7
|
JOURNAL_TYPE,
|
|
8
8
|
DEFAULT_CONFIG,
|
|
9
|
-
CONFIG_FILE_YML,
|
|
10
|
-
CONFIG_DIR
|
|
11
9
|
} = require('./constants')
|
|
12
|
-
const _path = require('path')
|
|
13
|
-
const findUp = require('find-up')
|
|
14
|
-
const { loadYAML } = require('./adapters/yaml')
|
|
15
|
-
const {
|
|
16
|
-
exists,
|
|
17
|
-
readFile,
|
|
18
|
-
} = require('./adapters/file-gateway')
|
|
19
10
|
|
|
20
11
|
/**
|
|
21
12
|
* Description
|
|
@@ -185,7 +176,7 @@ class Config {
|
|
|
185
176
|
}
|
|
186
177
|
|
|
187
178
|
get archiveCompleted() {
|
|
188
|
-
return _get(this, 'settings.cards.archiveCompleted'
|
|
179
|
+
return _get(this, 'settings.cards.archiveCompleted')
|
|
189
180
|
}
|
|
190
181
|
|
|
191
182
|
get tokenPrefix() {
|
package/lib/default-settings.js
CHANGED
package/lib/file.js
CHANGED
|
@@ -830,7 +830,10 @@ File.prototype.modifyDescription = function (task, config) {
|
|
|
830
830
|
let description = task.description.map(
|
|
831
831
|
(desc) => `${spaces}${descriptionStartsWith}${desc}`
|
|
832
832
|
)
|
|
833
|
-
// BACKLOG
|
|
833
|
+
// BACKLOG Allow this to pad for code files as well
|
|
834
|
+
// <!--
|
|
835
|
+
// order:-620
|
|
836
|
+
// -->
|
|
834
837
|
description = File.padDescription(description, task.beforeText).join(lineEnd)
|
|
835
838
|
if (taskContentLines.length === 0 && description.length > 0) {
|
|
836
839
|
beforeDescContent += description + lineEnd
|
|
@@ -885,7 +888,10 @@ File.prototype.extractTaskWithDescription = function ({
|
|
|
885
888
|
var self = this
|
|
886
889
|
const lang = this.getLang()
|
|
887
890
|
let description = []
|
|
888
|
-
// BACKLOG
|
|
891
|
+
// BACKLOG ## add beforeText for code files
|
|
892
|
+
// <!--
|
|
893
|
+
// order:-630
|
|
894
|
+
// -->
|
|
889
895
|
const beforeText = this.getBeforeText(line, pos)
|
|
890
896
|
let { rawTaskContentLines, taskContentLines, isWrappedWithCardTag } = this.getTaskContent({
|
|
891
897
|
config,
|
|
@@ -1100,7 +1106,7 @@ File.prototype.removeTask = function (task) {
|
|
|
1100
1106
|
}
|
|
1101
1107
|
|
|
1102
1108
|
File.prototype.ignoreCodeBlocks = function () {
|
|
1103
|
-
// BACKLOG
|
|
1109
|
+
// BACKLOG This is not used, but we need a way to ignore tasks in code blocks. Maybe save position ranges
|
|
1104
1110
|
// ```javascript
|
|
1105
1111
|
// var cleanContent = this.content
|
|
1106
1112
|
// var replacer = function (block) {
|
|
@@ -1115,6 +1121,9 @@ File.prototype.ignoreCodeBlocks = function () {
|
|
|
1115
1121
|
// }
|
|
1116
1122
|
// return cleanContent
|
|
1117
1123
|
// ```
|
|
1124
|
+
// <!--
|
|
1125
|
+
// order:-640
|
|
1126
|
+
// -->
|
|
1118
1127
|
}
|
|
1119
1128
|
|
|
1120
1129
|
File.prototype.isMarkDownFile = function () {
|
package/lib/list.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const uniqid = require('uniqid')
|
|
4
|
-
// BACKLOG
|
|
4
|
+
// BACKLOG Create list groups to show and hide for projects/repos. gh:96 id:11
|
|
5
|
+
// <!--
|
|
6
|
+
// order:-610
|
|
7
|
+
// -->
|
|
5
8
|
|
|
6
9
|
/**
|
|
7
10
|
* Description
|
package/lib/migrate-config.js
CHANGED
|
@@ -50,17 +50,17 @@ module.exports = function (repo, defaultSettings = defaultSettingsObject) {
|
|
|
50
50
|
delete config.settings.defaultList
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
if (
|
|
53
|
+
if (config.settings.cards.defaultList === undefined) {
|
|
54
54
|
config.settings.cards.defaultList = lists ? lists[0] : ''
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
// archiveCompleted
|
|
58
58
|
if (config.settings.cards.archiveCompleted === undefined) {
|
|
59
|
-
config.settings.cards.archiveCompleted =
|
|
59
|
+
config.settings.cards.archiveCompleted = true
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// archiveFolder
|
|
63
|
-
if (
|
|
63
|
+
if (config.settings.cards.archiveFolder === undefined) {
|
|
64
64
|
config.settings.cards.archiveFolder = config.settings.journalPath ? _path.join(config.settings.journalPath, 'archive') : 'archive'
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -106,11 +106,11 @@ module.exports = function (repo, defaultSettings = defaultSettingsObject) {
|
|
|
106
106
|
delete config.settings.doneList
|
|
107
107
|
}
|
|
108
108
|
// Set up default doneList
|
|
109
|
-
if (
|
|
109
|
+
if (config.settings.cards.doneList === undefined) {
|
|
110
110
|
config.settings.cards.doneList = lists ? lists[lists.length - 1] : ''
|
|
111
111
|
}
|
|
112
112
|
// Add name
|
|
113
|
-
if (
|
|
113
|
+
if (config.settings.name === undefined) {
|
|
114
114
|
config.settings.name = _path.basename(path)
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -138,7 +138,7 @@ module.exports = function (repo, defaultSettings = defaultSettingsObject) {
|
|
|
138
138
|
})
|
|
139
139
|
|
|
140
140
|
// Make sure kudosProbability is set
|
|
141
|
-
if (
|
|
141
|
+
if (config.settings.kudosProbability === undefined) {
|
|
142
142
|
config.settings.kudosProbability = 0.33
|
|
143
143
|
}
|
|
144
144
|
|
|
@@ -251,7 +251,10 @@ function mixin(repo, fs = require('fs')) {
|
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
repo.loadConfig = function (cb) {
|
|
254
|
-
// BACKLOG
|
|
254
|
+
// BACKLOG If a config is bad move it to config.json.bak and save a new one with defaults gh:2 id:9 +enhancement +standup +chore
|
|
255
|
+
// <!--
|
|
256
|
+
// order:-670
|
|
257
|
+
// -->
|
|
255
258
|
cb = tools.cb(cb)
|
|
256
259
|
repo.loadIgnore()
|
|
257
260
|
// new
|
|
@@ -8,7 +8,10 @@ var fsStore = require('./repo-fs-store'),
|
|
|
8
8
|
|
|
9
9
|
module.exports = mixin
|
|
10
10
|
|
|
11
|
-
// BACKLOG
|
|
11
|
+
// BACKLOG Only emit file.update if the file checksum has changed
|
|
12
|
+
// <!--
|
|
13
|
+
// order:-650
|
|
14
|
+
// -->
|
|
12
15
|
function mixin(repo, fs = require('fs')) {
|
|
13
16
|
repo = fsStore(repo, fs)
|
|
14
17
|
var _refresh = repo.refresh
|
|
@@ -150,6 +153,9 @@ function mixin(repo, fs = require('fs')) {
|
|
|
150
153
|
const isFile = File.isFile(file)
|
|
151
154
|
// BACKLOG ## Handle the case where the file is not in the repo
|
|
152
155
|
// #urgent #1.12.0
|
|
156
|
+
// <!--
|
|
157
|
+
// order:-660
|
|
158
|
+
// -->
|
|
153
159
|
if (isFile && stat.mtime <= file.getModifiedTime()) {
|
|
154
160
|
// console.log("File update already applied. Change ignored.")
|
|
155
161
|
return
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// const removeMD = require('remove-markdown')
|
|
2
|
-
const { renderMarkdown } = require('../adapters/markdown')
|
|
3
1
|
const Plugin = require('imdone-api')
|
|
4
2
|
|
|
5
3
|
function getIsEpicMeta(task) {
|
|
@@ -161,7 +159,7 @@ module.exports = class EpicPlugin extends Plugin {
|
|
|
161
159
|
content += '<ul style="list-style: none;">'
|
|
162
160
|
content += tasks
|
|
163
161
|
.map((task) => {
|
|
164
|
-
const taskText = renderMarkdown(task.text).replaceAll(/<p>|<\/p>/ig, '') // removeMD(task.text)
|
|
162
|
+
const taskText = this.project.renderMarkdown(task.text).replaceAll(/<p>|<\/p>/ig, '') // removeMD(task.text)
|
|
165
163
|
const checked =
|
|
166
164
|
task.list === this.project.doneList ? ' checked="true"' : ''
|
|
167
165
|
const taskFilePath = encodeURI(
|
package/lib/project.js
CHANGED
|
@@ -15,7 +15,7 @@ const exec = require('child_process').exec
|
|
|
15
15
|
const fastSort = require('fast-sort/dist/sort.js')
|
|
16
16
|
const Task = require('./task')
|
|
17
17
|
const eol = require('eol')
|
|
18
|
-
const { renderMarkdown } = require('./adapters/markdown')
|
|
18
|
+
const { renderMarkdown, extractWikilinkTopics } = require('./adapters/markdown')
|
|
19
19
|
|
|
20
20
|
function calculateTotals(lists) {
|
|
21
21
|
const totals = {}
|
|
@@ -88,7 +88,10 @@ module.exports = class WorkerProject extends Project {
|
|
|
88
88
|
if (!cb) return promise
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
// HACK
|
|
91
|
+
// HACK To handle circular dependency issue with file
|
|
92
|
+
// <!--
|
|
93
|
+
// order:0
|
|
94
|
+
// -->
|
|
92
95
|
toJSON() {
|
|
93
96
|
return { path: this.path }
|
|
94
97
|
}
|
|
@@ -787,6 +790,10 @@ module.exports = class WorkerProject extends Project {
|
|
|
787
790
|
}
|
|
788
791
|
|
|
789
792
|
renderMarkdown(content) {
|
|
790
|
-
return renderMarkdown(content)
|
|
793
|
+
return renderMarkdown(content, this.path)
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
extractWikilinkTopics(markdown) {
|
|
797
|
+
return extractWikilinkTopics(markdown)
|
|
791
798
|
}
|
|
792
799
|
}
|
package/lib/repository.js
CHANGED
|
@@ -629,7 +629,10 @@ Repository.prototype.readFile = function (file, cb) {
|
|
|
629
629
|
if (!/\.\.(\/|\\)/.test(filePath)) {
|
|
630
630
|
this.readFileContent(file, (err, file) => {
|
|
631
631
|
if (err) return cb(new Error('Unable to read file:' + filePath))
|
|
632
|
-
// BACKLOG
|
|
632
|
+
// BACKLOG Allow user to assign a module for content transformation
|
|
633
|
+
// <!--
|
|
634
|
+
// order:-800
|
|
635
|
+
// -->
|
|
633
636
|
file.checksum = checksum(file.getContent())
|
|
634
637
|
file.updated = currentChecksum !== file.checksum
|
|
635
638
|
if (file.updated)
|
|
@@ -914,7 +917,10 @@ Repository.prototype.moveTasksBetweenLists = function(oldName, newName, cb) {
|
|
|
914
917
|
}
|
|
915
918
|
})
|
|
916
919
|
|
|
917
|
-
// BACKLOG
|
|
920
|
+
// BACKLOG Let's use saveModifiedFiles here id:15 gh:100 +fix
|
|
921
|
+
// <!--
|
|
922
|
+
// order:-810
|
|
923
|
+
// -->
|
|
918
924
|
|
|
919
925
|
this.moving = true
|
|
920
926
|
if (modifyTasks.length > 0) {
|
package/lib/task.js
CHANGED
|
@@ -386,7 +386,10 @@ Task.prototype.getTagPrefix = function () {
|
|
|
386
386
|
}
|
|
387
387
|
|
|
388
388
|
Task.prototype.addToLastCommentInContent = Task.addToLastCommentInContent = function (content, toAdd, newLine) {
|
|
389
|
-
// BACKLOG
|
|
389
|
+
// BACKLOG respect padding of task prefix for list items
|
|
390
|
+
// <!--
|
|
391
|
+
// order:-680
|
|
392
|
+
// -->
|
|
390
393
|
let prefix = newLine ? lineEnd : ' '
|
|
391
394
|
const commentRegex = /<!--([\s\S]*?)-->/gm
|
|
392
395
|
let result, lastIndex, index
|
|
@@ -523,7 +526,10 @@ Task.removeContext = function (text) {
|
|
|
523
526
|
}
|
|
524
527
|
|
|
525
528
|
Task.prototype.updateContext = function () {
|
|
526
|
-
// BACKLOG
|
|
529
|
+
// BACKLOG implement updateContext id:1 gh:124
|
|
530
|
+
// <!--
|
|
531
|
+
// order:-690
|
|
532
|
+
// -->
|
|
527
533
|
var self = this
|
|
528
534
|
if (this.context) {
|
|
529
535
|
let text = Task.removeContext(this.text)
|
|
@@ -700,7 +706,10 @@ Task.prototype.getList = function () {
|
|
|
700
706
|
* @method getText
|
|
701
707
|
* @return text
|
|
702
708
|
*/
|
|
703
|
-
// BACKLOG
|
|
709
|
+
// BACKLOG make this use config.getMetaSep
|
|
710
|
+
// <!--
|
|
711
|
+
// order:-700
|
|
712
|
+
// -->
|
|
704
713
|
Task.prototype.getText = function (opts, text) {
|
|
705
714
|
if (text === undefined) text = this.text
|
|
706
715
|
if (opts) {
|
package/lib/tools.js
CHANGED
|
@@ -4,7 +4,6 @@ var _isFunction = require('lodash.isfunction'),
|
|
|
4
4
|
_noop = require('lodash.noop'),
|
|
5
5
|
crypto = require('crypto'),
|
|
6
6
|
_path = require('path'),
|
|
7
|
-
markdown = require('markdown-it')().use(require('markdown-it-checkbox')),
|
|
8
7
|
fastSort = require('fast-sort/dist/sort.js'),
|
|
9
8
|
eol = require('eol'),
|
|
10
9
|
max_bytes = 512
|
|
@@ -89,18 +88,6 @@ function isBinaryCheck(bytes, size) {
|
|
|
89
88
|
|
|
90
89
|
module.exports = {
|
|
91
90
|
escapeRegExp: require('escape-string-regexp'),
|
|
92
|
-
marked: function (content) {
|
|
93
|
-
return markdown.render(content)
|
|
94
|
-
},
|
|
95
|
-
parseMD: function (content) {
|
|
96
|
-
return markdown.parse(content, {})
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Description
|
|
101
|
-
* @method userHome
|
|
102
|
-
* @return LogicalExpression
|
|
103
|
-
*/
|
|
104
91
|
userHome: function () {
|
|
105
92
|
return process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE
|
|
106
93
|
},
|