diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..c85eab1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,26 @@ +# CHANGELOG +## v0.1.2: +- Added local hosting for html files +- Created standalone version + +## v0.1.3 +- Updated Applovin Demo Upload +- Changed file selection workflow +- Added "Regenerate QRs" if in case they don't render +- Added "Save QR" and "Save All QRs" + +## v0.1.5 +- Better file selection for PLEC Uoload +- Multi file selection +- Auto detects iteration name (it tries its best) + +Standalone .exe +- Move temp files into user temp folder + +## v0.1.6 +- Simplify UI +- Added beta tools (needs further testing) + - Playworks Converter + - Upload UnityAds HTML from Playworks to add injections for the other networks + - MRAID Checker + - Based on Official MRAID Document, scans the HTML files if they adhere to the documentation requirements and best practices \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..6794af3 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# HPL Toolbox + +Bundled VS Code extension and standalone tools for playable ad workflows. + +# CHANGELOG +## v0.1.2: +- Added local hosting for html files +- Created standalone version + +## v0.1.3 +- Updated Applovin Demo Upload +- Changed file selection workflow +- Added "Regenerate QRs" if in case they don't render +- Added "Save QR" and "Save All QRs" + +## v0.1.5 +- Better file selection for PLEC Uoload +- Multi file selection +- Auto detects iteration name (it tries its best) + +Standalone .exe +- Move temp files into user temp folder + +## v0.1.6 +- Simplify UI +- Added beta tools (needs further testing) + - Playworks Converter + - Upload UnityAds HTML from Playworks to add injections for the other networks + - MRAID Checker + - Based on Official MRAID Document, scans the HTML files if they adhere to the documentation requirements and best practices diff --git a/dist/hpl-toolbox-0.1.6.exe b/dist/hpl-toolbox-0.1.6.exe index ce7cd40..4648022 100644 Binary files a/dist/hpl-toolbox-0.1.6.exe and b/dist/hpl-toolbox-0.1.6.exe differ diff --git a/dist/hpl-toolbox-0.1.6.vsix b/dist/hpl-toolbox-0.1.6.vsix index 0a579f6..94ecdaa 100644 Binary files a/dist/hpl-toolbox-0.1.6.vsix and b/dist/hpl-toolbox-0.1.6.vsix differ diff --git a/package.json b/package.json index bc73b91..59d9a66 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,8 @@ ] }, "scripts": { - "compile": "tsc -p ./", + "sync-readme": "node scripts/sync-readme.js", + "compile": "npm run sync-readme && tsc -p ./", "watch": "tsc -watch -p ./", "vscode:prepublish": "npm run compile" }, diff --git a/scripts/sync-readme.js b/scripts/sync-readme.js new file mode 100644 index 0000000..57462bd --- /dev/null +++ b/scripts/sync-readme.js @@ -0,0 +1,20 @@ +const fs = require('fs'); +const path = require('path'); + +const root = path.resolve(__dirname, '..'); +const changelogPath = path.join(root, 'CHANGELOG.md'); +const readmePath = path.join(root, 'README.md'); + +let changelog = '# CHANGELOG\n\nNo changelog entries yet.'; +if (fs.existsSync(changelogPath)) { + changelog = fs.readFileSync(changelogPath, 'utf8').trim(); +} + +const readme = `# HPL Toolbox + +Bundled VS Code extension and standalone tools for playable ad workflows. + +${changelog} +`; + +fs.writeFileSync(readmePath, readme.replace(/\r?\n/g, '\n'), 'utf8'); diff --git a/src/changelogView.ts b/src/changelogView.ts new file mode 100644 index 0000000..ea76109 --- /dev/null +++ b/src/changelogView.ts @@ -0,0 +1,122 @@ +import * as fs from 'fs'; +import * as path from 'path'; +import * as vscode from 'vscode'; + +export function openChangelog(context: vscode.ExtensionContext) { + const panel = vscode.window.createWebviewPanel( + 'hplToolbox.changelog', + 'HPL Toolbox Changelog', + vscode.ViewColumn.One, + { enableScripts: false } + ); + const changelogPath = path.join(context.extensionPath, 'CHANGELOG.md'); + let markdown = '# Changelog\n\nCHANGELOG.md was not found.'; + try { + markdown = fs.readFileSync(changelogPath, 'utf8'); + } catch { + // Keep the fallback text readable in packaged or development installs. + } + panel.webview.html = getHtml(renderMarkdown(markdown)); +} + +function getHtml(content: string): string { + return ` + + + + + + +
${content}
+ +`; +} + +function renderMarkdown(markdown: string): string { + const lines = markdown.replace(/\r\n/g, '\n').split('\n'); + const html: string[] = []; + let inList = false; + + const closeList = () => { + if (inList) { + html.push(''); + inList = false; + } + }; + + for (const rawLine of lines) { + const line = rawLine.trim(); + if (!line) { + closeList(); + continue; + } + const heading = line.match(/^(#{1,3})\s+(.+)$/); + if (heading) { + closeList(); + const level = Math.min(heading[1].length, 2); + html.push(`${escapeHtml(heading[2])}`); + continue; + } + const listItem = line.match(/^-\s+(.+)$/); + if (listItem) { + if (!inList) { + html.push('") + inList = false + } + } + + for _, rawLine := range lines { + line := strings.TrimSpace(rawLine) + if line == "" { + closeList() + continue + } + if strings.HasPrefix(line, "### ") { + closeList() + out.WriteString("

" + html.EscapeString(strings.TrimSpace(line[4:])) + "

") + continue + } + if strings.HasPrefix(line, "## ") { + closeList() + out.WriteString("

" + html.EscapeString(strings.TrimSpace(line[3:])) + "

") + continue + } + if strings.HasPrefix(line, "# ") { + closeList() + out.WriteString("

" + html.EscapeString(strings.TrimSpace(line[2:])) + "

") + continue + } + if strings.HasPrefix(line, "- ") { + if !inList { + out.WriteString("