Skip to content

Offline support - #2

Merged
iAmAdheil merged 3 commits into
masterfrom
develop
May 12, 2026
Merged

Offline support#2
iAmAdheil merged 3 commits into
masterfrom
develop

Conversation

@iAmAdheil

@iAmAdheil iAmAdheil commented May 12, 2026

Copy link
Copy Markdown
Owner

Katex assets are bundled for offline support, CI fixes, CD addition for automated deployment


Summary by cubic

Bundle KaTeX CSS/JS/fonts into the package and render via a pure react-native-webview, enabling fully offline LaTeX with auto-height. Switch CI to yarn and add tag-based CD for npm publishing; update docs and lint config.

  • New Features

    • Replace CDN links with inlined KaTeX assets generated by scripts/generate-katex-assets.js (src/katex-assets.ts) so no network is required.
    • Consolidate rendering in src/katex.tsx and export KaTeXAutoHeightWebView and createKaTeXHTML.
  • Refactors

    • Remove @formidable-webview/webshell; add katex as a dev dependency and a generate-assets script; update README and ESLint for Node globals in scripts/.
    • CI/CD: use yarn cache/install, run CI on develop, add cd.yml to publish on v* tags; set release-it to not publish (handled by CD).

Written for commit 5d70738. Summary will update on new commits.

iAmAdheil and others added 3 commits May 13, 2026 00:25
- Replace CDN links with bundled KaTeX CSS, JS, and fonts (base64-embedded)
  via a generate-katex-assets script — package now works fully offline
- Add katex as a devDependency for asset generation
- Update README with honest use-case guidance: when to use this package
  (Expo managed, Old Architecture, zero native modules) and when to use
  better-suited alternatives (enriched-markdown, nitro-markdown)
- Fix ESLint flat config to declare Node.js globals for scripts/ directory

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@iAmAdheil
iAmAdheil merged commit 2b00022 into master May 12, 2026
4 checks passed

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 14 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="README.md">

<violation number="1" location="README.md:97">
P2: Use a number for `borderWidth` in the React Native example; string values are invalid for this style prop.</violation>
</file>

<file name="src/katex.tsx">

<violation number="1" location="src/katex.tsx:319">
P2: Default style fallbacks are never applied because invalid/omitted style input returns `{}` instead of the initialized defaults.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread README.md
containerStyle={{
width: '100%',
backgroundColor: 'yellow',
borderWidth: '1',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Use a number for borderWidth in the React Native example; string values are invalid for this style prop.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At README.md, line 97:

<comment>Use a number for `borderWidth` in the React Native example; string values are invalid for this style prop.</comment>

<file context>
@@ -69,6 +94,8 @@ export default function HomeScreen() {
         containerStyle={{
           width: '100%',
           backgroundColor: 'yellow',
+          borderWidth: '1',
+          borderColor: 'orange',
         }}
</file context>
Suggested change
borderWidth: '1',
borderWidth: 1,

Comment thread src/katex.tsx
};

if (!s || typeof s !== 'object' || Array.isArray(s)) {
return {};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Default style fallbacks are never applied because invalid/omitted style input returns {} instead of the initialized defaults.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/katex.tsx, line 319:

<comment>Default style fallbacks are never applied because invalid/omitted style input returns `{}` instead of the initialized defaults.</comment>

<file context>
@@ -1,119 +1,347 @@
+  };
+
+  if (!s || typeof s !== 'object' || Array.isArray(s)) {
+    return {};
+  }
+
</file context>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant