Skip to content

Commit 4ad2194

Browse files
committed
feat: add VS Code support files to template
1 parent bf4eba4 commit 4ad2194

File tree

12 files changed

+145
-10
lines changed

12 files changed

+145
-10
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ node_modules
2323
# editors
2424
.idea/
2525
.vscode/*
26-
!.vscode/*.sample
26+
!.vscode/*.sample
27+
!.vscode/extensions.json

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.1.1] - 2025-03-11
11+
12+
- feat: add VS Code support files to template
13+
1014
## [0.1.0] - 2025-03-09
1115

1216
Initial release.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ The recommended way to install the Copier is [uv](https://docs.astral.sh/uv/). T
4646
With uv installed, open the terminal and
4747

4848
```
49-
uvx copier copy https://github.com/documatt/sphinx-theme-template my-new-theme
49+
uvx copier copy gh:documatt/sphinx-theme-template my-new-theme
5050
```
5151

52-
Answer the series of questions, and you are ready to go. You have the skeleton of a completely functional Sphinx theme in `my-new-theme` folder in just a few moments.
52+
Answer the series of questions, and you are ready to go. You have the skeleton of a completely functional Sphinx theme in `my-new-theme` folder in just a few moments. Use `.` for the current folder.
5353

5454
## Key Features
5555

40.6 KB
Loading
40.7 KB
Loading

docs/source/quickstart.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,29 @@
66
[Nox]: https://nox.thea.codes/
77
[uv]: https://docs.astral.sh/uv/
88

9-
You will need Python and two Python tools:
9+
For Sphinx and automation, you will need Python and two Python tools:
1010

1111
- [Copier]: scaffolding tool that will generate from this template a Sphinx theme on your disk
1212
- [Nox]: automation tool for easier building docs from project sources
1313

1414
The recommended way to install and run is using the [uv] tool. The uv can even install Python for you if you don't have it already.
1515

16-
1. [**Install uv**](https://docs.astral.sh/uv/getting-started/installation/) for your environment.
16+
You will also need Node.js and npm tool installed. Sphinx themes are basically websites, and this template comes preconfigured for development with [Tailwind CSS](https://tailwindcss.com), a Node.js based tool. Additionally, a few developer tools preconfigured are Node.js based, such as those for formatting and linting.
17+
18+
1. [**Install uv**](https://docs.astral.sh/uv/getting-started/installation/).
1719

1820
```{seealso}
1921
See [Copier docs][Copier] and [Nox docs][Nox] for other installation options if uv is not suitable for you.
2022
```
2123

24+
2. [**Install Node.js and npm**](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm). We recommend you LTS version.
25+
2226
## Tutorial
2327

2428
1. **Answer questions.** Open the terminal, choose a destination folder (use `.` for current), and follow the wizard. E.g.,:
2529

2630
```
27-
uvx copier copy https://github.com/documatt/sphinx-theme-template sphinx-my-theme
31+
uvx copier copy gh:documatt/sphinx-theme-template sphinx-my-theme
2832
```
2933

3034
This command will install and call Copier.
@@ -127,3 +131,19 @@ The recommended way to install and run is using the [uv] tool. The uv can even i
127131
1. **Enjoy.**
128132

129133
% TODO: See all the other cool [features](features.md) provided by the template.
134+
135+
## VS Code setup
136+
137+
The template comes with improvements to the developer experience when local working in VS Code.
138+
139+
1. VS Code prompts you to install the recommended extensions from `.vscode/extensions.json` when opened for the first time.
140+
1. Save `.vscode/settings.json.sample` as `settings.json`.
141+
142+
## Local development
143+
144+
1. At project root run `npm i` to install Node.js tools for formatting and liting.
145+
1. At project root run `uv sync`. This will create virtual environment folder `.venv/`.
146+
147+
In VS Code, virtual environment folder is automatically detected. VS Code asks you to use it. Then it appears in statusbar.
148+
![](_static/vscode-venv-detected.png)
149+
![](_static/vscode-venv-statusbar.png)

template/.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ node_modules
2323

2424
# editors
2525
.idea/
26-
!.vscode/*.sample
27-
.vscode/*
26+
.vscode/*
27+
!.vscode/extensions.json
28+
!.vscode/*.sample

template/.vscode/extensions.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4+
// List of extensions which should be recommended for users of this workspace.
5+
"recommendations": [
6+
// Prettier formatter
7+
"esbenp.prettier-vscode",
8+
9+
// Python ruff formatter and linter
10+
"charliermarsh.ruff",
11+
12+
// Syntax highlighting for Jinja HTML/CSS/JS and other templates
13+
"samuelcolvin.jinjahtml",
14+
15+
// Tailwind CSS IntelliSense
16+
"bradlc.vscode-tailwindcss",
17+
18+
// MyST markdown syntax highlighting
19+
"executablebookproject.myst-highlight",
20+
21+
// Simple RST syntax highlighting
22+
"trond-snekvik.simple-rst"
23+
],
24+
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
25+
"unwantedRecommendations": []
26+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
// Format on save
3+
"editor.formatOnSave": true,
4+
5+
// Format and lint Python with Ruff
6+
"[python]": {
7+
"editor.defaultFormatter": "charliermarsh.ruff",
8+
"editor.codeActionsOnSave": {
9+
// Fix all issues on save
10+
"source.fixAll": "explicit",
11+
// Organize imports on save
12+
"source.organizeImports": "explicit"
13+
}
14+
},
15+
16+
// Format everything else with Prettier
17+
"editor.defaultFormatter": "esbenp.prettier-vscode",
18+
19+
// Pytest support
20+
"python.testing.unittestEnabled": false,
21+
"python.testing.pytestEnabled": true,
22+
"python.testing.pytestArgs": ["-vv", "--color=yes"],
23+
24+
"files.associations": {
25+
"**/src/**/*.html": "jinja-html",
26+
"**/src/**/styles/*.css": "tailwindcss"
27+
}
28+
}

tests/test_bake/defaults/.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ node_modules
2323

2424
# editors
2525
.idea/
26-
!.vscode/*.sample
27-
.vscode/*
26+
.vscode/*
27+
!.vscode/extensions.json
28+
!.vscode/*.sample

0 commit comments

Comments
 (0)