Skip to content

Commit f9fc74b

Browse files
authored
Add new doc (#116)
1 parent 9c5282f commit f9fc74b

File tree

8 files changed

+96
-13
lines changed

8 files changed

+96
-13
lines changed

cypress/e2e/image_tests.cy.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ describe("Documentation Page Images", () => {
3131
{ url: "/docs/doc-emojis-special-chars", name: "Special Chars and emojis" },
3232
{ url: "/docs/doc-render-console", name: "Render Console Output" },
3333
{ url: "/docs/doc-typescript", name: "Typescript" },
34-
{ url: "/docs/doc-cli-install-quick-start", name: "CLI Quick Start" }
34+
{ url: "/docs/doc-cli-install-quick-start", name: "CLI Quick Start" },
35+
{ url: "/docs/doc-cli-brew", name: "CLI Homebrew" }
3536
];
3637

3738
beforeEach(() => {

cypress/e2e/link_tests.cy.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe("Link Tests", () => {
1111
describe("Navigation Links", () => {
1212
it("should have working header navigation links", () => {
1313
// Test GitHub link in header
14-
cy.get('a[href="https://github.com/ayonious/console-table-printer"]')
14+
cy.get('a[href="https://github.com/console-table-printer/console-table-printer"]')
1515
.should("have.attr", "target", "_blank")
1616
.should("have.attr", "rel", "noopener noreferrer");
1717

@@ -48,7 +48,7 @@ describe("Link Tests", () => {
4848
it("should have working external links in footer", () => {
4949
// Test GitHub link in footer
5050
cy.get('footer')
51-
.find('a[href="https://github.com/ayonious/console-table-printer"]')
51+
.find('a[href="https://github.com/console-table-printer/console-table-printer"]')
5252
.should("have.attr", "target", "_blank")
5353
.should("have.attr", "rel", "noopener noreferrer");
5454

@@ -85,7 +85,8 @@ describe("Link Tests", () => {
8585
{ text: "Special Chars and emojis", url: "/docs/doc-emojis-special-chars" },
8686
{ text: "Render Console Output", url: "/docs/doc-render-console" },
8787
{ text: "Typescript", url: "/docs/doc-typescript" },
88-
{ text: "Quick Start", url: "/docs/doc-cli-install-quick-start" }
88+
{ text: "CLI Quick Start", url: "/docs/doc-cli-install-quick-start" },
89+
{ text: "Homebrew", url: "/docs/doc-cli-brew" }
8990
];
9091

9192
sidebarLinks.forEach((link: SidebarLink) => {
@@ -114,7 +115,7 @@ describe("Link Tests", () => {
114115
describe("Announcement Bar Link", () => {
115116
it("should have working GitHub star link", () => {
116117
cy.get('div[class*="announcementBarContent"]')
117-
.find('a[href="https://github.com/ayonious/console-table-printer"]')
118+
.find('a[href="https://github.com/console-table-printer/console-table-printer"]')
118119
.should("have.attr", "target", "_blank")
119120
.should("have.attr", "rel", "noopener noreferrer");
120121
});

cypress/e2e/page_tests.cy.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
interface PageTest {
1+
interface PageTestInterface {
22
title: string;
33
headlines: string[];
44
}
55

66
describe("Testing Each Documentation Page", () => {
7-
const pages: PageTest[] = [
7+
const pages: PageTestInterface[] = [
88
{
99
title: "Install and Quick start",
1010
headlines: ["Installation", "Basic Example"]
@@ -103,6 +103,22 @@ describe("Testing Each Documentation Page", () => {
103103
{
104104
title: "Quick Start",
105105
headlines: ["Synopsis", "Installation", "Basic Example", "Detailed usage"]
106+
},
107+
{
108+
title: "CLI Quick Start",
109+
headlines: ["Installation", "Basic Example"]
110+
},
111+
{
112+
title: "Homebrew",
113+
headlines: [
114+
"Quick Install",
115+
"Usage",
116+
"Show help",
117+
"Simple Table",
118+
"Use custom column styles",
119+
"Change table title",
120+
"Uninstallation"
121+
]
106122
}
107123
];
108124

@@ -112,7 +128,7 @@ describe("Testing Each Documentation Page", () => {
112128
cy.contains("GET STARTED").click();
113129
});
114130

115-
pages.forEach((page: PageTest) => {
131+
pages.forEach((page: PageTestInterface) => {
116132
it(`${page.title} page contains correct headlines`, () => {
117133
cy.contains(page.title).click();
118134

cypress/e2e/url_tests.cy.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ describe("Testing Each Documentation Page", () => {
128128
url: "/docs/doc-cli-install-quick-start",
129129
title: "CLI Quick Start",
130130
headlines: ["Synopsis", "Installation", "Basic Example", "Detailed usage"]
131+
},
132+
{
133+
url: "/docs/doc-cli-brew",
134+
title: "CLI Homebrew",
135+
headlines: ["Quick Install", "Usage", "Change table title", "Use custom column styles", "Uninstallation", "Notes"]
131136
}
132137
];
133138

docs/doc-cli-brew.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
id: doc-cli-brew
3+
title: Homebrew Installation
4+
sidebar_label: Homebrew
5+
---
6+
7+
# ctp - A Homebrew CLI Table Printer
8+
9+
🍻 This is a Homebrew tap for table-printer-cli, a Node.js CLI tool for printing beautiful tables in your terminal.
10+
11+
## 🚀 Quick Install
12+
13+
```bash
14+
brew install console-table-printer/homebrew-console-table/ctp
15+
```
16+
17+
## 📋 Usage
18+
19+
After installation, you can use the `ctp` command in your terminal:
20+
21+
### Show help
22+
23+
```bash
24+
ctp --help
25+
```
26+
27+
### Simple Table
28+
29+
```bash
30+
ctp -i '[{ "id":3, "text":"like" }, {"id":4, "text":"tea"}]'
31+
```
32+
33+
### Use custom column styles
34+
35+
```bash
36+
ctp -i '[{"id":1,"status":"active"},{"id":2,"status":"inactive"}]' --tableOptions '{"columns": [{"name": "status", "color": "green"}]}'
37+
```
38+
39+
### Change table title
40+
41+
```bash
42+
ctp -i '[{"id":1,"name":"John"}]' --tableOptions '{"title": "Users List"}'
43+
```
44+
45+
## 🗑️ Uninstallation
46+
47+
To remove the package:
48+
49+
```bash
50+
brew uninstall ctp
51+
```
52+
53+
## Notes
54+
55+
- Input must be valid JSON
56+
- Table options must be valid JSON format
57+
- Colors and styles are compatible with the console-table-printer library

docs/doc-cli-install-quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: doc-cli-install-quick-start
33
title: Quick Start
4-
sidebar_label: Quick Start
4+
sidebar_label: CLI Quick Start
55
---
66

77
import useBaseUrl from '@docusaurus/useBaseUrl';

docusaurus.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
announcementBar: {
1313
id: "support",
1414
content:
15-
'⭐️ If you like Console Table Printer, give it a star on <a target="_blank" rel="noopener noreferrer" href="https://github.com/ayonious/console-table-printer">GitHub</a>! ⭐️',
15+
'⭐️ If you like Console Table Printer, give it a star on <a target="_blank" rel="noopener noreferrer" href="https://github.com/console-table-printer/console-table-printer">GitHub</a>! ⭐️',
1616
},
1717
navbar: {
1818
title: "Console Table Printer",
@@ -22,7 +22,7 @@ module.exports = {
2222
},
2323
items: [
2424
{
25-
href: "https://github.com/ayonious/console-table-printer",
25+
href: "https://github.com/console-table-printer/console-table-printer",
2626
label: "GitHub",
2727
position: "right",
2828
},
@@ -71,7 +71,7 @@ module.exports = {
7171
items: [
7272
{
7373
label: "GitHub",
74-
href: "https://github.com/ayonious/console-table-printer",
74+
href: "https://github.com/console-table-printer/console-table-printer",
7575
},
7676
{
7777
label: "Npmjs",

sidebars.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ module.exports = {
2020
"doc-render-console",
2121
"doc-typescript",
2222
],
23-
"Table Printer CLI": ["doc-cli-install-quick-start"],
23+
"Table Printer CLI": [
24+
"doc-cli-install-quick-start",
25+
"doc-cli-brew"
26+
],
2427
},
2528
};

0 commit comments

Comments
 (0)