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
156 changes: 136 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![Tests](https://img.shields.io/badge/Tests-145%20passing-brightgreen)](https://github.com/nickhart/markdown-workflow/actions/workflows/ci.yml)
[![Node.js](https://img.shields.io/badge/Node.js-20+-brightgreen)](https://nodejs.org/)
[![pnpm](https://img.shields.io/badge/pnpm-10+-blue)](https://pnpm.io/)
[![Turbo](https://img.shields.io/badge/Turbo-2+-red)](https://turbo.build/)
[![TypeScript](https://img.shields.io/badge/TypeScript-5+-blue)](https://www.typescriptlang.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Expand Down Expand Up @@ -58,12 +59,14 @@ And if you're using Git to track your repository (recommended!) you can commit c
### Presentation Workflow (New!)

- **Create presentations:** `wf create presentation "My Presentation Title"`
- **Mermaid diagrams:** Automatic processing of `mermaid:name` code blocks
- **Multi-engine diagrams:** Automatic processing of Mermaid, PlantUML, and Graphviz code blocks
- **Rich formatting:** Convert to PPTX with embedded diagrams
- **Status tracking:** Draft → review → published
- **Asset management:** Auto-generated images in `assets/` directory

Example Mermaid block:
Example diagram blocks:

**Mermaid (flowcharts, sequence diagrams):**

````markdown
```mermaid:architecture {align=center, width=90%}
Expand All @@ -73,6 +76,32 @@ graph TB
```
````

**PlantUML (UML diagrams):**

````markdown
```plantuml:class-diagram
@startuml
class User {
+name: string
+email: string
+login()
}
@enduml
```
````

**Graphviz (network graphs, decision trees):**

````markdown
```graphviz:network {layout=dot}
digraph {
rankdir=LR;
A -> B -> C;
A -> D -> C;
}
```
````

### Template System

- **Inheritance:** Project templates override system defaults
Expand All @@ -83,24 +112,32 @@ graph TB
### Processor System

- **Modular Processing:** Each workflow specifies which processors to use
- **Job Applications:** Clean documents with no special processing
- **Presentations:** Rich diagrams with Mermaid, PlantUML support
- **Job Applications:** Clean documents with emoji processing only
- **Presentations:** Rich diagrams with multiple diagram engines and emoji support
- **Extensible:** Add custom processors for your specific needs

Available processors:

- 🧩 **Mermaid** - Generate diagrams from code blocks
- 🌱 **PlantUML** - Create UML diagrams and flowcharts
- 😀 **Emoji** - Convert shortcodes to Unicode emoji
- 🔌 **Custom** - Build your own processors
- 🧩 **Mermaid** - Generate flowcharts, sequence diagrams, and more from code blocks
- 🌱 **PlantUML** - Create UML diagrams, activity diagrams, and flowcharts
- 📊 **Graphviz** - Generate professional network graphs, decision trees, and complex diagrams
- 😀 **Emoji** - Convert shortcodes to Unicode emoji (`:rocket:` → 🚀)
- 🔌 **Custom** - Build your own processors for specialized content

## 🚀 Quick Start

### Prerequisites

- Node.js 20+
- pnpm (recommended) or npm
- pnpm (for package management)
- pandoc (for document formatting)
- turbo (for monorepo build orchestration)

**Optional (for diagram processing):**

- graphviz (for Graphviz processor)
- plantuml (for PlantUML processor)
- @mermaid-js/mermaid-cli (for Mermaid processor - installed automatically)

### Installation

Expand All @@ -110,7 +147,7 @@ Available processors:
git clone https://github.com/yourusername/markdown-workflow.git
cd markdown-workflow
pnpm install
pnpm cli:build
turbo cli:build

# CLI is now available at dist/cli/index.js
# Use with: node dist/cli/index.js <command>
Expand Down Expand Up @@ -234,6 +271,86 @@ wf format job collection_id --format pdf
wf format job collection_id --format html
```

### Diagram Processing

The system supports three powerful diagram engines for different use cases:

#### 🧩 Mermaid - Interactive Diagrams

Best for: flowcharts, sequence diagrams, Gantt charts, mindmaps

````markdown
```mermaid:system-flow
graph TB
A[User Request] --> B{Auth Check}
B -->|Valid| C[Process Request]
B -->|Invalid| D[Return Error]
C --> E[Response]
```
````

````

**Supported diagram types:** flowchart, sequence, gantt, pie, journey, gitgraph, mindmap, timeline

#### 🌱 PlantUML - Professional UML

Best for: class diagrams, activity diagrams, use case diagrams, component diagrams

```markdown
```plantuml:auth-sequence
@startuml
User -> AuthService: login(credentials)
AuthService -> Database: validateUser()
Database --> AuthService: userInfo
AuthService --> User: token
@enduml
````

````

**Supported diagram types:** class, sequence, usecase, activity, component, state, object, deployment

#### 📊 Graphviz - Technical Graphs

Best for: network topologies, decision trees, dependency graphs, org charts

```markdown
```graphviz:dependency-graph {layout=dot}
digraph Dependencies {
rankdir=LR;
node [shape=box];

Frontend -> API;
API -> Database;
API -> Cache;
Frontend -> CDN;
}
````

````

**Layout engines:** dot (hierarchical), neato (spring), fdp (force-directed), circo (circular), twopi (radial)

### Emoji Processing

The emoji processor converts shortcodes like `:rocket:` to Unicode emoji 🚀. It uses GitHub's standard emoji names with convenient aliases for frequently used emojis.

**Examples:**

```markdown
Looking forward to working at DoorDash :takeout_box:!
This project is :fire: and I'm :thumbsup: about it!
More info available here :information_source:
````

**Naming Convention:**

- **GitHub Standard Names** (preferred): `:rocket:`, `:fire:`, `:thumbsup:`, `:takeout_box:`
- **Convenient Aliases**: `:thumbs_up:` (alias for `:thumbsup:`), `:info:` (alias for `:information_source:`)

The processor supports 100+ emojis covering tech, food, emotions, and professional contexts. For the complete list, see the [GitHub Emoji API](https://api.github.com/emojis).

### Migration & Utilities

```bash
Expand Down Expand Up @@ -306,25 +423,24 @@ rejected rejected rejected rejected declined

```bash
pnpm install # Install dependencies
pnpm cli:build # Build CLI (cached with TurboRepo)
pnpm test # Run unit tests
pnpm test:e2e:snapshots # Run E2E snapshot tests
turbo cli:build # Build CLI (cached with TurboRepo)
turbo test # Run unit tests
turbo test:e2e:snapshots # Run E2E snapshot tests
```

### Quality Assurance Commands

```bash
# Quick validation (essential checks only)
pnpm preflight # Build + unit tests + lint + format check
turbo preflight # Build + unit tests + lint + format check

# Comprehensive validation (includes E2E tests)
pnpm preflight:full # Build + unit tests + lint + format check + E2E snapshots
turbo preflight:full # Same as above, runs via Turbo
turbo preflight:full # Build + unit tests + lint + format check + E2E snapshots

# Individual quality checks
pnpm lint # ESLint code quality
pnpm format:check # Prettier formatting check
pnpm format # Auto-fix formatting issues
turbo lint # ESLint code quality
turbo format:check # Prettier formatting check
turbo format # Auto-fix formatting issues
```

### Testing
Expand Down Expand Up @@ -396,7 +512,7 @@ Get AI-powered code reviews on your pull requests using Claude:
1. Fork the repository
2. Create a feature branch
3. Add tests for new functionality
4. Run quality checks: `pnpm preflight:full` (includes all tests, linting, and formatting)
4. Run quality checks: `turbo preflight:full` (includes all tests, linting, and formatting)
5. Submit a pull request
6. _Optional_: Request AI review with `/claude-review` for additional feedback

Expand Down
Binary file modified example/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ Thank you for considering my application. I am excited about the possibility of
_Attachments: Resume, Portfolio_
_Contact: [your.email@example.com](mailto:your.email@example.com) | (555) 123-4567_
_LinkedIn: [linkedin.com/in/yourname](https://linkedin.com/in/yourname) | GitHub: [github.com/yourusername](https://github.com/yourusername/)_


Looking forward to helping DoorDash deliver amazing experiences :takeout_box: to customers everywhere!


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.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"type": "module",
"packageManager": "pnpm@10.12.1",
"packageManager": "pnpm@10.14.0",
"engines": {
"node": ">=20",
"pnpm": ">=10"
Expand Down
52 changes: 32 additions & 20 deletions scripts/test-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ log_info() {

log_success() {
echo -e "${GREEN}[PASS]${NC} $1"
((TESTS_PASSED++))
TESTS_PASSED=$((TESTS_PASSED + 1))
}

log_error() {
echo -e "${RED}[FAIL]${NC} $1"
((TESTS_FAILED++))
TESTS_FAILED=$((TESTS_FAILED + 1))
}

log_warning() {
Expand All @@ -42,7 +42,7 @@ run_test() {
local expected_exit_code="${3:-0}"
local expected_output="$4"

((TESTS_RUN++))
TESTS_RUN=$((TESTS_RUN + 1))
log_info "Running test: $test_name"

# Capture both stdout and stderr, and exit code
Expand Down Expand Up @@ -89,12 +89,25 @@ setup_test_env() {
mkdir -p "$PROJECT_TEST_DIR"
mkdir -p "$NON_PROJECT_DIR"

# Build the project
log_info "Building project..."
npm run build > /dev/null 2>&1
# Build the CLI
log_info "Building CLI..."
if ! pnpm cli:build > /dev/null 2>&1; then
log_error "Failed to build CLI"
exit 1
fi

# Create minimal system directory structure (avoid copying huge node_modules, .git, etc.)
log_info "Creating minimal system directory structure..."
mkdir -p "$SYSTEM_TEST_DIR/markdown-workflow"

# Copy only essential files and directories needed for E2E tests
cp package.json "$SYSTEM_TEST_DIR/markdown-workflow/"
cp -r dist "$SYSTEM_TEST_DIR/markdown-workflow/" 2>/dev/null || true
cp -r workflows "$SYSTEM_TEST_DIR/markdown-workflow/" 2>/dev/null || true
cp -r test-configs "$SYSTEM_TEST_DIR/markdown-workflow/" 2>/dev/null || true
cp -r scripts "$SYSTEM_TEST_DIR/markdown-workflow/" 2>/dev/null || true

# Create symlink to simulate being in system directory
cp -r . "$SYSTEM_TEST_DIR/markdown-workflow"
log_info "System directory structure created (avoided copying node_modules, .git, etc.)"

log_info "Test environment ready:"
log_info " System dir: $SYSTEM_TEST_DIR/markdown-workflow"
Expand All @@ -113,20 +126,20 @@ test_cli_commands() {
log_info "=== Testing CLI Command Availability ==="

# Test that CLI is built and available
run_test "CLI help command" "node dist/cli/index.js --help" 0 "Usage:"
run_test "CLI help command" "node '$PWD/dist/cli/index.js' --help" 0 "Usage:"
}

# Test CLI commands work correctly
test_cli_functionality() {
log_info "=== Testing Basic CLI Functionality ==="

# Test that CLI commands work from any directory (including system directory)
run_test "Init can run from system directory" \
"cd '$SYSTEM_TEST_DIR/markdown-workflow' && node dist/cli/index.js init" \
# Test that CLI commands work from any directory (using absolute path to CLI)
run_test "Init can run from different directory" \
"cd '$SYSTEM_TEST_DIR' && node '$PWD/dist/cli/index.js' init" \
0 "Project initialized successfully"

# Clean up the init we just created
rm -rf "$SYSTEM_TEST_DIR/markdown-workflow/.markdown-workflow"
rm -rf "$SYSTEM_TEST_DIR/.markdown-workflow"
}

# Test init command functionality
Expand All @@ -151,10 +164,6 @@ test_init_command() {
"test -d '$PROJECT_TEST_DIR/.markdown-workflow/workflows'" \
0

run_test "Collections directory created" \
"test -d '$PROJECT_TEST_DIR/.markdown-workflow/collections'" \
0

# Test init in existing project without force should fail
run_test "Init in existing project should fail" \
"cd '$PROJECT_TEST_DIR' && node '$PWD/dist/cli/index.js' init" \
Expand All @@ -173,11 +182,11 @@ test_project_context_commands() {
# Test commands that should fail outside project
run_test "List outside project should fail" \
"cd '$NON_PROJECT_DIR' && node '$PWD/dist/cli/index.js' list job" \
1 "Project root not found"
1 "Not in a markdown-workflow project"

run_test "Create outside project should fail" \
"cd '$NON_PROJECT_DIR' && node '$PWD/dist/cli/index.js' create job 'Test Company' 'Test Role'" \
1 "Project root not found"
1 "Not in a markdown-workflow project"

# Test commands that should work inside project
run_test "List inside project should work" \
Expand All @@ -192,7 +201,7 @@ test_workflow_operations() {
# Test creating a collection
run_test "Create job collection" \
"cd '$PROJECT_TEST_DIR' && node '$PWD/dist/cli/index.js' create job 'Test Company' 'Software Engineer'" \
0 "Created collection"
0 "Collection created successfully"

# Test listing collections
run_test "List job collections" \
Expand Down Expand Up @@ -246,6 +255,9 @@ main() {
echo "Tests Failed: $TESTS_FAILED"
echo

# Explicit cleanup
cleanup_test_env

if [ "$TESTS_FAILED" -eq 0 ]; then
log_success "All tests passed! 🎉"
exit 0
Expand Down
11 changes: 11 additions & 0 deletions src/core/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,17 @@ export const SystemConfigSchema = z.object({
fontFamily: z.string().optional(),
})
.optional(),
graphviz: z
.object({
output_format: z.enum(['png', 'svg', 'pdf', 'jpeg']),
layout_engine: z.enum(['dot', 'neato', 'fdp', 'sfdp', 'twopi', 'circo']),
timeout: z.number(),
dpi: z.number().optional(),
theme: z.enum(['default', 'dark', 'light']).optional(),
backgroundColor: z.string().optional(),
fontFamily: z.string().optional(),
})
.optional(),
testing: z
.object({
// Date/Time overrides
Expand Down
Loading