Skip to content

About

Competitive programmer documenting Codeforces solutions - step by step, with code and diagrams

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

18 Commits

Folders and files

Repository files navigation

LeoYan Solutions ⚑

A beautiful MkDocs-Material site for explaining Codeforces solutions - with runnable code, Mermaid diagrams, tag filters, and a live dashboard.

Live demo: LeoYan Solutions 🌐


✨ Features

Feature How
πŸ“ Markdown with LaTeX MkDocs + MathJax
πŸ“Š Mermaid diagrams pymdownx.superfences
πŸŒ— Dark / Light theme Material palette toggle
🏷️ Tags per problem mkdocs-material tags plugin
πŸ” Tag filter + search Custom JS on home page
πŸ“ˆ Dashboard charts Chart.js (difficulty + topics)
▢️ Run Python in browser Pyodide (WebAssembly)
πŸ”— Try C++ online Opens Wandbox with your code
πŸš€ Auto-deploy GitHub Actions -> GitHub Pages

πŸš€ Quick Start

1 - Fork / clone

git clone https://github.com/PilotLeoYan/leoyan-solutions.git
cd leoyan-solutions

2 - Install dependencies

pip install -r requirements.txt

3 - Update your username

In mkdocs.yml, replace every PilotLeoYan and YOUR_CF_HANDLE:

site_url: https://PilotLeoYan.github.io/leoyan-solutions/
repo_url: https://github.com/PilotLeoYan/leoyan-solutions

4 - Serve locally

mkdocs serve

Open http://127.0.0.1:8000.


πŸ“„ Adding a Problem

  1. Copy the template:

    cp docs/problems/_template.md docs/problems/999X-my-problem.md
  2. Edit the YAML frontmatter:

    ---
    title: "999X – My Problem"
    problem_id: "999X"
    problem_url: "https://codeforces.com/problemset/problem/999/X"
    difficulty: 1400
    date_solved: "2025-01-01"
    tags:
      - binary search
      - greedy
    ---
  3. Write your explanation using any of:

    • === "Python" / === "C++17" tabbed code blocks
    • ```mermaid diagrams
    • !!! note "Complexity Analysis" admonitions
    • $O(n \log n)$ inline LaTeX
  4. Add it to the nav section in mkdocs.yml.

  5. Push:

    git add docs/problems/999X-my-problem.md mkdocs.yml
    git commit -m "feat: add 999X My Problem"
    git push

GitHub Actions auto-builds and deploys in ~60 seconds.


πŸ—‚οΈ Project Structure

leoyan-solutions/
β”œβ”€β”€ .github/workflows/
β”‚   └── deploy.yml          # CI/CD -> GitHub Pages
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ overrides/
β”‚   β”‚   └── home.html       # Custom home page template
β”‚   β”œβ”€β”€ problems/
β”‚   β”‚   β”œβ”€β”€ _template.md    # Copy this for new problems
β”‚   β”‚   β”œβ”€β”€ 4A-watermelon.md
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ data/
β”‚   β”‚   └── problems.json   # Auto-generated by MkDocs hook
β”‚   β”œβ”€β”€ javascripts/
β”‚   β”‚   β”œβ”€β”€ extra.js        # Home dashboard (charts, filter)
β”‚   β”‚   └── code-runner.js  # Pyodide + Wandbox buttons
β”‚   β”‚   └── mathjax.js      # Render LaTeX
β”‚   β”œβ”€β”€ stylesheets/
β”‚   β”‚   └── extra.css       # Custom styles
β”‚   β”œβ”€β”€ index.md            # Home page (uses home.html)
β”‚   └── about.md
β”œβ”€β”€ scripts/
β”‚   └── generate_data.py    # MkDocs hook: builds problems.json
β”œβ”€β”€ mkdocs.yml
β”œβ”€β”€ requirements.txt
└── README.md

πŸ”§ GitHub Pages Setup

  1. Push to main.
  2. GitHub Actions runs and pushes to the gh-pages branch.
  3. In your repo -> Settings -> Pages, set source to gh-pages branch.

🎨 Themes

Switch between light and dark with the sun/moon toggle in the top-right.

To add more colour schemes, edit the palette section in mkdocs.yml:

palette:
  - scheme: default   # light
    primary: deep-purple
    accent: cyan
  - scheme: slate     # dark
    primary: deep-purple
    accent: cyan

πŸ“œ License

MIT - do whatever you like with it.

About

Competitive programmer documenting Codeforces solutions - step by step, with code and diagrams

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages