Skip to content

Commit a51df96

Browse files
committed
Cleanup for publishing
1 parent e2cda3c commit a51df96

16 files changed

Lines changed: 1042 additions & 6 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
24+
- name: Setup Node
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: '16'
28+
cache: 'npm'
29+
30+
- name: Setup Pages
31+
uses: actions/configure-pages@v3
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Build package
37+
run: npm run build
38+
39+
- name: Build example
40+
run: |
41+
cd example/github-pages-example
42+
npm ci
43+
npm run build
44+
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v1
47+
with:
48+
path: './example/github-pages-example/dist'
49+
50+
deploy:
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
runs-on: ubuntu-latest
55+
needs: build
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v2

CONTRIBUTING.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Contributing to CodeMirror 6 LaTeX Language Support
2+
3+
Thank you for your interest in contributing to this project! This document provides guidelines and instructions for contributing.
4+
5+
## Development Setup
6+
7+
1. Clone the repository:
8+
```
9+
git clone https://github.com/texlyre/codemirror-lang-latex.git
10+
cd codemirror-lang-latex
11+
```
12+
13+
2. Install dependencies:
14+
```
15+
npm install
16+
```
17+
18+
3. Build the project:
19+
```
20+
npm run build
21+
```
22+
23+
4. Run the webpack example:
24+
```
25+
npm run setup-example
26+
npm run example
27+
```
28+
29+
5. Run the GitHub Pages example:
30+
```
31+
npm run setup-pages-example
32+
npm run pages-example
33+
```
34+
35+
## Project Structure
36+
37+
- `grammar/` - Contains the LaTeX grammar files used to generate the parser
38+
- `src/` - Source code for the CodeMirror extension
39+
- `example/` - Contains example applications showing the extension in use
40+
- `scripts/` - Utility scripts for building and generating files
41+
- `dist/` - Build output (generated)
42+
43+
## Making Changes
44+
45+
1. Create a new branch for your changes:
46+
```
47+
git checkout -b feature/your-feature-name
48+
```
49+
50+
2. Make your changes to the codebase.
51+
52+
3. Build the project to ensure your changes compile:
53+
```
54+
npm run build
55+
```
56+
57+
4. Test your changes using the example application:
58+
```
59+
npm run example
60+
```
61+
62+
5. Commit your changes with a clear and descriptive commit message.
63+
64+
6. Push your branch to your fork:
65+
```
66+
git push origin feature/your-feature-name
67+
```
68+
69+
7. Create a pull request to the main repository.
70+
71+
## Coding Guidelines
72+
73+
- Follow the existing code style in the project
74+
- Write clear, documented code
75+
- Add comments for complex functionality
76+
- Update documentation when necessary
77+
78+
## Pull Request Process
79+
80+
1. Ensure your code builds without errors
81+
2. Update the README.md with details of changes if appropriate
82+
3. Your pull request will be reviewed by the maintainers
83+
4. Address any requested changes
84+
85+
## License
86+
87+
By contributing to this project, you agree that your contributions will be licensed under the project's [MIT License](LICENSE).

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,11 @@ npm install
222222
npm run build
223223
```
224224

225-
## Example
226-
You can find a live example of the LaTeX editor in action at [https://texlyre.github.io/codemirror-lang-latex/](https://texlyre.github.io/codemirror-lang-latex/).
225+
## Examples
227226

228-
To run the example locally (as a webpack bundle), clone the repository and run:
227+
### Regular Example
228+
229+
To run the webpack-bundled example locally, clone the repository and run:
229230

230231
```bash
231232
npm install
@@ -235,7 +236,14 @@ npm run example
235236

236237
Then open `http://localhost:3000` in your browser.
237238

239+
### GitHub Pages Example
240+
241+
To run the GitHub Pages example locally, which is also deployed to the demo site:
238242

239-
## License
243+
```bash
244+
npm install
245+
npm run setup-pages-example
246+
npm run pages-example
247+
```
240248

241-
[MIT](LICENSE)
249+
This will also run on `http://localhost:3000` in your browser.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
dist/
3+
.DS_Store
4+
*.log
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# GitHub Pages Demo for CodeMirror LaTeX Extension
2+
3+
This directory contains a demo of the CodeMirror LaTeX extension that is configured to work with GitHub Pages. It serves as the main website for the project at https://texlyre.github.io/codemirror-lang-latex/.
4+
5+
## Development
6+
7+
To run this demo locally:
8+
9+
```bash
10+
# From the project root
11+
npm run setup-pages-example
12+
npm run pages-example
13+
```
14+
15+
Or from this directory:
16+
17+
```bash
18+
npm install
19+
npm start
20+
```
21+
22+
## Build
23+
24+
To build the static site:
25+
26+
```bash
27+
npm run build
28+
```
29+
30+
The built files will be in the `dist` directory.
31+
32+
## Deployment
33+
34+
The site is automatically deployed to GitHub Pages when changes are pushed to the main branch through the GitHub Actions workflow defined in `.github/workflows/deploy.yml`.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "latex-extension-demo-pages",
3+
"version": "0.1.0",
4+
"description": "GitHub Pages Demo for CodeMirror LaTeX extension",
5+
"private": true,
6+
"scripts": {
7+
"build": "webpack --mode production",
8+
"start": "webpack serve --mode development"
9+
},
10+
"dependencies": {
11+
"@codemirror/autocomplete": "^6.0.0",
12+
"@codemirror/commands": "^6.0.0",
13+
"@codemirror/language": "^6.0.0",
14+
"@codemirror/lint": "^6.0.0",
15+
"@codemirror/state": "^6.0.0",
16+
"@codemirror/view": "^6.0.0",
17+
"@codemirror/search": "^6.0.0"
18+
},
19+
"devDependencies": {
20+
"copy-webpack-plugin": "^11.0.0",
21+
"css-loader": "^6.5.1",
22+
"html-webpack-plugin": "^5.5.0",
23+
"style-loader": "^3.3.1",
24+
"webpack": "^5.65.0",
25+
"webpack-cli": "^4.9.1",
26+
"webpack-dev-server": "^4.7.2"
27+
}
28+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2018",
4+
"module": "esnext",
5+
"moduleResolution": "node",
6+
"baseUrl": ".",
7+
"paths": {
8+
"codemirror-lang-latex": ["../../dist"]
9+
},
10+
"checkJs": true,
11+
"resolveJsonModule": true,
12+
"esModuleInterop": true
13+
},
14+
"include": ["src/**/*"],
15+
"exclude": ["node_modules", "dist"]
16+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "latex-extension-demo-pages",
3+
"version": "0.1.0",
4+
"description": "GitHub Pages Demo for CodeMirror LaTeX extension",
5+
"author": "Fares Abawi",
6+
"license": "MIT",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/texlyre/codemirror-lang-latex.git"
10+
},
11+
"homepage": "https://texlyre.github.io/codemirror-lang-latex/",
12+
"private": true,
13+
"scripts": {
14+
"build": "webpack --mode production",
15+
"start": "webpack serve --mode development"
16+
},
17+
"dependencies": {
18+
"@codemirror/autocomplete": "^6.0.0",
19+
"@codemirror/commands": "^6.0.0",
20+
"@codemirror/language": "^6.0.0",
21+
"@codemirror/lint": "^6.0.0",
22+
"@codemirror/state": "^6.0.0",
23+
"@codemirror/view": "^6.0.0",
24+
"@codemirror/search": "^6.0.0"
25+
},
26+
"devDependencies": {
27+
"copy-webpack-plugin": "^11.0.0",
28+
"css-loader": "^6.5.1",
29+
"html-webpack-plugin": "^5.5.0",
30+
"style-loader": "^3.3.1",
31+
"webpack": "^5.65.0",
32+
"webpack-cli": "^4.9.1",
33+
"webpack-dev-server": "^4.7.2"
34+
}
35+
}

0 commit comments

Comments
 (0)