• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
ewired

ewired

RandomWikiPage

Public
Like
RandomWikiPage
Home
Code
3
backend
1
frontend
2
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
5/23/2025
Viewing readonly version of main branch: v10
View latest version
README.md

C2 Wiki Random Page Viewer

A Val Town application that fetches and displays random pages from the C2 Wiki (https://wiki.c2.com) using their FedWiki endpoint and markup renderer.

Features

  • Fetches random pages from C2 Wiki's FedWiki endpoint at https://c2.com/wiki/remodel/pages/
  • Renders wiki markup using the official C2 markup.js module from https://wiki.c2.com/markup.js
  • Clean, responsive interface for reading wiki content with TailwindCSS styling
  • Automatic WikiWord linking (CamelCase words link to their respective C2 Wiki pages)
  • Error handling and loading states
  • Mobile-responsive design

How It Works

  1. Random Page Selection: Fetches the RandomPages list from C2 Wiki's FedWiki endpoint
  2. Page Extraction: Parses the bullet-pointed list to extract individual page names
  3. Random Selection: Picks a random page from the available list
  4. Content Fetching: Retrieves the selected page's content via the FedWiki API
  5. Markup Rendering: Uses C2's official markup.js to convert wiki markup to HTML
  6. Display: Shows the rendered content with proper styling and WikiWord linking

Structure

  • backend/index.ts - Hono server that serves the frontend and provides API endpoints
  • frontend/index.html - Main HTML template with TailwindCSS
  • frontend/app.js - Frontend JavaScript for fetching and displaying content
  • frontend/style.css - Custom styling for wiki content

API Endpoints

  • GET / - Serves the main application
  • GET /api/random - Fetches a random wiki page and returns rendered HTML
  • GET /frontend/* - Serves static frontend assets

Markup Features Supported

The C2 markup.js module converts:

  • '''bold text''' → bold text
  • ''italic text'' → italic text
  • ---- → horizontal rules
  • WikiWords (CamelCase) → automatic links to C2 Wiki pages
  • Line breaks → proper paragraph formatting

Usage

The application automatically loads a random page on startup. Click "Get Random Page" to fetch a new random page from the C2 Wiki collection.

FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.