Skip to content

Commit 10e20f3

Browse files
Merge pull request #238 from daltonmenezes/feat/npp-port
feat: notepad++ port
2 parents 6e4f659 + 879c377 commit 10e20f3

File tree

9 files changed

+2038
-0
lines changed

9 files changed

+2038
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,15 @@
109109
<span>Zed</span>
110110
</p>
111111
</td>
112+
<td valign="top">
113+
<p align="center">
114+
<a href="https://github.com/daltonmenezes/aura-theme/tree/main/packages/npp">
115+
<img src="https://github.com/user-attachments/assets/4e507166-2368-46e5-bea6-405a3514fdd8" align="center" />
116+
</a>
117+
<br/><br/>
118+
<span>Notepad++</span>
119+
</p>
120+
</td>
112121
</tr>
113122
</table>
114123

packages/npp/README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<p align="center">
2+
<img src="https://github.com/daltonmenezes/assets/blob/master/images/aura-theme/new-heading.png?raw=true" alt="Aura Theme" width="70%" />
3+
</p>
4+
5+
<p align="center">
6+
✨ A beautiful dark theme for Notepad++ and other apps
7+
<br><br>
8+
9+
<!-- Patreon -->
10+
<a href="https://www.patreon.com/daltonmenezes">
11+
<img alt="patreon url" src="https://img.shields.io/badge/support%20on-patreon-1C1E26?style=for-the-badge&labelColor=1C1E26&color=61ffca">
12+
</a>
13+
14+
<!-- version -->
15+
<a href="#">
16+
<img alt="version" src="https://img.shields.io/badge/version%20-v1.0.0-1C1E26?style=for-the-badge&labelColor=1C1E26&color=61ffca">
17+
</a>
18+
</p>
19+
20+
<p align="center">
21+
<img alt="preview" src="https://github.com/user-attachments/assets/c75b6ffe-8098-4736-a56e-e48f2134de5f" />
22+
</p>
23+
24+
25+
# Installation
26+
27+
## Prerequisites
28+
Before importing the theme, make sure Notepad++ is set to **Dark Mode**:
29+
1. Go to `Settings` -> `Preferences`
30+
2. In the left sidebar, click on `Dark Mode`
31+
3. Check the box for `Enable Dark Mode`
32+
4. Click `OK`
33+
34+
## Importing the Theme
35+
1. Download one of following themes
36+
- [aura-theme-dark.xml](https://raw.githubusercontent.com/daltonmenezes/aura-theme/main/packages/npp/aura-theme-dark.xml)
37+
- [aura-theme-dark-soft-text.xml](https://raw.githubusercontent.com/daltonmenezes/aura-theme/main/packages/npp/aura-theme-dark-soft-text.xml)
38+
- [aura-theme-soft-dark.xml](https://raw.githubusercontent.com/daltonmenezes/aura-theme/main/packages/npp/aura-theme-soft-dark.xml)
39+
- [aura-theme-soft-dark-soft-text.xml](https://raw.githubusercontent.com/daltonmenezes/aura-theme/main/packages/npp/aura-theme-soft-dark-soft-text.xml)
40+
41+
2. Open Notepad++ and go to `Settings` -> `Import` -> `Import Style Theme(.xml)...`
42+
3. Navigate to the downloaded theme file and open it
43+
4. **Apply the theme manually:**
44+
- Go to `Settings` -> `Style Configurator...`
45+
- In the left panel, select the language you want to apply the theme to
46+
- In the right panel, under "Select theme:", choose the imported theme from the dropdown
47+
- Click `Save & Close`
48+
49+
**Note:** The theme works best with Dark Mode enabled. If you're using Light Mode, the colors may not display correctly.
50+
51+
<br/>
52+
Done! ✨ 🎉
53+
<br/>
54+
<br/>
55+
56+
57+
# Contributors
58+
<table>
59+
<thead>
60+
<tr>
61+
<td valign="bottom"><p align="center">
62+
<a href="https://github.com/daltonmenezes">
63+
<img src="https://github.com/daltonmenezes.png?size=100" align="center" />
64+
</a>
65+
</p></td>
66+
</tr>
67+
</thead>
68+
69+
<tbody>
70+
<td><a href="https://github.com/daltonmenezes">Dalton Menezes</a></td>
71+
</tbody>
72+
</table>
73+
74+
# License
75+
[MIT © Dalton Menezes](https://github.com/daltonmenezes/aura-theme/blob/main/LICENSE)

packages/npp/aura-theme-dark-soft-text.xml

Lines changed: 365 additions & 0 deletions
Large diffs are not rendered by default.

packages/npp/aura-theme-dark.xml

Lines changed: 365 additions & 0 deletions
Large diffs are not rendered by default.

packages/npp/aura-theme-soft-dark-soft-text.xml

Lines changed: 365 additions & 0 deletions
Large diffs are not rendered by default.

packages/npp/aura-theme-soft-dark.xml

Lines changed: 365 additions & 0 deletions
Large diffs are not rendered by default.

src/ports/npp/index.ts

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import { AuraAPI } from 'core'
2+
import { resolve } from 'path'
3+
4+
export async function NotepadPlusPlusPort(Aura: AuraAPI) {
5+
const {
6+
createReadme,
7+
colorSchemes,
8+
constants,
9+
createInMemoryPort,
10+
createFromInMemoryPort,
11+
} = Aura
12+
13+
const { info, folders } = constants
14+
15+
const portName = 'Notepad++'
16+
const version = '1.0.0'
17+
const templateFolder = resolve(__dirname, 'templates')
18+
const outputDist = resolve(folders.distFolder, 'npp')
19+
const previewURL = `https://github.com/user-attachments/assets/c75b6ffe-8098-4736-a56e-e48f2134de5f`
20+
21+
const removeHashFromColors = (template: string) =>
22+
template.replace(/#([A-Fa-f0-9]{6})/g, '$1')
23+
24+
const names = {
25+
auraDark: `${info.shortName} Dark`,
26+
auraDarkSoftText: `${info.shortName} Dark (Soft Text)`,
27+
auraSoftDark: `${info.shortName} Soft Dark`,
28+
auraSoftDarkSoftText: `${info.shortName} Soft Dark (Soft Text)`,
29+
}
30+
31+
async function createCleanTheme(
32+
scheme: any,
33+
outputFileName: string,
34+
name: string
35+
) {
36+
const initialTemplate = await createInMemoryPort({
37+
template: resolve(templateFolder, 'theme.xml'),
38+
replacements: {
39+
...scheme,
40+
...info,
41+
name,
42+
},
43+
})
44+
45+
const cleanTemplate = removeHashFromColors(initialTemplate)
46+
47+
return createFromInMemoryPort({
48+
template: cleanTemplate,
49+
output: resolve(outputDist, `${outputFileName}.xml`),
50+
})
51+
}
52+
53+
await Promise.all([
54+
createCleanTheme(colorSchemes.dark, `${info.slug}-dark`, names.auraDark),
55+
56+
createCleanTheme(
57+
colorSchemes.darkSoft,
58+
`${info.slug}-dark-soft-text`,
59+
names.auraDarkSoftText
60+
),
61+
62+
createCleanTheme(
63+
colorSchemes.softDark,
64+
`${info.slug}-soft-dark`,
65+
names.auraSoftDark
66+
),
67+
68+
createCleanTheme(
69+
colorSchemes.softDarkSoft,
70+
`${info.slug}-soft-dark-soft-text`,
71+
names.auraSoftDarkSoftText
72+
),
73+
74+
createReadme({
75+
template: resolve(templateFolder, 'README.md'),
76+
replacements: {
77+
...info,
78+
portName,
79+
version,
80+
previewURL,
81+
},
82+
}),
83+
])
84+
}

src/ports/npp/templates/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{{{ basic-heading }}}
2+
3+
# Installation
4+
5+
## Prerequisites
6+
Before importing the theme, make sure Notepad++ is set to **Dark Mode**:
7+
1. Go to `Settings` -> `Preferences`
8+
2. In the left sidebar, click on `Dark Mode`
9+
3. Check the box for `Enable Dark Mode`
10+
4. Click `OK`
11+
12+
## Importing the Theme
13+
1. Download one of following themes
14+
- [{{ slug }}-dark.xml](https://raw.githubusercontent.com/{{ author.username }}/{{ slug }}/main/packages/npp/{{ slug }}-dark.xml)
15+
- [{{ slug }}-dark-soft-text.xml](https://raw.githubusercontent.com/{{ author.username }}/{{ slug }}/main/packages/npp/{{ slug }}-dark-soft-text.xml)
16+
- [{{ slug }}-soft-dark.xml](https://raw.githubusercontent.com/{{ author.username }}/{{ slug }}/main/packages/npp/{{ slug }}-soft-dark.xml)
17+
- [{{ slug }}-soft-dark-soft-text.xml](https://raw.githubusercontent.com/{{ author.username }}/{{ slug }}/main/packages/npp/{{ slug }}-soft-dark-soft-text.xml)
18+
19+
2. Open Notepad++ and go to `Settings` -> `Import` -> `Import Style Theme(.xml)...`
20+
3. Navigate to the downloaded theme file and open it
21+
4. **Apply the theme manually:**
22+
- Go to `Settings` -> `Style Configurator...`
23+
- In the left panel, select the language you want to apply the theme to
24+
- In the right panel, under "Select theme:", choose the imported theme from the dropdown
25+
- Click `Save & Close`
26+
27+
**Note:** The theme works best with Dark Mode enabled. If you're using Light Mode, the colors may not display correctly.
28+
29+
{{{ done }}}
30+
31+
32+
# Contributors
33+
<table>
34+
<thead>
35+
<tr>
36+
{{{ author-thead }}}
37+
</tr>
38+
</thead>
39+
40+
<tbody>
41+
{{{ author-tbody }}}
42+
</tbody>
43+
</table>
44+
45+
{{{ footer }}}

0 commit comments

Comments
 (0)