8000 GitHub - hvishwanath/ak2md · GitHub
[go: up one dir, main page]

Skip to content
hvishwanathPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

About

This repo contains automation and helper scripts to convert AK documentation from raw html source code to markdown.

How does it work?

AK documentation currently is stored in version control as raw html, css and js files. It makes use of specific httpd features such as "Server Side Includes" and Handlebars JS to render templated html content.

To host this is a markdown based site, we will employ Hugo a static site generator from markdown, and docsy theme for structuring and styling the site.

Automated End-to-End Workflow

The project now includes a fully automated, end-to-end workflow system that handles the entire conversion process from cloning the Kafka site repository to generating the final markdown structure for Hugo.

Workflow Architecture

The workflow is broken down into composable, idempotent stages:

  1. Clone Stage - Clones/updates the Kafka website repository
  2. Pre-processing Stage - Converts raw HTML to intermediate markdown
  3. Post-processing Stage - Restructures markdown for better organization
  4. Validation Stage - Verifies the output meets expectations

Each stage is further broken down into individual steps that can be customized, reordered, or selectively applied.

Using the Workflow

# Basic usage
python main.py --workspace ./my_workspace

# Start from a specific stage
python main.py --workspace ./my_workspace --start-stage pre-process

# Enable debug logging
python main.py --workspace ./my_workspace --debug

# Skip validation stage
python main.py --workspace ./my_workspace --skip-validation

Workflow Components

  • main.py - Main entry point and workflow orchestration
  • workflow_steps.py - Fine-grained steps and processors for each stage
  • process.yaml - Configuration for document sections and processing rules

Features

  • Composable - Each stage and step can run independently
  • Idempotent - Safe to run multiple times
  • Debuggable - Detailed logging and clear error messages
  • Configurable - Easy to customize through process.yaml
  • Extensible - New steps can be easily added to the registry

Special File Processors

The workflow includes specialized processors for handling unique files:

  • committers.md - Extracts committer information and generates data/committers.json
  • powered-by.html - Extracts testimonials from the Powered By page and generates data/testimonials.json

These special processors can be run with:

python main.py --workspace ./my_workspace --start-stage special-files

Static Content Handling