Skip to content

Commit 7291b47

Browse files
committed
docs: enhance README with detailed project description and development setup instructions
1 parent f5e5db9 commit 7291b47

File tree

1 file changed

+118
-51
lines changed

1 file changed

+118
-51
lines changed

README.md

Lines changed: 118 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,93 @@
11
# Tour of JSON Schema
22

3-
This repository contains the code for the Tour of JSON Schema project.
4-
https://tour.json-schema.org
3+
Welcome to the **Tour of JSON Schema** project! This repository hosts the codebase for an interactive learning platform designed to help users understand and master JSON Schema. You can access the live version of the project at [https://tour.json-schema.org](https://tour.json-schema.org).
54

6-
# Development
5+
---
76

8-
The project is built using next.js.
7+
## Table of Contents
98

10-
After cloning the repository, run the following command to install the dependencies:
9+
- [Tour of JSON Schema](#tour-of-json-schema)
10+
- [Table of Contents](#table-of-contents)
11+
- [Development Setup](#development-setup)
12+
- [Prerequisites](#prerequisites)
13+
- [Installation](#installation)
14+
- [Content Creation](#content-creation)
15+
- [Writing MDX](#writing-mdx)
16+
- [VSCode Extensions](#vscode-extensions)
17+
- [File Structure](#file-structure)
18+
- [MDX Components Guide](#mdx-components-guide)
19+
- [GoodToKnowBox](#goodtoknowbox)
20+
- [CodeSnippet](#codesnippet)
21+
- [SideEditorLink](#sideeditorlink)
22+
- [Contributing](#contributing)
1123

12-
```bash
13-
pnpm install
14-
```
24+
---
1525

16-
To start the development server, run the following command:
26+
## Development Setup
1727

18-
```bash
19-
pnpm dev
20-
```
28+
The project is built using **Next.js**, a React framework for building server-rendered applications. Below are the steps to set up your development environment:
2129

22-
> when you run `pnpm dev`, a file named `outline.json` will be created in th `/content` directory. This file is used to generate the table of contents for the website.
30+
### Prerequisites
2331

24-
(make sure you run tests before pushing your changes)
25-
To run the tests, run the following command:
32+
- **Node.js**: Ensure you have Node.js installed (v16 or higher).
33+
- **pnpm**: The project uses `pnpm` as the package manager.
2634

27-
```bash
28-
pnpm test
29-
```
35+
### Installation
3036

37+
1. Clone the repository:
38+
```bash
39+
git clone https://github.com/your-repo/tour-of-json-schema.git
40+
cd tour-of-json-schema
41+
```
3142

32-
# Content
43+
2. Install dependencies:
44+
```bash
45+
pnpm install
46+
```
3347

34-
### Writing MDX
48+
3. Start the development server:
49+
```bash
50+
pnpm dev
51+
```
3552

36-
The content written in [MDX](https://mdxjs.com/), a markdown format that supports JSX syntax. This allows us to embed React components in the docs. See the [GitHub Markdown Guide](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) for a quick overview of markdown syntax.
53+
> **Note**: Running `pnpm dev` will generate a file named `outline.json` in the `/content` directory. This file is used to dynamically generate the table of contents for the website.
3754
38-
### VSCode
55+
4. Run tests before pushing changes:
56+
```bash
57+
pnpm test
58+
```
3959

40-
#### Extensions
60+
---
4161

42-
We recommend the following extensions for VSCode users:
62+
## Content Creation
4363

44-
- [MDX](https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx): Intellisense and syntax highlighting for MDX.
45-
- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode): Format MDX files on save.
64+
The content for the Tour of JSON Schema is written in **MDX**, a markdown format that supports JSX syntax. This allows us to embed React components directly into the documentation, making it highly interactive and engaging.
4665

47-
## File Structure
66+
### Writing MDX
4867

49-
the content of each step is stored in the `/content` directory with the following structure:
68+
MDX combines the simplicity of Markdown with the power of React. Here are some resources to get started:
69+
- [MDX Documentation](https://mdxjs.com/)
70+
- [GitHub Markdown Guide](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax)
5071

51-
```
72+
### VSCode Extensions
73+
74+
For a smoother development experience, we recommend installing the following extensions in Visual Studio Code:
75+
76+
- **MDX**: Provides syntax highlighting and IntelliSense for MDX files.
77+
- Marketplace Link: [MDX Extension](https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx)
78+
- **Prettier**: Automatically formats your MDX files on save.
79+
- Marketplace Link: [Prettier Extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
5280

81+
### File Structure
82+
83+
The content is organized in the `/content` directory with the following structure:
84+
85+
```
5386
├── 01-introduction
54-
│ ├── index.mdx
87+
│ ├── index.mdx # Overview of the section
5588
│ ├── 01-welcome
56-
│ ├── instructions.mdx
57-
│ ├── code.ts
89+
│ ├── instructions.mdx # Instructions for the step
90+
│ ├── code.ts # Template code and validation logic
5891
│ ├── 02-what-is-json-schema
5992
│ ├── instructions.mdx
6093
│ ├── code.ts
@@ -66,54 +99,88 @@ the content of each step is stored in the `/content` directory with the followin
6699
│ ├── 02-arrays
67100
│ ├── instructions.mdx
68101
│ ├── code.ts
69-
70102
```
71103

72-
The instructions.mdx file holds the content the users sees, and the code.ts file holds template code and the logic to validate user provided schemas
104+
- Each section (e.g., `01-introduction`) has an `index.mdx` file that serves as an overview.
105+
- Each step within a section contains:
106+
- `instructions.mdx`: The content displayed to the user.
107+
- `code.ts`: Contains template code and logic to validate user-provided schemas.
108+
109+
---
73110

74111
## MDX Components Guide
75112

76-
### GoodToKnowBox
113+
The project includes custom React components to enhance the interactivity and readability of the content. Below is a guide to the available components:
114+
115+
### GoodToKnowBox
77116

78-
A box that displays a tips or any messages in a box.
117+
A styled box for displaying tips, notes, or additional information.
79118

80119
**Props:**
81-
- `title`: The title of the box (default: "Good to know")
82-
- `children`: The content of the box
120+
- `title` (optional): The title of the box. Defaults to "Good to know".
121+
- `children`: The content of the box.
83122

84123
**Example:**
85124
```md
86-
<GoodToKnowBox title="Tips">
87-
This is a good to know box
125+
<GoodToKnowBox title="Pro Tip">
126+
Use `$ref` to reuse schema definitions and keep your JSON Schema DRY.
88127
</GoodToKnowBox>
89128
```
129+
130+
---
131+
90132
### CodeSnippet
91133

92-
A code block that displays the code with syntax highlighting.
134+
A code block with syntax highlighting and optional line highlighting.
93135

94136
**Props:**
95-
- `highlightLineStart`: The line number to start highlighting
96-
- `highlightLineEnd`: The line number to end highlighting (default: highlight only one line)
97-
- `startingLineNumber`: The starting line number of the code block (default: 1)
98-
- `showLineNumbers`: Whether to show line numbers (default: true)
137+
- `highlightLineStart`: The starting line number to highlight.
138+
- `highlightLineEnd` (optional): The ending line number to highlight. Defaults to `highlightLineStart`.
139+
- `startingLineNumber` (optional): The starting line number for the code block. Defaults to `1`.
140+
- `showLineNumbers` (optional): Whether to display line numbers. Defaults to `true`.
99141

100142
**Example:**
101143
```md
102-
<CodeSnippet highlightLineStart={1} highlightLineEnd={2}>
144+
<CodeSnippet highlightLineStart={3} highlightLineEnd={5}>
103145
{
104-
"name": "John Doe",
146+
"type": "object",
147+
"properties": {
148+
"name": { "type": "string" },
149+
"age": { "type": "integer" }
150+
}
105151
}
106152
</CodeSnippet>
107153
```
154+
155+
---
156+
108157
### SideEditorLink
109158

110159
A link that focuses the editor on the right side of the screen.
111160

112-
**Props:** None
161+
**Props:**
162+
- `text` (optional): Custom text for the link. Defaults to "side editor".
113163

114164
**Example:**
115165
```md
116-
<SideEditorLink />
166+
<SideEditorLink text="Open the editor to try this example" />
117167
```
118-
**Props:**
119-
- `text` (optional): the default text is "side editor". You can pass a custom text to the component.
168+
169+
---
170+
171+
## Contributing
172+
173+
We welcome contributions from the community! If you'd like to contribute, please follow these guidelines:
174+
175+
1. Fork the repository and create a new branch for your changes.
176+
2. Ensure your changes pass all tests by running:
177+
```bash
178+
pnpm test
179+
```
180+
3. Submit a pull request with a detailed description of your changes.
181+
182+
> **Note**: Always run tests before submitting a pull request to ensure your changes do not introduce regressions.
183+
184+
---
185+
186+
Thank you for contributing to the **Tour of JSON Schema** project! Together, we can make JSON Schema more accessible and easier to learn for everyone.

0 commit comments

Comments
 (0)