Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
breck7 committed Sep 28, 2024
1 parent 9210aa6 commit f838b03
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scroll-cli",
"version": "136.4.1",
"version": "136.5.0",
"description": "A language for scientists of all ages. A curated collection of tools for refining and sharing thoughts.",
"main": "scroll.js",
"engines": {
Expand Down
31 changes: 31 additions & 0 deletions parsers/disk.parsers
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
scrollDiskParser
extends scrollTableParser
description Output file into as table.
crux disk
javascript
delimiter = "json"
get delimitedData() {
return this.isNodeJs() ? this.delimitedDataNodeJs : ""
}
get delimitedDataNodeJs() {
const fs = require('fs');
const path = require('path');
const {folderPath} = this.parent.file
const folder = this.content ? path.join(folderPath, this.content) : folderPath
function getDirectoryContents(dirPath) {
const directoryContents = [];
const items = fs.readdirSync(dirPath);
items.forEach((item) => {
const itemPath = path.join(dirPath, item);
const stats = fs.statSync(itemPath);
directoryContents.push({
name: item,
type: stats.isDirectory() ? 'directory' : 'file',
size: stats.size,
lastModified: stats.mtime
});
});
return directoryContents;
}
return JSON.stringify(getDirectoryContents(folder))
}
3 changes: 3 additions & 0 deletions releaseNotes.scroll
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ ciBadges.scroll
br
thinColumns

πŸ“¦ 136.5.0 9/27/2024
πŸŽ‰ new `disk` parser generates a table from local disk

πŸ“¦ 136.4.1 9/27/2024
πŸ₯ type fix in table links

Expand Down
7 changes: 7 additions & 0 deletions tests/disk.scroll
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
buildHtml
title Disk
theme gazette
container
disk
printTable
tableSearch

0 comments on commit f838b03

Please sign in to comment.