Skip to content

Commit 3a2fe5b

Browse files
author
Carlos
committed
Refactor code structure for improved readability and maintainability
1 parent b359877 commit 3a2fe5b

File tree

9 files changed

+722
-4
lines changed

9 files changed

+722
-4
lines changed

.vscode/settings.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"aiter",
1616
"aitersync",
1717
"Anyconfig",
18+
"arcname",
1819
"Arham",
1920
"asctime",
2021
"asenov",
@@ -30,14 +31,17 @@
3031
"chdir",
3132
"classinfo",
3233
"classmethod",
34+
"configparser",
3335
"contextlib",
3436
"contextmanager",
37+
"copyfileobj",
3538
"copytree",
3639
"damiankrolik",
3740
"darkpixlz",
3841
"dataclass",
3942
"Dbfilename",
4043
"deepcopy",
44+
"defaultdict",
4145
"delatrr",
4246
"delattr",
4347
"Distutils",
@@ -51,12 +55,14 @@
5155
"esmo",
5256
"esno",
5357
"extractall",
58+
"fdst",
5459
"fillvalue",
5560
"filterfalse",
5661
"findall",
5762
"firdousmurtaza",
5863
"flymemory",
5964
"frozenset",
65+
"fsrc",
6066
"functools",
6167
"Gaurav",
6268
"getattr",
@@ -72,7 +78,9 @@
7278
"gtag",
7379
"hasattr",
7480
"hashable",
81+
"hashlib",
7582
"Hasnat",
83+
"hexdigest",
7684
"Hridoy",
7785
"IGNORECASE",
7886
"imag",
@@ -126,6 +134,7 @@
126134
"pathe",
127135
"pathlib",
128136
"pathobj",
137+
"pbar",
129138
"pipenv",
130139
"Pipfile",
131140
"popitem",
@@ -135,13 +144,15 @@
135144
"prereleases",
136145
"prismjs",
137146
"projs",
147+
"pycache",
138148
"pydoc",
139149
"Pylint",
140150
"Pypi",
141151
"pyproject",
142152
"pyshell",
143153
"pythoncheatsheet",
144154
"Pythonista",
155+
"pyyaml",
145156
"qkniep",
146157
"randint",
147158
"randrange",
@@ -151,6 +162,7 @@
151162
"relpath",
152163
"repr",
153164
"rgba",
165+
"rglob",
154166
"richjohnsonxyz",
155167
"rjust",
156168
"rmtree",
@@ -178,9 +190,11 @@
178190
"timedelta",
179191
"timeit",
180192
"tomfun",
193+
"tqdm",
181194
"Traceback",
182195
"udiskie",
183196
"unhashable",
197+
"urandom",
184198
"useb",
185199
"vendorizing",
186200
"venv",

GEMINI.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,30 @@ This project is a Python cheatsheet website built with Vue.js and Vite. The cont
2626
* Pages are located in `src/pages`.
2727
* Content is in Markdown files in the `docs/` directory.
2828

29+
## Routing & Layout System
30+
31+
- Uses `vite-plugin-pages` for file-based routing with multiple layouts:
32+
- `default.vue`: Main layout with sidebar + TOC
33+
- `article.vue`: Blog post layout
34+
- `fullPage.vue`: Full-width pages
35+
- `blog.vue`: Blog index layout
36+
- Route metadata defined in `<route lang="yaml">` blocks
37+
- Navigation structure centralized in `src/store/navigation.ts`
38+
39+
## Content Rendering
40+
41+
- Markdown files auto-converted to Vue components via `unplugin-vue-markdown`
42+
- Prism.js for syntax highlighting with custom theme
43+
- Custom Vue components available in markdown (e.g., `<base-title>`, `<base-disclaimer>`)
44+
- Automatic TOC generation from headings using `markdown-it-anchor`
45+
46+
## Key Features Implementation
47+
48+
- **Reader Mode**: Full-screen reading with font size controls (`src/store/reader.ts`)
49+
- **Dark Mode**: Theme toggle with system preference detection
50+
- **Search**: Algolia DocSearch integration (`src/components/AlgoliaDocSearch.vue`)
51+
- **Contributors**: Auto-fetched from GitHub API (`scripts/fetch-contributors.ts`)
52+
2953
## Available Scripts
3054

3155
The following scripts are available in `package.json`:
@@ -37,3 +61,71 @@ The following scripts are available in `package.json`:
3761
* `pnpm lint`: Lints the code with ESLint.
3862
* `pnpm typecheck`: Runs a type check with `vue-tsc`.
3963
* `pnpm fetch-contributors`: Fetches the contributors from GitHub.
64+
65+
66+
## Content Creation Patterns
67+
68+
**New Cheatsheet Page:**
69+
70+
```markdown
71+
---
72+
title: Topic Name - Python Cheatsheet
73+
description: Brief description of the topic
74+
---
75+
76+
<base-title :title="frontmatter.title" :description="frontmatter.description">
77+
Topic Name
78+
</base-title>
79+
80+
<!-- Content with proper heading structure -->
81+
```
82+
83+
**New Blog Post:**
84+
85+
```markdown
86+
---
87+
title: Post Title - Python Cheatsheet
88+
description: Post description
89+
date: MMM DD, YYYY
90+
updated: MMM DD, YYYY
91+
tags: python, topic, level
92+
socialImage: /blog/image.jpg
93+
---
94+
95+
<route lang="yaml">
96+
meta:
97+
layout: article
98+
# duplicate frontmatter here
99+
</route>
100+
101+
<blog-title-header :frontmatter="frontmatter" title="Display Title" />
102+
```
103+
104+
## Navigation Updates
105+
106+
- Add new routes to `src/store/navigation.ts` in appropriate section
107+
- Use `updated: true` flag for highlighting new content
108+
- Internal links use `<router-link>` for SPA navigation
109+
110+
## Project-Specific Conventions
111+
112+
### Component Organization
113+
114+
- **UI Components**: `src/components/ui/` - reusable base components
115+
- **Layout Components**: `src/components/layout/` - navigation, sidebars, footers
116+
- **Icons**: `src/components/icons/` - SVG icon components
117+
- **Auto-imports**: Components auto-registered via `unplugin-vue-components`
118+
119+
## State Management
120+
121+
- **Pinia stores** for global state (navigation, reader mode, newsletter)
122+
- **VueUse composables** for reactive utilities
123+
- **Auto-imports** for composables and Vue APIs
124+
125+
## Content Guidelines
126+
127+
- Use consistent frontmatter structure across similar content types
128+
- Link internally with `<router-link>` for better SPA experience
129+
- Include code examples in fenced blocks for proper syntax highlighting
130+
- Add social images for blog posts to improve sharing
131+
- Update navigation store when adding new major sections

0 commit comments

Comments
 (0)