Skip to content
Merged
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[FreeDevTool.App](https://FreeDevTool.App)

**A comprehensive collection of 49+ open source developer tools with offline functionality**
**A comprehensive collection of 50+ open source developer tools with offline functionality**

## Overview

Expand Down Expand Up @@ -44,7 +44,7 @@ The client-side is a React with TypeScript application, built on a component-bas

- **Routing**: Uses wouter for lightweight client-side routing.
- **State Management**: Leverages React's built-in state management with hooks.
- **UI/UX Decisions**: Features collapsible header/sidebar menus with state persistence, responsive sidebar modes, a unified text editor with line numbers, and a searchable tool directory with keyboard shortcut navigation. All 49 tools now use simple React state (no session persistence) for optimal reliability and performance, and UI uniformity is achieved through shared components like `ToolButton` and `ToolTextArea`. Regex Tester uses Ctrl+E shortcut (Ctrl+R reserved for browser refresh). Session management has been completely removed from all tools for enhanced stability.
- **UI/UX Decisions**: Features collapsible header/sidebar menus with state persistence, responsive sidebar modes, a unified text editor with line numbers, and a searchable tool directory with keyboard shortcut navigation. All 50 tools now use simple React state (no session persistence) for optimal reliability and performance, and UI uniformity is achieved through shared components like `ToolButton` and `ToolTextArea`. Regex Tester uses Ctrl+E shortcut (Ctrl+R reserved for browser refresh). Session management has been completely removed from all tools for enhanced stability.

### Backend Architecture

Expand All @@ -60,7 +60,7 @@ Not implemented

### Technical Implementations & Feature Specifications

- **Tool Suite**: Comprehensive conversion tools (URL/CSV to JSON, Number Base, Date, Timezone, Unit), image metadata extraction with local C2PA Content Credentials validation, advanced text tools (password generator, UUID v1/v4), and hardware tests (Camera, Microphone, Keyboard) with Web Audio API integration for alerts. SynthID watermark verification is not included. Added Metronome with multi-tone functionality. All 49 tools converted to simple React state management for enhanced reliability.
- **Tool Suite**: Comprehensive conversion tools (URL/CSV to JSON, Markdown to HTML, Number Base, Date, Timezone, Unit), image metadata extraction with local C2PA Content Credentials validation, advanced text tools (password generator, UUID v1/v4), and hardware tests (Camera, Microphone, Keyboard) with Web Audio API integration for alerts. SynthID watermark verification is not included. Added Metronome with multi-tone functionality. All 50 tools converted to simple React state management for enhanced reliability.
- **Demo System**: Automated tour functionality with customizable speed controls (Slow 8s, Normal 5s, Fast 3s, Very Fast 1.5s), persistent state management, skip/stop controls, and speed preference persistence via localStorage.
- **Offline Functionality**: All external dependencies for tools like QR and Barcode generators have been replaced with local JavaScript libraries to ensure 100% offline functionality.
- **URL Sharing**: Implemented across all major tools, including timing tools, for state persistence and sharing.
Expand Down
2 changes: 2 additions & 0 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const GraphQLFormatter = lazy(() => import("@/pages/tools/graphql-formatter"));
const TimeFormatter = lazy(() => import("@/pages/tools/time-formatter"));
const Base64Encoder = lazy(() => import("@/pages/tools/base64-encoder"));
const CborEncoder = lazy(() => import("@/pages/tools/cbor-encoder"));
const MarkdownToHtml = lazy(() => import("@/pages/tools/markdown-to-html"));
const ImageMetadata = lazy(() => import("@/pages/tools/image-metadata"));
const UrlEncoder = lazy(() => import("@/pages/tools/url-encoder"));
const JwtDecoder = lazy(() => import("@/pages/tools/jwt-decoder"));
Expand Down Expand Up @@ -111,6 +112,7 @@ function Router() {
path="/tools/number-base-converter"
component={NumberBaseConverter}
/>
<Route path="/tools/markdown-to-html" component={MarkdownToHtml} />

{/* Formatters */}
<Route path="/tools/json-formatter" component={JsonFormatter} />
Expand Down
61 changes: 61 additions & 0 deletions client/src/data/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
Link2,
Table,
Binary,
FileCode,

// Formatters
FileJson,
Expand Down Expand Up @@ -1229,6 +1230,66 @@ export const toolsData: ToolData = {
],
},
},
{
name: "Markdown to HTML",
path: "/tools/markdown-to-html",
icon: FileCode,
shortcut: "Ctrl+Shift+Alt+M",
metadata: {
title: "Markdown to HTML Converter - Preview and Download HTML",
description:
"Convert Markdown to HTML with a live rendered preview. Supports GitHub Flavored Markdown and downloads a standalone HTML file.",
keywords: [
"markdown to html",
"markdown converter",
"markdown preview",
"md to html",
"GitHub Flavored Markdown",
"markdown renderer",
],
},
explanations: {
notice: {
type: "privacy",
title: "Private, Local Conversion",
items: [
"Markdown is converted locally in your browser and is never uploaded.",
"The preview runs in a sandboxed frame, so scripts embedded in the Markdown never execute.",
],
},
sections: [
{
title: "Supported Markdown",
items: [
"Headings, emphasis, links, images, lists, and blockquotes",
"GitHub Flavored Markdown: tables, task lists, strikethrough, and autolinks",
"Fenced and indented code blocks, plus inline HTML",
],
},
{
title: "Output Options",
items: [
{
label: "Full HTML Document:",
text: "a standalone page with <head>, title, and readable styles (light and dark)",
},
{
label: "Body only:",
text: "just the converted HTML, ready to paste into an existing page or CMS",
},
{
label: "Download:",
text: "saves the HTML using the first heading as the filename",
},
{
label: "Remote images:",
text: "are kept in the HTML but may not appear in the in-page preview",
},
],
},
],
},
},
],
},
Formatters: {
Expand Down
94 changes: 94 additions & 0 deletions client/src/lib/markdown-to-html.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import { marked } from "marked";

/**
* Stylesheet embedded in both the live preview and downloaded full HTML
* documents, so the downloaded file renders the same as the preview.
*/
const MARKDOWN_HTML_STYLES = `
:root { color-scheme: light dark; --fg: #1e293b; --bg: #ffffff; --muted: #64748b; --border: #e2e8f0; --code-bg: #f1f5f9; --link: #2563eb; }
@media (prefers-color-scheme: dark) {
:root { --fg: #e2e8f0; --bg: #0f172a; --muted: #94a3b8; --border: #334155; --code-bg: #1e293b; --link: #60a5fa; }
}
:root[data-theme="light"] { --fg: #1e293b; --bg: #ffffff; --muted: #64748b; --border: #e2e8f0; --code-bg: #f1f5f9; --link: #2563eb; color-scheme: light; }
:root[data-theme="dark"] { --fg: #e2e8f0; --bg: #0f172a; --muted: #94a3b8; --border: #334155; --code-bg: #1e293b; --link: #60a5fa; color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0 auto; max-width: 48rem; padding: 1.5rem 1rem; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.6; color: var(--fg); background: var(--bg); overflow-wrap: break-word; }
h1, h2, h3, h4, h5, h6 { line-height: 1.25; margin: 1.5em 0 0.5em; }
h1 { font-size: 2em; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
h2 { font-size: 1.5em; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
h1:first-child, h2:first-child { margin-top: 0; }
a { color: var(--link); }
img { max-width: 100%; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; background: var(--code-bg); padding: 0.15em 0.35em; border-radius: 4px; }
pre { background: var(--code-bg); padding: 1rem; border-radius: 6px; overflow-x: auto; }
pre code { background: none; padding: 0; }
blockquote { margin: 1em 0; padding: 0 1em; color: var(--muted); border-left: 4px solid var(--border); }
table { border-collapse: collapse; display: block; overflow-x: auto; margin: 1em 0; }
th, td { border: 1px solid var(--border); padding: 0.4em 0.8em; }
th { background: var(--code-bg); }
hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
li > input[type="checkbox"] { margin-right: 0.4em; }
`.trim();

/** Convert Markdown (GitHub Flavored) to an HTML fragment. */
export function convertMarkdownToHtml(markdown: string): string {
return marked.parse(markdown, {
gfm: true,
breaks: false,
async: false,
}) as string;
}

function escapeHtml(text: string): string {
return text
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;");
}

/** Title from the first level-1 heading, or "Document". */
export function extractTitle(markdown: string): string {
const match = markdown.match(/^#[ \t]+(.+?)[ \t#]*$/m);
const title = match?.[1]
?.replace(/[*_`~[\]]/g, "")
.replace(/\(([^)]*)\)/g, "")
.trim();
return title || "Document";
}

/** Filesystem-friendly slug for a download filename. */
export function slugifyFilename(title: string): string {
const slug = title
.toLowerCase()
.normalize("NFKD")
.replace(/[̀-ͯ]/g, "")
.replace(/[^a-z0-9]+/g, "-")
.replace(/^-+|-+$/g, "")
.slice(0, 80);
return slug || "document";
}

/** Wrap an HTML fragment in a standalone, styled HTML document. */
export function wrapHtmlDocument(
body: string,
title: string,
theme?: "light" | "dark"
): string {
const themeAttr = theme ? ` data-theme="${theme}"` : "";
return `<!doctype html>
<html lang="en"${themeAttr}>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>${escapeHtml(title)}</title>
<style>
${MARKDOWN_HTML_STYLES}
</style>
</head>
<body>
${body.trim()}
</body>
</html>
`;
}
Loading
Loading