Skip to content

Commit

Permalink
Renamed the Library name to RenderX
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuljindalpw committed Feb 23, 2024
1 parent 016c644 commit de7d1e3
Show file tree
Hide file tree
Showing 206 changed files with 41 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .idea/codestream.xml

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

2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ android {

dependencies {

implementation(project(":pwhtmllatex"))
implementation(project(":renderX"))
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
implementation("androidx.activity:activity-compose:1.8.2")
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/live/pw/latexview/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import live.pw.latexview.ui.theme.LatexViewTheme
import live.pw.pwHtmlLatex.PwHtmlLatex
import live.pw.renderX.RenderX

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
Expand Down Expand Up @@ -57,7 +57,7 @@ fun ExampleView(modifier: Modifier = Modifier) {

@Composable
fun LatexEquationsExample() {
PwHtmlLatex(
RenderX(
latex = "<h2>LaTeX Equations:</h2>\n" +
"\n" +
" <p>Example 1: Equation 1 \\(e^{i\\pi} + 1 = 0\\)</p>\n" +
Expand All @@ -81,7 +81,7 @@ fun LatexEquationsExample() {

@Composable
fun MathMLEquationExample() {
PwHtmlLatex(
RenderX(
latex = "<h2>MathML Equations:</h2>\n" +
"\n" +
" <p>Example 1: Equation 1 <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n" +
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">LatexView</string>
<string name="app_name">RenderX</string>
</resources>
28 changes: 14 additions & 14 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
[![](https://jitpack.io/v/tech-pw/pwHtmlLatex.svg)](https://jitpack.io/#tech-pw/pwHtmlLatex)
[![](https://jitpack.io/v/tech-pw/renderX.svg)](https://jitpack.io/#tech-pw/renderX)

**Title: An Native Android liberary to render latex with HTML support**

**Introduction:**
In the realm of Android development, the struggle with sluggish equation rendering has been all too real. pwHtmlLatex steps into the spotlight as a game-changing solution, not only accelerating LaTeX rendering but also seamlessly handling HTML with a nuanced fallback mechanism.
In the realm of Android development, the struggle with sluggish equation rendering has been all too real. RenderX steps into the spotlight as a game-changing solution, not only accelerating LaTeX rendering but also seamlessly handling HTML with a nuanced fallback mechanism.

**The Dual Power of pwHtmlLatex:**
**The Dual Power of RenderX:**

1. **Native Rendering Excellence:**
- Bid farewell to the performance bottlenecks associated with webviews. pwHtmlLatex champions native rendering, dramatically enhancing the speed of LaTeX equation display on Android. Our benchmark tests reveal a 50-80% improvement, translating to a more responsive user experience.
So we have captured the frame rate graph while rendering Latex equations in pwHtmlLatex vs MathJax. The difference can be visually seen.
- Bid farewell to the performance bottlenecks associated with webviews. RenderX champions native rendering, dramatically enhancing the speed of LaTeX equation display on Android. Our benchmark tests reveal a 50-80% improvement, translating to a more responsive user experience.
So we have captured the frame rate graph while rendering Latex equations in RenderX vs MathJax. The difference can be visually seen.

<div style="display: flex;">
<img src="https://raw.githubusercontent.com/tech-pw/pwHtmlLatex/aaa31df197a3320aea3a868b97d79b88038b3f5b/screenshots/Screenshot%202024-02-16%20at%203.34.50%20PM.png" alt="Latex rendering" style="width: 45%;">
<img src="https://raw.githubusercontent.com/tech-pw/pwHtmlLatex/aaa31df197a3320aea3a868b97d79b88038b3f5b/screenshots/Screenshot%202024-02-16%20at%203.35.03%20PM.png" alt="MathJax Rendering" style="width: 45%;">
<img src="https://raw.githubusercontent.com/tech-pw/RenderX/aaa31df197a3320aea3a868b97d79b88038b3f5b/screenshots/Screenshot%202024-02-16%20at%203.34.50%20PM.png" alt="Latex rendering" style="width: 45%;">
<img src="https://raw.githubusercontent.com/tech-pw/RenderX/aaa31df197a3320aea3a868b97d79b88038b3f5b/screenshots/Screenshot%202024-02-16%20at%203.35.03%20PM.png" alt="MathJax Rendering" style="width: 45%;">
</div>

https://github.com/tech-pw/pwHtmlLatex/assets/160108670/65903362-d56b-4a3a-bb7c-776dd3856c4f
https://github.com/tech-pw/RenderX/assets/160108670/65903362-d56b-4a3a-bb7c-776dd3856c4f


2. **HTML + LaTeX Synergy:**
- One of pwHtmlLatex's standout features is its ability to seamlessly render LaTeX embedded within HTML. This means developers can pass HTML with LaTeX equations directly, unleashing a new realm of possibilities. To illustrate its prowess, we've included real-world scenarios where HTML and LaTeX coexist harmoniously.
- One of RenderX's standout features is its ability to seamlessly render LaTeX embedded within HTML. This means developers can pass HTML with LaTeX equations directly, unleashing a new realm of possibilities. To illustrate its prowess, we've included real-world scenarios where HTML and LaTeX coexist harmoniously.

```markdown
Example

PwHtmlLatex(
RenderX(
latex = "<h2>LaTeX Equations:</h2>\n" +
"\n" +
" <p>Example 1: Equation 1 \\(e^{i\\pi} + 1 = 0\\)</p>\n" +
Expand All @@ -47,13 +47,13 @@ PwHtmlLatex(
)
```
Output
![Rendeing screenshot](https://raw.githubusercontent.com/tech-pw/pwHtmlLatex/bfb85a776e0a7d2e9a39f5e87666b7246e2fce5e/screenshots/Screenshot%202024-02-16%20at%204.39.23%20PM.png)
![Rendeing screenshot](https://raw.githubusercontent.com/tech-pw/RenderX/bfb85a776e0a7d2e9a39f5e87666b7246e2fce5e/screenshots/Screenshot%202024-02-16%20at%204.39.23%20PM.png)

3. **Versatile HTML Rendering:**
- pwHtmlLatex isn't confined to LaTeX alone; it excels in rendering pure HTML content with equal finesse with support of rendeing images via coil. Explore scenarios where the library effortlessly handles diverse HTML content, making it a versatile choice for rendering beyond mathematical equations.
- RenderX isn't confined to LaTeX alone; it excels in rendering pure HTML content with equal finesse with support of rendeing images via coil. Explore scenarios where the library effortlessly handles diverse HTML content, making it a versatile choice for rendering beyond mathematical equations.

4. **Intelligent Fallback Mechanism:**
- In complex scenarios where native rendering faces challenges, pwHtmlLatex gracefully falls back to webview, so that it can be used in production ready usecases, ensuring a seamless user experience.
- In complex scenarios where native rendering faces challenges, RenderX gracefully falls back to webview, so that it can be used in production ready usecases, ensuring a seamless user experience.

**Integration Guide: Bringing pwHtml Latex Into Your Project:**
1) For new project system following has to be added to setting.gradle and for old system it has to be added to root level build.gradle
Expand All @@ -74,7 +74,7 @@ dependencyResolutionManagement {

```
dependencies {
implementation 'com.github.tech-pw:pwHtmlLatex:$version'
implementation 'com.github.tech-pw:renderX:$version'
}
```
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions pwhtmllatex/build.gradle.kts → renderX/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
val pwuiPomVersion by extra("0.0.1")
val pwuiPomGroupID by extra("live.pw")
val pwuiArtifact by extra("pwhtmllatex-release.aar")
val pwuiArtifact by extra("renderX-release.aar")
}

plugins {
Expand All @@ -10,7 +10,7 @@ plugins {
}

android {
namespace = "live.pw.pwHtmlLatex"
namespace = "live.pw.renderX"
compileSdk = 34

defaultConfig {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package live.pw.pwHtmlLatex
package live.pw.renderX

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
Expand All @@ -19,6 +19,6 @@ class ExampleInstrumentedTest {
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("live.pw.pwHtmlLatex", appContext.packageName)
assertEquals("live.pw.renderX", appContext.packageName)
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package live.pw.pwHtmlLatex
package live.pw.renderX

import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package live.pw.pwHtmlLatex
package live.pw.renderX

import android.graphics.Canvas
import android.graphics.drawable.BitmapDrawable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package live.pw.pwHtmlLatex
package live.pw.renderX

import android.view.ViewGroup
import android.webkit.WebView
Expand All @@ -11,8 +11,7 @@ import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.sp
import androidx.compose.ui.viewinterop.AndroidView
import live.pw.pwHtmlLatex.Utility.determineFont
import live.pw.pwHtmlLatex.mathJaxView.MathJaxViewV1
import live.pw.renderX.mathJaxView.MathJaxViewV1

@Composable
fun MathView(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package live.pw.pwHtmlLatex
package live.pw.renderX

import android.text.Spannable
import android.text.SpannableStringBuilder
Expand Down Expand Up @@ -47,7 +47,7 @@ private const val TAG = "EquationView"
* @param layer The layer to render the LaTeX on.
*/
@Composable
fun PwHtmlLatex(
fun RenderX(
modifier: Modifier = Modifier,
latex: String,
textSize: Float = 16f,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package live.pw.pwHtmlLatex
package live.pw.renderX

import android.text.Editable
import android.text.Html
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package live.pw.pwHtmlLatex
package live.pw.renderX

import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package live.pw.pwHtmlLatex
package live.pw.renderX

import android.graphics.Canvas
import android.graphics.Paint
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package live.pw.pwHtmlLatex.mathJaxView;
package live.pw.renderX.mathJaxView;

import android.content.Context;
import android.content.res.TypedArray;
Expand All @@ -12,7 +12,7 @@

import androidx.annotation.Nullable;

import live.pw.pwHtmlLatex.R;
import live.pw.renderX.R;


public class MathJaxView extends WebView {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package live.pw.pwHtmlLatex.mathJaxView;
package live.pw.renderX.mathJaxView;

import android.content.Context;
import android.util.AttributeSet;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package live.pw.pwHtmlLatex.ui.theme
package live.pw.renderX.ui.theme

import androidx.compose.ui.graphics.Color

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package live.pw.pwHtmlLatex.ui.theme
package live.pw.renderX.ui.theme

import android.app.Activity
import android.os.Build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package live.pw.pwHtmlLatex.ui.theme
package live.pw.renderX.ui.theme

import androidx.compose.material3.Typography
import androidx.compose.ui.text.TextStyle
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package live.pw.pwHtmlLatex
package live.pw.renderX

import org.junit.Test

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ dependencyResolutionManagement {

rootProject.name = "LatexView"
include(":app")
include(":pwhtmllatex")
include(":renderX")

0 comments on commit de7d1e3

Please sign in to comment.