2020-06-23 04:45:38 -04:00
|
|
|
import _ from 'lodash'
|
2020-05-19 05:02:56 -04:00
|
|
|
import App from '../../../base'
|
|
|
|
|
2021-04-14 09:17:21 -04:00
|
|
|
export default App.factory('files', function (ide) {
|
2020-05-19 05:02:56 -04:00
|
|
|
const Files = {
|
|
|
|
getTeXFiles() {
|
2021-05-05 09:05:04 -04:00
|
|
|
const texFiles = []
|
2021-04-14 09:17:21 -04:00
|
|
|
ide.fileTreeManager.forEachEntity(function (entity, _folder, path) {
|
2020-05-19 05:02:56 -04:00
|
|
|
if (
|
|
|
|
entity.type === 'doc' &&
|
|
|
|
/.*\.(tex|md|txt|tikz)/.test(entity.name)
|
|
|
|
) {
|
|
|
|
const cloned = _.clone(entity)
|
|
|
|
cloned.path = path
|
|
|
|
texFiles.push(cloned)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
return texFiles
|
2021-04-27 03:52:58 -04:00
|
|
|
},
|
2020-05-19 05:02:56 -04:00
|
|
|
}
|
|
|
|
return Files
|
|
|
|
})
|