Skip to content

Commit ec1ec33

Browse files
committed
Add documentations
1 parent 83abc3c commit ec1ec33

File tree

15 files changed

+2459
-15
lines changed

15 files changed

+2459
-15
lines changed

.github/pages.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Configuration for GitHub Pages deployment
2+
# This file helps ensure proper deployment of MkDocs documentation
3+
4+
# Static site generator
5+
# This is automatically detected by GitHub Pages for MkDocs
6+
# No additional configuration needed as the workflow handles deployment
7+
8+
# Documentation deployment notes:
9+
# - The documentation is built and deployed via GitHub Actions
10+
# - Source files are in the docs/ directory
11+
# - Built files are served from the GitHub Pages artifact
12+
# - Available languages: English (en) and Chinese (zh)
13+
# - Default language: English
14+
15+
# Access the documentation at:
16+
# https://[username].github.io/libCacheSim-python/

.github/workflows/build.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Test libCacheSim-python
1+
name: Build
22

33
on: [push, pull_request]
44

@@ -35,4 +35,31 @@ jobs:
3535
3636
- name: Run tests
3737
run: |
38-
python -m pytest tests/
38+
python -m pytest tests/
39+
40+
docs:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Set up Python
46+
uses: actions/setup-python@v4
47+
with:
48+
python-version: "3.x"
49+
50+
- name: Cache dependencies
51+
uses: actions/cache@v3
52+
with:
53+
path: ~/.cache/pip
54+
key: ${{ runner.os }}-pip-docs-${{ hashFiles('docs/requirements.txt') }}
55+
restore-keys: |
56+
${{ runner.os }}-pip-docs-
57+
58+
- name: Install documentation dependencies
59+
run: |
60+
pip install -r docs/requirements.txt
61+
62+
- name: Test documentation build
63+
run: |
64+
cd docs
65+
mkdocs build --clean --strict

.github/workflows/docs.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Deploy MkDocs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
paths:
9+
- 'docs/**'
10+
- '.github/workflows/docs.yml'
11+
pull_request:
12+
branches:
13+
- main
14+
- master
15+
paths:
16+
- 'docs/**'
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: read
21+
pages: write
22+
id-token: write
23+
24+
concurrency:
25+
group: "pages"
26+
cancel-in-progress: false
27+
28+
jobs:
29+
build:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0
36+
37+
- name: Setup Python
38+
uses: actions/setup-python@v4
39+
with:
40+
python-version: '3.x'
41+
42+
- name: Cache dependencies
43+
uses: actions/cache@v3
44+
with:
45+
path: ~/.cache/pip
46+
key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }}
47+
restore-keys: |
48+
${{ runner.os }}-pip-
49+
50+
- name: Install dependencies
51+
run: |
52+
pip install -r docs/requirements.txt
53+
54+
- name: Build documentation
55+
run: |
56+
cd docs
57+
mkdocs build --clean --strict
58+
59+
- name: Setup Pages
60+
if: github.event_name != 'pull_request'
61+
uses: actions/configure-pages@v3
62+
63+
- name: Upload artifact
64+
if: github.event_name != 'pull_request'
65+
uses: actions/upload-pages-artifact@v2
66+
with:
67+
path: docs/site
68+
69+
deploy:
70+
if: github.event_name != 'pull_request'
71+
environment:
72+
name: github-pages
73+
url: ${{ steps.deployment.outputs.page_url }}
74+
runs-on: ubuntu-latest
75+
needs: build
76+
steps:
77+
- name: Deploy to GitHub Pages
78+
id: deployment
79+
uses: actions/deploy-pages@v2

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# libCacheSim Python Binding
22

33
[![Build](https://github.com/cacheMon/libCacheSim-python/actions/workflows/build.yml/badge.svg)](https://github.com/cacheMon/libCacheSim-python/actions/workflows/build.yml)
4-
[![Python Versions](https://img.shields.io/pypi/pyversions/libcachesim.svg?logo=python&logoColor=white)](https://pypi.org/project/libcachesim)
5-
[![PyPI Version](https://img.shields.io/pypi/v/libcachesim.svg?)](https://pypi.org/project/libcachesim)
6-
[![PyPI - Downloads](https://img.shields.io/pypi/dd/libcachesim)](https://pypistats.org/packages/libcachesim)
4+
[![Documentation](https://github.com/cacheMon/libCacheSim-python/actions/workflows/docs.yml/badge.svg)](https://github.com/cacheMon/libCacheSim-python/actions/workflows/docs.yml)
75

86
Python bindings for [libCacheSim](https://github.com/1a1a11a/libCacheSim), a high-performance cache simulator and analysis library.
97

8+
## 📚 Documentation
9+
10+
- **[English Documentation](https://cacheMon.github.io/libCacheSim-python/en/)** - Complete API reference, tutorials, and examples
11+
- **[中文文档](https://cacheMon.github.io/libCacheSim-python/zh/)** - 完整的API参考、教程和示例
12+
1013
## Installation
1114

1215
Binary installers for the latest released version are available at the [Python Package Index (PyPI)](https://pypi.org/project/libcachesim).
@@ -29,6 +32,16 @@ Run all tests to ensure the package works.
2932
python -m pytest tests/
3033
```
3134

35+
## 🚀 Features
36+
37+
- **High-Performance Cache Simulation**: Built on the proven libCacheSim C++ library
38+
- **Multiple Cache Algorithms**: LRU, LFU, FIFO, ARC, S3FIFO, Sieve, TinyLFU, and more
39+
- **Trace Processing**: Support for various trace formats (CSV, binary, Oracle, etc.)
40+
- **Synthetic Workload Generation**: Zipf, uniform, and custom distributions
41+
- **Trace Analysis**: Comprehensive workload analysis and visualization tools
42+
- **Custom Cache Policies**: Implement new algorithms using Python hooks
43+
- **Multi-language Documentation**: English and Chinese documentation with examples
44+
3245
## Quick Start
3346

3447
### Basic Usage

docs/mkdocs.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ plugins:
5656
fallback_to_default: true
5757
reconfigure_material: true
5858
reconfigure_search: true
59-
default_language_only: false
6059
languages:
6160
- locale: en
6261
default: true
@@ -70,14 +69,6 @@ plugins:
7069
Quick Start: 快速开始
7170
API Reference: API参考
7271
Examples: 使用示例
73-
- mkdocstrings:
74-
handlers:
75-
python:
76-
paths: [../src]
77-
options:
78-
docstring_style: google
79-
show_source: true
80-
show_root_heading: true
8172

8273
markdown_extensions:
8374
- admonition

docs/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
mkdocs-material>=9.6.5
2-
mkdocstrings-python>=1.16.2
32
mkdocs-static-i18n>=1.2.0

0 commit comments

Comments
 (0)