imdone-core 1.34.3 → 1.36.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/README.md +2 -3
- package/lib/adapters/markdown.js +1 -0
- package/lib/card.js +17 -2
- package/lib/config.js +6 -2
- package/lib/file.js +0 -2
- package/lib/mixins/repo-fs-store.js +1 -1
- package/lib/mixins/repo-watched-fs-store.js +2 -2
- package/lib/project.js +2 -2
- package/lib/repository.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,12 +70,11 @@ Take a look at the source of this README.md. You'll probably find a few tasks i
|
|
|
70
70
|
### Task syntax
|
|
71
71
|
- Code style tasks will only be detected if the list name matches a string in the `code.include_lists` attribute in `.imdone/config.yml` and the file extension exists in lib/languages.js.
|
|
72
72
|
- List names in code style tasks must match this regular expression ([A-Z]+[A-Z-_]+?).
|
|
73
|
+
- Only code style tasks can be used in code files and must be in a line or block comment
|
|
74
|
+
- Code style tasks are only detected in comments for files with extensions listed in [imdone-core/languages.js](https://github.com/imdone/imdone-core/blob/master/lib/languages.js) or the **languages** attribute in the `.imdone/config.yml`
|
|
73
75
|
- In Hash and markdown style tasks **list name** can be any combination of upper and lower case letters, underscores and dashes
|
|
74
76
|
- In Hash and markdown style tasks the **list name** must be followed by a `:` and a number which determines sort order in the list
|
|
75
77
|
- Sort numbers can be reused, in which case tasks with the same sort number will be sorted alphabetically by text.
|
|
76
|
-
- In code, tasks can be any style but must be in a line or block comment
|
|
77
|
-
- Code style tasks are only detected in comments for files with extensions listed in [imdone-core/languages.js](https://github.com/imdone/imdone-core/blob/master/lib/languages.js) or the **languages** attribute in the `.imdone/config.yml`
|
|
78
|
-
- For code and hash style tasks, the task text is terminated by the end of line
|
|
79
78
|
- Task text can have [todo.txt formatting](https://github.com/todotxt/todo.txt) excluding the completion and priority markers.
|
|
80
79
|
- Task text can have markdown formatting
|
|
81
80
|
|
package/lib/adapters/markdown.js
CHANGED
package/lib/card.js
CHANGED
|
@@ -31,7 +31,7 @@ module.exports = function newCard(task, _project, dontParse) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
get maxLines() {
|
|
34
|
-
return
|
|
34
|
+
return project.config.maxLines
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
get interpretedContent() {
|
|
@@ -250,10 +250,11 @@ module.exports = function newCard(task, _project, dontParse) {
|
|
|
250
250
|
|
|
251
251
|
getCardMarkdown() {
|
|
252
252
|
// - eliminate <!--[ ]--> wrappers
|
|
253
|
-
|
|
253
|
+
let taskMD = this.interpretedContent
|
|
254
254
|
.replace(/%%[\s\S]*?%%/g, '')
|
|
255
255
|
.replace(/<\!--\s*?-->/gs, '')
|
|
256
256
|
.trim()
|
|
257
|
+
taskMD = this.replaceImagePaths(taskMD)
|
|
257
258
|
// - Split on eol and append lines until visible line count equals lines
|
|
258
259
|
const displayContent = []
|
|
259
260
|
const rawContent = []
|
|
@@ -274,6 +275,20 @@ module.exports = function newCard(task, _project, dontParse) {
|
|
|
274
275
|
return { totalLines, markdown, rawMarkdown }
|
|
275
276
|
}
|
|
276
277
|
|
|
278
|
+
replaceImagePaths(content) {
|
|
279
|
+
return content.replace(
|
|
280
|
+
/(!\[.*?\]\()(.*?)(\))/g,
|
|
281
|
+
(match, p1, imagePath, p3) => {
|
|
282
|
+
imagePath = _path.join(
|
|
283
|
+
_path.dirname(this.fullPath),
|
|
284
|
+
imagePath
|
|
285
|
+
)
|
|
286
|
+
const imageURL = `file://${imagePath}`
|
|
287
|
+
return p1 + imageURL + p3
|
|
288
|
+
}
|
|
289
|
+
)
|
|
290
|
+
}
|
|
291
|
+
|
|
277
292
|
getHtml(content) {
|
|
278
293
|
const html = renderMarkdown(content)
|
|
279
294
|
const mdArray = eol.split(content)
|
package/lib/config.js
CHANGED
|
@@ -67,8 +67,8 @@ class Config {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
getDoneList() {
|
|
70
|
-
const lists = _cloneDeep(this.lists).reverse()
|
|
71
|
-
const defaultValue = lists && lists.length ? lists[0].name :
|
|
70
|
+
const lists = _cloneDeep(this.lists).reverse().filter((list) => !list.filter)
|
|
71
|
+
const defaultValue = lists && lists.length ? lists[0].name : undefined
|
|
72
72
|
return _get(this, 'settings.cards.doneList', defaultValue)
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -172,6 +172,10 @@ class Config {
|
|
|
172
172
|
return _get(this, 'settings.cards.orderMeta', false)
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
+
get maxLines() {
|
|
176
|
+
return _get(this, 'settings.cards.maxLines', 1)
|
|
177
|
+
}
|
|
178
|
+
|
|
175
179
|
get blankLinesToEndTask() {
|
|
176
180
|
let blankLinesToEndTask = Math.round(
|
|
177
181
|
_get(this, 'settings.cards.blankLinesToEndTask', 1)
|
package/lib/file.js
CHANGED
|
@@ -513,8 +513,6 @@ File.prototype.extractTasksInCodeFile = function (config) {
|
|
|
513
513
|
while ((result = commentRegex.exec(self.getContent())) !== null) {
|
|
514
514
|
var comment = result[0]
|
|
515
515
|
var commentStart = result.index
|
|
516
|
-
self.extractHashStyleTasks(config, commentStart, comment)
|
|
517
|
-
self.extractLinkStyleTasks(config, commentStart, comment)
|
|
518
516
|
self.extractCodeStyleTasks(config, commentStart, comment)
|
|
519
517
|
}
|
|
520
518
|
}
|
|
@@ -216,7 +216,7 @@ function mixin(repo, fs = require('fs')) {
|
|
|
216
216
|
include_lists = _union(include_lists, currentConfig.code.include_lists)
|
|
217
217
|
|
|
218
218
|
if (currentConfig && currentConfig.settings)
|
|
219
|
-
loadedConfig.settings = {...
|
|
219
|
+
loadedConfig.settings = {...currentConfig.settings, ...loadedConfig.settings}
|
|
220
220
|
|
|
221
221
|
if (loadedConfig && loadedConfig.code)
|
|
222
222
|
include_lists = _union(include_lists, loadedConfig.code.include_lists)
|
|
@@ -46,7 +46,7 @@ function mixin(repo, fs = require('fs')) {
|
|
|
46
46
|
if (initializing) {
|
|
47
47
|
return cb ? cb('already initializing') : null
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
console.info('Initializing repo:', repo.path)
|
|
50
50
|
initializing = true
|
|
51
51
|
if (repo.watcher) repo.watcher.close()
|
|
52
52
|
_refresh.call(repo, function (err, files) {
|
|
@@ -73,7 +73,7 @@ function mixin(repo, fs = require('fs')) {
|
|
|
73
73
|
console.info('Loading config. Observed a change to:', file)
|
|
74
74
|
const label = `Refresh repo: ${repo.path}`
|
|
75
75
|
console.time(label)
|
|
76
|
-
|
|
76
|
+
repo.refresh((err, files) => {
|
|
77
77
|
if (err) console.error('Error refreshing repo', err)
|
|
78
78
|
console.timeEnd(label)
|
|
79
79
|
repo.emitConfigUpdate(file, repo.config)
|
package/lib/project.js
CHANGED
|
@@ -265,11 +265,11 @@ module.exports = class WorkerProject extends Project {
|
|
|
265
265
|
if (!task.allMeta[key]) task.allMeta[key] = []
|
|
266
266
|
task.allMeta[key].push(value)
|
|
267
267
|
if (!/^['"]/.test(value) && /\s/.test(value)) value = `"${value}"`
|
|
268
|
-
const metaData = `${key}${this.
|
|
268
|
+
const metaData = `${key}${this.config.getMetaSep()}${value}`
|
|
269
269
|
const content = task.addToLastCommentInContent(
|
|
270
270
|
task.content,
|
|
271
271
|
metaData,
|
|
272
|
-
this.
|
|
272
|
+
this.config.isMetaNewLine()
|
|
273
273
|
)
|
|
274
274
|
return await this.updateCardContent(task, content)
|
|
275
275
|
}
|
package/lib/repository.js
CHANGED
|
@@ -419,7 +419,7 @@ Repository.prototype.shouldInclude = function (relPath) {
|
|
|
419
419
|
}
|
|
420
420
|
if (this.ignore) {
|
|
421
421
|
try {
|
|
422
|
-
include = include && !this.ignore.ignores(relPath)
|
|
422
|
+
include = include && (relPath === '' || !this.ignore.ignores(relPath))
|
|
423
423
|
} catch (e) {
|
|
424
424
|
console.error(
|
|
425
425
|
`Failed to check ignore status for dir: [${relPath}] in: [${this.path}]. It will be included.`,
|