Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Commit

Permalink
Update pageIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
Sirherobrine23 committed May 10, 2023
1 parent 6b7dcba commit 8d138c2
Show file tree
Hide file tree
Showing 47 changed files with 173 additions and 124 deletions.
2 changes: 1 addition & 1 deletion packages/ar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
"@sirherobrine23/extends": "3.6.10"
},
"workspaces": [
"../*"
"../extends"
]
}
7 changes: 6 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
"@sirherobrine23/http": "3.6.10"
},
"workspaces": [
"../*"
"../ar",
"../cloud",
"../dpkg",
"../docker",
"../extends",
"../http"
]
}
3 changes: 2 additions & 1 deletion packages/docker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@types/tar-stream": "^2.2.2"
},
"workspaces": [
"../*"
"../descompress",
"../http"
]
}
5 changes: 4 additions & 1 deletion packages/dpkg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
"@types/tar-stream": "^2.2.2"
},
"workspaces": [
"../*"
"../ar",
"../decompress",
"../extends",
"../http"
]
}
2 changes: 1 addition & 1 deletion packages/http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
"@types/tar-stream": "^2.2.2"
},
"workspaces": [
"../*"
"../extends"
]
}
6 changes: 6 additions & 0 deletions packages/page_index/default/icons.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"*": {
"type": "png",
"file": "icons/arquivo-windows-11/icons8-arquivo-32.png"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions packages/page_index/default/index.template.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
* {
font-family: sans-serif;
}
svg {
width: 17px;
padding-right: 5px;
}
img {
width: 3%;
}

tbody tr td a {
display: flex;
justify-content: flex-start;
align-items: center;

}
27 changes: 27 additions & 0 deletions packages/page_index/default/index.template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<html>
<head>
<title>Index of #TITLE</title>
</head>
<style></style>
<body>
<h1 id="dir_title">Index of #DIR</h1>
<hr>
<table id="table_index">
<col width="800">
<col width="250">
<col width="80">
<tr>
<th>Filename</th>
<th>Last modified</th>
<th>Size</th>
</tr>
</table>
<hr>
<span>
<span style="font-size: 12px">
<div>generated by <a href="https://github.com/libthinkpad/apindex">Apindex</a></div>
<div>Modified by <a href="https://github.com/Sirherobrine23/coreUtils/tree/main/packages/page_index">Sirherobrine23</a></div>
</span>
</span>
</body>
</html>
4 changes: 0 additions & 4 deletions packages/page_index/files_default/footer.template.html

This file was deleted.

1 change: 0 additions & 1 deletion packages/page_index/files_default/icons.json

This file was deleted.

30 changes: 0 additions & 30 deletions packages/page_index/files_default/index.template.html

This file was deleted.

4 changes: 3 additions & 1 deletion packages/page_index/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
},
"dependencies": {
"@sirherobrine23/http": "3.6.10",
"@sirherobrine23/extends": "3.6.10",
"jsdom": "^22.0.0",
"yargs": "^17.7.2"
},
Expand All @@ -38,6 +39,7 @@
"@types/yargs": "^17.0.24"
},
"workspaces": [
"../*"
"../http",
"../extends"
]
}
29 changes: 19 additions & 10 deletions packages/page_index/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
#!/usr/bin/env node
import path from "node:path";
import { createIndex, defaultIcons } from "./index.js";
import yargs from "yargs";
import pageIndex from "./index.js";
import path from "path";

const options = yargs(process.argv.slice(2)).strictOptions().help(false).option("subPath", {
const options = yargs(process.argv.slice(2)).help(true).alias("h", "help").strictOptions().option("rootPage", {
default: "/",
type: "string",
string: true,
alias: "s",
default: "/",
description: "Sub path to index, example in github pages set '/<project-name>' or '/<project-name>/<sub-path>'",
description: "set Root page, use if run to Github pages"
}).option("source", {
type: "string",
string: true,
alias: [
"src", "s"
],
default: process.cwd(),
description: "Page source."
}).parseSync();

// Create index
await pageIndex({
subPath: options.subPath||"/",
folder: path.resolve(process.cwd(), String(options._.at(-1) ?? "")),
await createIndex(path.resolve(process.cwd(), options.source), {
rootPage: options.rootPage,
icons: defaultIcons,
}).catch(err => {
console.error(err);
process.exit(1);
});
Loading

0 comments on commit 8d138c2

Please sign in to comment.