Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cypress/e2e/image_tests.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ describe("Documentation Page Images", () => {
{ url: "/docs/doc-emojis-special-chars", name: "Special Chars and emojis" },
{ url: "/docs/doc-render-console", name: "Render Console Output" },
{ url: "/docs/doc-typescript", name: "Typescript" },
{ url: "/docs/doc-cli-install-quick-start", name: "CLI Quick Start" }
{ url: "/docs/doc-cli-install-quick-start", name: "CLI Quick Start" },
{ url: "/docs/doc-cli-brew", name: "CLI Homebrew" }
];

beforeEach(() => {
Expand Down
9 changes: 5 additions & 4 deletions cypress/e2e/link_tests.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("Link Tests", () => {
describe("Navigation Links", () => {
it("should have working header navigation links", () => {
// Test GitHub link in header
cy.get('a[href="https://github.com/ayonious/console-table-printer"]')
cy.get('a[href="https://github.com/console-table-printer/console-table-printer"]')
.should("have.attr", "target", "_blank")
.should("have.attr", "rel", "noopener noreferrer");

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

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

sidebarLinks.forEach((link: SidebarLink) => {
Expand Down Expand Up @@ -114,7 +115,7 @@ describe("Link Tests", () => {
describe("Announcement Bar Link", () => {
it("should have working GitHub star link", () => {
cy.get('div[class*="announcementBarContent"]')
.find('a[href="https://github.com/ayonious/console-table-printer"]')
.find('a[href="https://github.com/console-table-printer/console-table-printer"]')
.should("have.attr", "target", "_blank")
.should("have.attr", "rel", "noopener noreferrer");
});
Expand Down
22 changes: 19 additions & 3 deletions cypress/e2e/page_tests.cy.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
interface PageTest {
interface PageTestInterface {
title: string;
headlines: string[];
}

describe("Testing Each Documentation Page", () => {
const pages: PageTest[] = [
const pages: PageTestInterface[] = [
{
title: "Install and Quick start",
headlines: ["Installation", "Basic Example"]
Expand Down Expand Up @@ -103,6 +103,22 @@ describe("Testing Each Documentation Page", () => {
{
title: "Quick Start",
headlines: ["Synopsis", "Installation", "Basic Example", "Detailed usage"]
},
{
title: "CLI Quick Start",
headlines: ["Installation", "Basic Example"]
},
{
title: "Homebrew",
headlines: [
"Quick Install",
"Usage",
"Show help",
"Simple Table",
"Use custom column styles",
"Change table title",
"Uninstallation"
]
}
];

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

pages.forEach((page: PageTest) => {
pages.forEach((page: PageTestInterface) => {
it(`${page.title} page contains correct headlines`, () => {
cy.contains(page.title).click();

Expand Down
5 changes: 5 additions & 0 deletions cypress/e2e/url_tests.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ describe("Testing Each Documentation Page", () => {
url: "/docs/doc-cli-install-quick-start",
title: "CLI Quick Start",
headlines: ["Synopsis", "Installation", "Basic Example", "Detailed usage"]
},
{
url: "/docs/doc-cli-brew",
title: "CLI Homebrew",
headlines: ["Quick Install", "Usage", "Change table title", "Use custom column styles", "Uninstallation", "Notes"]
}
];

Expand Down
57 changes: 57 additions & 0 deletions docs/doc-cli-brew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
id: doc-cli-brew
title: Homebrew Installation
sidebar_label: Homebrew
---

# ctp - A Homebrew CLI Table Printer

🍻 This is a Homebrew tap for table-printer-cli, a Node.js CLI tool for printing beautiful tables in your terminal.

## 🚀 Quick Install

```bash
brew install console-table-printer/homebrew-console-table/ctp
```

## 📋 Usage

After installation, you can use the `ctp` command in your terminal:

### Show help

```bash
ctp --help
```

### Simple Table

```bash
ctp -i '[{ "id":3, "text":"like" }, {"id":4, "text":"tea"}]'
```

### Use custom column styles

```bash
ctp -i '[{"id":1,"status":"active"},{"id":2,"status":"inactive"}]' --tableOptions '{"columns": [{"name": "status", "color": "green"}]}'
```

### Change table title

```bash
ctp -i '[{"id":1,"name":"John"}]' --tableOptions '{"title": "Users List"}'
```

## 🗑️ Uninstallation

To remove the package:

```bash
brew uninstall ctp
```

## Notes

- Input must be valid JSON
- Table options must be valid JSON format
- Colors and styles are compatible with the console-table-printer library
2 changes: 1 addition & 1 deletion docs/doc-cli-install-quick-start.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: doc-cli-install-quick-start
title: Quick Start
sidebar_label: Quick Start
sidebar_label: CLI Quick Start
---

import useBaseUrl from '@docusaurus/useBaseUrl';
Expand Down
6 changes: 3 additions & 3 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
announcementBar: {
id: "support",
content:
'⭐️ 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>! ⭐️',
'⭐️ 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>! ⭐️',
},
navbar: {
title: "Console Table Printer",
Expand All @@ -22,7 +22,7 @@ module.exports = {
},
items: [
{
href: "https://github.com/ayonious/console-table-printer",
href: "https://github.com/console-table-printer/console-table-printer",
label: "GitHub",
position: "right",
},
Expand Down Expand Up @@ -71,7 +71,7 @@ module.exports = {
items: [
{
label: "GitHub",
href: "https://github.com/ayonious/console-table-printer",
href: "https://github.com/console-table-printer/console-table-printer",
},
{
label: "Npmjs",
Expand Down
5 changes: 4 additions & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ module.exports = {
"doc-render-console",
"doc-typescript",
],
"Table Printer CLI": ["doc-cli-install-quick-start"],
"Table Printer CLI": [
"doc-cli-install-quick-start",
"doc-cli-brew"
],
},
};