Skip to content

Commit

Permalink
upgrade build process
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiteVermouth committed Jul 24, 2019
1 parent 7b65293 commit 1acef9b
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 28 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
[Dracula](https://github.com/dracula/dracula-theme/) is a dark theme for many editors, terminals, syntax highlight and eg.
Since version 2019.1, IntelliJ IDEA and other IntelliJ based JetBrains IDEs add support for custom UI.
This project introduces the JetBrains IDEs' Dracula theme.
You may get this theme by downloading the `Dracula Theme` plugin.

## Screenshots

![main-window](docs/screenshots/dracula-main-window.png)
![preferences-window](docs/screenshots/draclua-preferences-window.png)
![plugins-window](docs/screenshots/dracula-plugins-window.png)
![main-window](https://raw.githubusercontent.com/WhiteVermouth/jetbrains-dracula/master/docs/screenshots/dracula-main-window.png)
![preferences-window](https://raw.githubusercontent.com/WhiteVermouth/jetbrains-dracula/master/docs/screenshots/draclua-preferences-window.png)
![plugins-window](https://raw.githubusercontent.com/WhiteVermouth/jetbrains-dracula/master/docs/screenshots/dracula-plugins-window.png)

## Installation

Expand All @@ -25,4 +24,4 @@ You may get this theme by downloading the `Dracula Theme` plugin.

## License

[MIT License](./LICENSE)
[MIT License](https://raw.githubusercontent.com/WhiteVermouth/jetbrains-dracula/master/LICENSE)
9 changes: 7 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.jetbrains.intellij' version '0.4.8'
id 'org.jetbrains.intellij' version '0.4.9'
}

group 'com.vermouthx'
Expand All @@ -15,12 +15,17 @@ intellij {

patchPluginXml {
sinceBuild '191'
untilBuild '192.*'

def changelogPath = "$projectDir/build/CHANGELOG.html"
def changelogPath = "${project.buildDir}/CHANGELOG.html"
def readmePath = "${project.buildDir}/README.html"

if (file(changelogPath).exists()) {
changeNotes file(changelogPath).text
}
if (file(readmePath).exists()) {
pluginDescription file(readmePath).text
}
}

def retrieveSecret = { String prop, String env ->
Expand Down
1 change: 1 addition & 0 deletions scripts/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ verify_ssl = true

[packages]
markdown = "*"
beautifulsoup4 = "*"

[requires]
python_version = "3.7"
24 changes: 20 additions & 4 deletions scripts/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions scripts/readme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import os
import markdown
from bs4 import BeautifulSoup

SOURCE_FILE = os.path.join(os.path.dirname(__file__), '..', 'README.md')
DEST_PATH = os.path.join(os.path.dirname(__file__), '..', 'build')

if __name__ == '__main__':
if not os.path.exists(DEST_PATH):
os.makedirs(DEST_PATH)

with open(SOURCE_FILE, 'r') as source:
html = markdown.markdown(source.read())
soup = BeautifulSoup(html, 'html.parser')

# Remove title
soup.find('h1').decompose()
# Remove build badges
soup.find('p').decompose()

# Set image widths
for img in soup.find_all('img'):
img['width'] = '700'

# Add margin above images
for img in soup.find_all('img'):
img.insert_before(soup.new_tag('br'))

# remove installation
installation = soup.find('h2', text='Installation')
installation.find_next('ol').decompose()
installation.decompose()

with open(os.path.join(DEST_PATH, 'README.html'), 'w') as output_file:
output_file.write(str(soup).strip())
26 changes: 9 additions & 17 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
<idea-plugin>
<id>com.vermouthx.idea</id>
<name>Dracula Theme</name>
<vendor email="[email protected]" url="https://github.com/WhiteVermouth">
VermouthX
</vendor>
<id>com.vermouthx.idea</id>
<name>Dracula Theme</name>
<vendor email="[email protected]" url="https://github.com/WhiteVermouth">
VermouthX
</vendor>

<description><![CDATA[
<div>
<p><a href="https://github.com/dracula/dracula-theme">Dracula</a> color UI theme for JetBrains IDEs.</p>
<p><img src="https://i.imgur.com/RwnIKbb.png" width="700"/></p>
<div>
]]>
</description>
<depends>com.intellij.modules.lang</depends>

<depends>com.intellij.modules.lang</depends>

<extensions defaultExtensionNs="com.intellij">
<themeProvider id="371dce76-a3c5-4429-91af-41cf86094744" path="/themes/Dracula.theme.json"/>
</extensions>
<extensions defaultExtensionNs="com.intellij">
<themeProvider id="371dce76-a3c5-4429-91af-41cf86094744" path="/themes/Dracula.theme.json"/>
</extensions>

</idea-plugin>

0 comments on commit 1acef9b

Please sign in to comment.