FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
ewired
ewiredRandomWikiPage
Public
Like
RandomWikiPage
Home
Code
3
backend
1
frontend
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 miliseconds.
Sign up now
Code
/
Code
/
Search
README.md

C2 Wiki Random Page Viewer

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

Features

  • Server-side rendering of random C2 Wiki pages
  • Uses 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 with TailwindCSS styling
  • Automatic WikiWord linking (CamelCase words link to their respective C2 Wiki pages)
  • Simple refresh-to-get-new-page functionality

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. Server-Side Rendering: Generates complete HTML page with embedded content

Structure

  • backend/index.ts - Single Hono server that fetches wiki content and serves complete HTML pages

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

Simply visit the page to see a random C2 Wiki page. Click "Get Another Random Page" or refresh to see a different random page.

Code
backendfrontendREADME.md
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.