Markdown to Telegraph Action

Markdown to Telegraph Action

Cyan Xiao

This README itself is a demo for this action. The Project GitHub Repo is in sync with the Telegraph Page.

md-to-telegraph-action is a GitHub action that automatically converts markdown files in your repository to pages on Telegraph. It is a convenient way to host your documentation on Telegraph without the hassle of setting up a server.

Check it out in Marketplace: Markdown to Telegraph Action

Features

- πŸš€ Converts markdown files to Telegraph pages automatically

- πŸ“ Supports most markdown syntax (headers, bold, italic, links, code blocks, etc.)

- πŸ”— Resolves internal markdown links between files automatically

- πŸ“– Automatically extracts page titles from H1 headers

- πŸ”„ Tracks file changes and only updates modified files

- πŸ“‹ Maintains a mapping file of all created pages

- βš™οΈ Configurable file patterns for inclusion/exclusion

- 🎯 Uses existing Telegraph account or creates a new one

- πŸ”€ One Entry Mode: Automatically updates repository homepage URL with Telegraph URL when only one page is created

- πŸ”„ Page Replacement: Reuse existing Telegraph pages instead of creating new ones (maintains same URLs)

Quick Start

name: Convert Docs to Telegraph

on:
  push:
    branches: [main]
    paths: ["docs/**/*.md"]

jobs:
  convert-to-telegraph:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Cache Telegraph mappings
        uses: actions/cache@v3
        with:
          path: telegraph-pages.json
          key: telegraph-mappings-${{ hashFiles('docs/**/*.md') }}
      - uses: cyanxiao/md-to-telegraph-action@release
        with:
          account-name: "My Docs Site"
          author-name: "Documentation Team"
          include-patterns: "docs/**/*.md"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Documentation

For detailed usage instructions, configuration options, and advanced features, see:

- Usage Guide - Complete configuration examples and input/output reference

- Features - Detailed documentation for One Entry Mode, Page Replacement, and Internal Link Resolution

- Development - Setup, testing, and contribution guidelines

- E2E Markdown Test - Comprehensive Markdown syntax test document showcasing all supported features

Report Page