Menu

Overview

Relevant source files

This document provides a high-level overview of the github-wiki-to-html system, explaining its purpose, architecture, and core components. It covers the conversion pipeline from GitHub Wiki markdown to static HTML, the technology stack, and how the various system components interact.

For detailed setup instructions, see Getting Started. For in-depth architectural details, see Architecture. For component-specific documentation, refer to Ruby Components and Node.js Components.

Sources: README.md1-6 constants.rb1-69 .gitmodules1-7

Purpose

The github-wiki-to-html system converts GitHub Wiki repositories into self-hosted static HTML websites. It transforms wiki content authored in GitHub Flavored Markdown (GFM) into a complete static site with SEO optimization, structured metadata, and professional formatting.

The system is designed for users who want to:

  • Maintain content in GitHub Wiki's collaborative editing environment
  • Deploy the same content as a standalone, self-hosted website
  • Preserve Git history as publication metadata (dates, authors)
  • Apply custom branding and styling to wiki content
  • Generate SEO-optimized HTML with sitemaps and structured data

Sources: README.md1-6 constants.rb31-68

System Architecture

The system operates as a multi-stage transformation pipeline that reads wiki content from a Git submodule, processes it through Ruby and Node.js tools, and outputs a complete static site to another Git submodule.

High-Level Component Architecture

Diagram: Core System Components

The architecture consists of three layers:

LayerComponentsPurpose
Inputsource-wiki/ submoduleCloned GitHub Wiki content
ProcessingRuby scripts (github-wiki-to-html.rb, methods.rb, constants.rb, gollum-config.rb)Content transformation and HTML generation
Post-Processingjs-beautify via Node.jsHTML/XML formatting
Outputtarget-site/ submoduleGenerated static site for deployment
Orchestrationgithub-wiki-to-html.shCoordinates Ruby and Node.js execution

Sources: .gitmodules1-7 constants.rb10-29 README.md1-6

Technology Stack

The system integrates multiple technologies into a cohesive pipeline:

Diagram: Technology Stack Dependencies

Sources: Gemfile Gemfile.lock package.json package-lock.json

Repository Structure

The project uses Git submodules to separate source content, build logic, and published output:

PathTypePurposeRepository
source-wiki/Git submodule (HTTPS)Input: GitHub Wiki markdown fileswikinder/wikinder.wiki
target-site/Git submodule (SSH)Output: Generated static sitewikinder/wikinder.github.io
Root directoryMain repositoryBuild logic and configurationwikinder/github-wiki-to-html

Sources: .gitmodules1-7 constants.rb10-26

Data Flow Pipeline

The conversion process follows a linear pipeline with distinct stages:

Diagram: End-to-End Data Flow with Code Entity Names

This diagram maps the conceptual stages to actual code entities:

StageCode EntityLocation
Initialize WikiGollum::Wiki.newgithub-wiki-to-html.rb
Iterate Pageswiki.pagesgithub-wiki-to-html.rb
Parse MarkdownCommonmarker.to_htmlgithub-wiki-to-html.rb
Post-processpostprocess_htmlmethods.rb
Render TemplateLiquid::Template.parsegithub-wiki-to-html.rb
Generate Homegenerate_html_filemethods.rb
Generate Sitemapgenerate_sitemap_filemethods.rb

Sources: github-wiki-to-html.rb methods.rb gollum-config.rb

Core Components

Ruby Processing Layer

The Ruby layer handles all content transformation and HTML generation:

ComponentFilePurpose
Main Orchestratorgithub-wiki-to-html.rbCoordinates the entire conversion process
Configurationconstants.rbSite URLs, paths, branding, asset locations
Engine Configgollum-config.rbGollum and Commonmarker settings
HTML Utilitiesmethods.rbFunctions for HTML generation, sitemap, post-processing
Page Templatetemplate.html.liquidHTML structure with Liquid variables

Sources: github-wiki-to-html.rb constants.rb1-69 gollum-config.rb methods.rb template.html.liquid

Configuration System

The system configuration is distributed across multiple files:

Diagram: Configuration System Structure

Sources: constants.rb1-69 gollum-config.rb .jsbeautifyrc

Key Constants Defined in constants.rb

ConstantValue/PurposeLine Reference
WIKI_REPOPathname('source-wiki')constants.rb10
OUTPUT_DIRECTORYPathname('target-site')constants.rb26
SITE_NAME'Wikinder'constants.rb32
SITE_URLURI('https://wikinder.org')constants.rb37
HOME_URLPathname('/')constants.rb56
HTML_TEMPLATE_FILEPathname('template.html.liquid')constants.rb29
STYLESHEET_URL'/assets/css/style.css'constants.rb62
LICENSE_URL'https://creativecommons.org/licenses/by-sa/4.0/'constants.rb59

Sources: constants.rb10-68

Processing Pipeline Details

Page Metadata Extraction

Each wiki page's Git history is analyzed to extract publication metadata:

Diagram: Git History Metadata Extraction

The system extracts:

  • Publication date: Timestamp of the first commit (versions.last)
  • Modification date: Timestamp of the most recent commit (versions.first)
  • Author: Committer name from the first commit

Sources: github-wiki-to-html.rb

HTML Post-Processing

The postprocess_html function in methods.rb performs link normalization:

TransformationPurpose
Strip .md extensionsConvert wiki-style links to web-friendly URLs
Adjust internal linksEnsure proper routing within the static site
Preserve external linksLeave absolute URLs unchanged

Sources: methods.rb

Submodule Workflow

The system uses Git submodules to maintain separation between source and output:

Diagram: Submodule Data Flow

The workflow pattern:

  1. Update: git submodule update --remote source-wiki pulls latest wiki content
  2. Convert: ./github-wiki-to-html.sh generates static site
  3. Deploy: Commit and push target-site/ to trigger GitHub Pages deployment

Sources: .gitmodules1-7 github-wiki-to-html.sh

Execution Entry Points

The system provides two execution methods:

MethodEntry PointUse Case
Shell Script./github-wiki-to-html.shManual execution, direct system access
Dockerdocker build + docker runIsolated environment, CI/CD integration

Both methods execute the same Ruby processing followed by Node.js beautification.

Sources: github-wiki-to-html.sh Dockerfile

Output Structure

The generated static site in target-site/ has the following structure:

target-site/
├── index.html              # Home page with article listing
├── [page-slug].html        # Individual article pages
├── sitemap.xml             # SEO sitemap
└── assets/                 # CSS, JavaScript, images (external)

Each HTML file includes:

  • Complete HTML5 document structure
  • SEO metadata (Open Graph, Schema.org)
  • Responsive navigation
  • Article content with syntax highlighting
  • Footer with copyright and license information

Sources: github-wiki-to-html.rb methods.rb template.html.liquid

Next Steps