Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4X: Rewrite to support additional features, cleaner UI implementation #9

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Auto detect text files and perform LF normalization
* text=auto

# Java sources
*.java text diff=java eol=lf
*.gradle text diff=java eol=lf

# These files are text and should be normalized (Convert crlf => lf)
*.css text diff=css eol=lf
*.html text diff=html eol=lf
*.md text diff=markdown eol=lf
*.js text eol=lf
*.csv text eol=lf
*.json text eol=lf
*.properties text eol=lf
*.svg text eol=lf
*.xml text eol=lf
*.yaml text eol=lf
*.yml text eol=lf

# These files are binary and should be left untouched
*.png binary
*.gif binary
*.jpg binary
*.jpeg binary

# Common build-tool wrapper scripts
mvnw text eol=lf
gradlew text eol=lf
*.sh text eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.metadata/**
.recommenders/**
.settings/**
.gradle/**
bin/**
target/**
build/**

.classpath
.project
Expand Down
340 changes: 335 additions & 5 deletions LICENSE

Large diffs are not rendered by default.

33 changes: 12 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
# Code2HTML

A JavaFX app for converting user specified languages to HTML. Paste source code into the top-left panel and the HTML will show in the top-right, with a preview at the bottom.
The CSS and _optional JS_ are available in the other tabs in the top-right. Updating the CSS and JS will display live updates in the preview area.
A JavaFX app for converting user specified languages to HTML.

### Top-Left tabs:
**Requirements**

* **HTML**: The HTML output.
* **CSS**: The CSS code that styles the HTML span tags.
* **JS**: Optional JS for manual inclusion of collapse-sections.
* **Patterns**: List of Regex groups for the currently loaded language.

While the JS is not necessary it allows you to make portions of the code collapseable.

## Download

See the [releases](https://github.com/Col-E/Code2HTML/releases) page for the latest build. Or compile with maven via `mvn package`

**Note**: Builds are based off of Java 8. Running on later versions will not work, please see [the update guide](UPDATING-JDK.md) for more information.
- Versions `4.X.X` and beyond require Java 17 to run _(JavaFX bundled)_
- Versions `3.X.X` and below require Java 8 to run _(JavaFX not bundled)_

## Screenshots

* ![Main View](ss-html.png)
* ![Config View](ss-config.png)

## Download

See the [releases](https://github.com/Col-E/Code2HTML/releases) page for the latest build. Or compile with maven via `mvn package`

## Libraries used:

* [Apache Commons IO](https://commons.apache.org/proper/commons-io/)
* [Apache Commons Text](https://commons.apache.org/proper/commons-text/)
* [ControlsFX](https://github.com/controlsfx/controlsfx)
* [JRegex](http://jregex.sourceforge.net/)
* [picocli](https://picocli.info/)
* [Lombok](https://projectlombok.org/)
* [Apache Commons Text](https://commons.apache.org/proper/commons-text/) - HTML escaping
* [Florian Ingerl's Regex](https://github.com/florianingerl/com.florianingerl.util.regex) - Drop in `java.util.regex` replacement that allows for `(?N)` recursion _(Also GPLv2)_
* [JavaFX](https://openjfx.io/) - UI
* [picocli](https://picocli.info/) - CLI
77 changes: 77 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
plugins {
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'org.openjfx.javafxplugin' version '0.1.0'
}

group 'software.coley'
version '4.0.0-SNAPSHOT'

repositories {
mavenLocal()
mavenCentral()
maven { url 'https://jitpack.io' }
}

def javaFxVersion = '22-ea+28'
def javaFxIncludeInDist = System.getProperty('skip.jfx.bundle') == null

javafx {
version = javaFxVersion
modules = ['javafx.controls', 'javafx.web']
}

dependencies {
implementation 'org.apache.commons:commons-text:1.11.0'
implementation 'com.github.florianingerl.util:regex:1.1.9'
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'javax.activation:activation:1.1.1'
implementation 'com.sun.xml.bind:jaxb-impl:2.3.4'
implementation 'com.github.Col-E:tiwulfx-dock:1.2.3'
implementation 'info.picocli:picocli:4.7.5'
implementation 'fr.brouillard.oss:cssfx:11.5.1'
implementation 'org.openjfx:javafx-web:21'
implementation 'ch.qos.logback:logback-classic:1.4.14'

testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
}

// https://docs.gradle.org/current/userguide/toolchains.html
// gradlew -q javaToolchains - see the list of detected toolchains.
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

// Append options for unchecked/deprecation
gradle.projectsEvaluated {
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
options.encoding = 'UTF-8'
options.incremental = true
}
}

// All modules should have the same test framework setup.
test {
useJUnitPlatform()

systemProperty 'junit.jupiter.execution.parallel.enabled', true
systemProperty 'junit.jupiter.execution.parallel.mode.default', 'concurrent'

testLogging {
events "passed", "skipped", "failed"
}
}

application {
mainClass = 'me.coley.c2h.Code2Html'
}

shadowJar {
dependencies {
exclude(dependency(javaFxIncludeInDist ? 'invalid:invalid:invalid' : 'org.openjfx:.*:.*'))
}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.gradle.caching=true
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading