Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
208 changes: 208 additions & 0 deletions .github/workflows/docs-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
name: Documentation Validation

on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
workflow_dispatch:

jobs:
validate-docs:
name: Check for Errors and Broken Links
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install Mintlify CLI
run: npm install -g mintlify

- name: Check for broken links
id: broken-links
continue-on-error: true
run: |
echo "## 🔍 Broken Links Check" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if mint broken-links 2>&1 | tee broken-links-output.txt; then
echo "✅ No broken links found!" >> $GITHUB_STEP_SUMMARY
else
echo "❌ Broken links detected:" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
cat broken-links-output.txt >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
exit 1
fi

- name: Validate documentation structure
id: validate-structure
continue-on-error: true
run: |
echo "## 📋 Documentation Structure Check" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

# Check if docs.json exists
if [ ! -f "docs.json" ]; then
echo "❌ docs.json not found!" >> $GITHUB_STEP_SUMMARY
exit 1
fi

# Validate JSON syntax
if jq empty docs.json 2>&1; then
echo "✅ docs.json is valid JSON" >> $GITHUB_STEP_SUMMARY
else
echo "❌ docs.json has invalid JSON syntax" >> $GITHUB_STEP_SUMMARY
exit 1
fi

# Check for required fields
if jq -e '.name' docs.json > /dev/null; then
echo "✅ Required 'name' field present" >> $GITHUB_STEP_SUMMARY
else
echo "❌ Missing required 'name' field" >> $GITHUB_STEP_SUMMARY
exit 1
fi

- name: Check for missing MDX files
id: check-mdx
continue-on-error: true
run: |
echo "## 📄 MDX Files Check" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

# Extract all page references from docs.json and check if files exist
missing_files=0

# Find all .mdx references in navigation
jq -r '.. | .pages? // empty | .[] | select(type == "string")' docs.json | while read -r page; do
# Convert page path to file path
file_path="${page}.mdx"

if [ ! -f "$file_path" ] && [ ! -f "${page}.md" ]; then
echo "⚠️ Missing file: $file_path" >> $GITHUB_STEP_SUMMARY
missing_files=$((missing_files + 1))
fi
done

if [ $missing_files -eq 0 ]; then
echo "✅ All referenced MDX files exist" >> $GITHUB_STEP_SUMMARY
else
echo "❌ Found $missing_files missing file(s)" >> $GITHUB_STEP_SUMMARY
exit 1
fi

- name: Check for common MDX syntax errors
id: check-syntax
continue-on-error: true
run: |
echo "## ⚙️ MDX Syntax Check" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

errors=0

# Find all MDX files
find . -name "*.mdx" -o -name "*.md" | while read -r file; do
# Skip node_modules and hidden directories
if [[ "$file" == *"node_modules"* ]] || [[ "$file" == *"/.git/"* ]]; then
continue
fi

# Check for unclosed JSX tags (basic check)
if grep -E '<[A-Z][a-zA-Z]*[^/>]*$' "$file" > /dev/null 2>&1; then
echo "⚠️ Potential unclosed JSX tag in: $file" >> $GITHUB_STEP_SUMMARY
errors=$((errors + 1))
fi
done

if [ $errors -eq 0 ]; then
echo "✅ No obvious syntax errors detected" >> $GITHUB_STEP_SUMMARY
else
echo "⚠️ Found $errors potential syntax issue(s)" >> $GITHUB_STEP_SUMMARY
fi

- name: Final status check
if: always()
run: |
echo "## 🎯 Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

all_passed=true

if [ "${{ steps.broken-links.outcome }}" != "success" ]; then
echo "- ❌ Broken links check failed" >> $GITHUB_STEP_SUMMARY
all_passed=false
else
echo "- ✅ Broken links check passed" >> $GITHUB_STEP_SUMMARY
fi

if [ "${{ steps.validate-structure.outcome }}" != "success" ]; then
echo "- ❌ Structure validation failed" >> $GITHUB_STEP_SUMMARY
all_passed=false
else
echo "- ✅ Structure validation passed" >> $GITHUB_STEP_SUMMARY
fi

if [ "${{ steps.check-mdx.outcome }}" != "success" ]; then
echo "- ❌ MDX files check failed" >> $GITHUB_STEP_SUMMARY
all_passed=false
else
echo "- ✅ MDX files check passed" >> $GITHUB_STEP_SUMMARY
fi

if [ "$all_passed" = false ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "⚠️ Some checks failed. Please review the errors above." >> $GITHUB_STEP_SUMMARY
exit 1
else
echo "" >> $GITHUB_STEP_SUMMARY
echo "🎉 All documentation checks passed successfully!" >> $GITHUB_STEP_SUMMARY
fi

- name: Comment PR with results
if: github.event_name == 'pull_request' && always()
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');

let comment = '## 📚 Documentation Validation Results\n\n';

// Add check results
comment += '### Check Status\n\n';
comment += '| Check | Status |\n';
comment += '|-------|--------|\n';
comment += `| Broken Links | ${'${{ steps.broken-links.outcome }}' === 'success' ? '✅ Passed' : '❌ Failed'} |\n`;
comment += `| Structure | ${'${{ steps.validate-structure.outcome }}' === 'success' ? '✅ Passed' : '❌ Failed'} |\n`;
comment += `| MDX Files | ${'${{ steps.check-mdx.outcome }}' === 'success' ? '✅ Passed' : '❌ Failed'} |\n`;
comment += `| Syntax | ${'${{ steps.check-syntax.outcome }}' === 'success' ? '✅ Passed' : '⚠️ Warnings'} |\n`;

// Add broken links details if available
if (fs.existsSync('broken-links-output.txt')) {
const brokenLinks = fs.readFileSync('broken-links-output.txt', 'utf8');
if (brokenLinks.trim()) {
comment += '\n### Broken Links Details\n\n```\n' + brokenLinks + '\n```\n';
}
}

comment += '\n---\n';
comment += '*This check was performed by the [Documentation Validation](.github/workflows/docs-validation.yml) workflow.*';

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
50 changes: 50 additions & 0 deletions .github/workflows/mintlify-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Mintlify CI Checks

on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

jobs:
mintlify-checks:
name: Run Mintlify CI Checks
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install Mintlify CLI
run: npm install -g mintlify

- name: Run Mintlify validation
run: |
echo "Running Mintlify validation checks..."
mint install || true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to document why you are allowing errors in mint install


# Note: Mintlify Pro/Enterprise plans have automatic CI checks
# This workflow provides additional local validation

echo "✅ Mintlify validation completed"

- name: Check deployment readiness
run: |
echo "Checking if documentation is ready for deployment..."

# Verify docs.json exists
if [ ! -f "docs.json" ]; then
echo "❌ Error: docs.json not found"
exit 1
fi

echo "✅ Documentation structure is valid"
74 changes: 57 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,44 @@
# Mintlify Starter Kit
# Celo Documentation

Use the starter kit to get your docs deployed and ready to customize.
Official documentation for Celo, built with [Mintlify](https://mintlify.com).

Click the green **Use this template** button at the top of this repo to copy the Mintlify starter kit. The starter kit contains examples with
## 🔍 Documentation Validation

- Guide pages
- Navigation
- Customizations
- API reference pages
- Use of popular components
We have automated checks for errors and broken links that run on every push and pull request.

**[Follow the full quickstart guide](https://starter.mintlify.com/quickstart)**
### Quick Validation

## Development
Before committing, run local validation:

Install the [Mintlify CLI](https://www.npmjs.com/package/mint) to preview your documentation changes locally. To install, use the following command:
```bash
# Run all validation checks
./scripts/validate-docs.sh

# Check for broken links using Mintlify CLI
mint broken-links
```
npm i -g mint

### CI/CD Workflows

- ✅ **Broken Links Check** - Automatically scans for broken internal/external links
- ✅ **Structure Validation** - Validates docs.json syntax and structure
- ✅ **MDX File Verification** - Ensures all referenced files exist
- ✅ **Syntax Checking** - Detects common MDX/JSX syntax errors
- ✅ **PR Comments** - Automatically comments on PRs with validation results

See [DOCS_VALIDATION.md](./DOCS_VALIDATION.md) for complete documentation validation guide.

## Development

Install the [Mintlify CLI](https://www.npmjs.com/package/mint) to preview your documentation changes locally:

```bash
npm i -g mintlify
```

Run the following command at the root of your documentation, where your `docs.json` is located:

```
```bash
mint dev
```

Expand All @@ -32,13 +48,37 @@ View your local preview at `http://localhost:3000`.

Install our GitHub app from your [dashboard](https://dashboard.mintlify.com/settings/organization/github-app) to propagate changes from your repo to your deployment. Changes are deployed to production automatically after pushing to the default branch.

**Important:** All PRs must pass validation checks before merging.

## Contributing

1. **Before committing:**
- Run `./scripts/validate-docs.sh` to check for errors
- Test your changes locally with `mint dev`
- Ensure all links work correctly

2. **Creating a PR:**
- Wait for automated checks to complete
- Review any validation warnings or errors
- Fix issues before requesting review

3. **For reviewers:**
- Check that all validation checks pass
- Review any warnings in PR comments
- Verify changes render correctly

## Need help?

### Troubleshooting

- If your dev environment isn't running: Run `mint update` to ensure you have the most recent version of the CLI.
- If a page loads as a 404: Make sure you are running in a folder with a valid `docs.json`.
- **Dev environment not running:** Run `mint update` to ensure you have the most recent version of the CLI
- **Page loads as 404:** Make sure you are running in a folder with a valid `docs.json`
- **Validation fails:** Check [DOCS_VALIDATION.md](./DOCS_VALIDATION.md) for detailed troubleshooting
- **Broken links detected:** Review the validation output and fix referenced files or URLs

### Resources
- [Mintlify documentation](https://mintlify.com/docs)
- [Mintlify community](https://mintlify.com/community)
- [Celo Documentation](https://docs.celo.org)
- [Documentation Validation Guide](./DOCS_VALIDATION.md)
- [Mintlify Documentation](https://mintlify.com/docs)
- [Mintlify Community](https://mintlify.com/community)
- [Celo Discord](https://discord.com/invite/celo)
6 changes: 3 additions & 3 deletions _deprecated/cel2/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ There are multiple options.

### How is the Celo L2 different to Optimism?

See [What's Changed Optimism -> Celo L2](./whats-changed/op-l2).
See [What's Changed Optimism -> Celo L2](/legacy/transition/optimism/op-l2).
Also see [Celo L2 Specification](https://specs.celo.org/root.html) for greater detail.

### What are the costs for L1 data and how are they paid?

See [What's changed section covering L1 fees](/cel2/whats-changed/op-l2#l1-fees).
See [What's changed section covering L1 fees](/legacy/transition/optimism/op-l2#l1-fees).

### What's the block time?

Expand All @@ -94,7 +94,7 @@ The gas limit per block is 30 million, so the maximum throughput is 30M gas/s.

### Is there anything that used to work on Celo L1 that doesn’t anymore on L2?

See [What's Changed Celo L1 -> L2](/cel2/whats-changed/l1-l2.md) and [L1 -> L2 Migration Changes](https://specs.celo.org/l2_migration.html) in the spec for greater detail.
See [What's Changed Celo L1 -> L2](/legacy/transition/whats-changed/l1-l2) and [L1 -> L2 Migration Changes](https://specs.celo.org/l2_migration.html) in the spec for greater detail.

## Testnets

Expand Down
2 changes: 1 addition & 1 deletion _deprecated/integration/listings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ For more specific use-cases for exchanges, please checkout the [Custody and Exch

### Celo Native Asset and Stable Value Currencies

There are key assets on the Celo network, the Celo native asset (CELO) and Celo-powered Stable Value Currencies, such as Celo Dollar (cUSD) and Celo Euro (cEUR). CELO was formerly called Celo Gold (cGLD) when the contract was deployed, so you will often see references to Celo Gold and CGLD in the codebase. To learn more about the two, please read [this](/developer/migrate/from-ethereum#the-celo-native-asset-and-the-celo-dollar) section of the docs.
There are key assets on the Celo network, the Celo native asset (CELO) and Celo-powered Stable Value Currencies, such as Celo Dollar (cUSD) and Celo Euro (cEUR). CELO was formerly called Celo Gold (cGLD) when the contract was deployed, so you will often see references to Celo Gold and CGLD in the codebase. To learn more about the two, please read [this](/tooling/overview/migrate/from-ethereum#the-celo-native-asset-and-the-celo-dollar) section of the docs.

You can also view the forum post about the name change [here](https://forum.celo.org/t/proposal-to-rename-celo-gold-to-celo-native-asset/528).

Expand Down
Loading
Loading