summaryrefslogtreecommitdiff
path: root/archived/projt-launcher/scripts/build-tomlplusplus.mjs
diff options
context:
space:
mode:
authorMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 18:51:45 +0300
committerMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 18:51:45 +0300
commitd3261e64152397db2dca4d691a990c6bc2a6f4dd (patch)
treefac2f7be638651181a72453d714f0f96675c2b8b /archived/projt-launcher/scripts/build-tomlplusplus.mjs
parent31b9a8949ed0a288143e23bf739f2eb64fdc63be (diff)
downloadProject-Tick-d3261e64152397db2dca4d691a990c6bc2a6f4dd.tar.gz
Project-Tick-d3261e64152397db2dca4d691a990c6bc2a6f4dd.zip
NOISSUE add archived projects
Signed-off-by: Mehmet Samet Duman <yongdohyun@projecttick.org>
Diffstat (limited to 'archived/projt-launcher/scripts/build-tomlplusplus.mjs')
-rwxr-xr-xarchived/projt-launcher/scripts/build-tomlplusplus.mjs110
1 files changed, 110 insertions, 0 deletions
diff --git a/archived/projt-launcher/scripts/build-tomlplusplus.mjs b/archived/projt-launcher/scripts/build-tomlplusplus.mjs
new file mode 100755
index 0000000000..e294fe4776
--- /dev/null
+++ b/archived/projt-launcher/scripts/build-tomlplusplus.mjs
@@ -0,0 +1,110 @@
+#!/usr/bin/env node
+/**
+ * Script to build toml++ documentation using Poxy
+ * This generates HTML documentation from the Doxygen-formatted markdown files
+ */
+
+import { execSync } from 'child_process';
+import { existsSync, mkdirSync } from 'fs';
+import { join, dirname } from 'path';
+import { fileURLToPath } from 'url';
+
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = dirname(__filename);
+const projectRoot = join(__dirname, '..');
+
+const colors = {
+ reset: '\x1b[0m',
+ green: '\x1b[32m',
+ yellow: '\x1b[33m',
+ red: '\x1b[31m',
+ blue: '\x1b[34m',
+};
+
+function log(message, color = colors.reset) {
+ console.log(`${color}${message}${colors.reset}`);
+}
+
+function commandExists(command) {
+ try {
+ execSync(`which ${command}`, { stdio: 'ignore' });
+ return true;
+ } catch {
+ return false;
+ }
+}
+
+async function buildTomlPlusPlusDocs() {
+ log('\nšŸ”Ø Building toml++ documentation...', colors.blue);
+
+ // Check if dependencies exist
+ if (!commandExists('doxygen')) {
+ log('āŒ Doxygen is not installed!', colors.red);
+ log('Run: npm run setup:doxygen', colors.yellow);
+ process.exit(1);
+ }
+
+ // Check for poxy in common locations
+ const poxyPaths = [
+ 'poxy',
+ `${process.env.HOME}/.local/bin/poxy`,
+ ];
+
+ let poxyCommand = null;
+ for (const path of poxyPaths) {
+ if (commandExists(path)) {
+ poxyCommand = path;
+ break;
+ }
+ }
+
+ if (!poxyCommand) {
+ log('āŒ Poxy is not installed or not in PATH!', colors.red);
+ log('Run: npm run setup:doxygen', colors.yellow);
+ log('Or add to PATH: export PATH="$HOME/.local/bin:$PATH"', colors.yellow);
+ process.exit(1);
+ }
+
+ const tomlplusplusDir = join(projectRoot, 'website', 'tomlplusplus');
+
+ if (!existsSync(tomlplusplusDir)) {
+ log(`āŒ toml++ source directory not found: ${tomlplusplusDir}`, colors.red);
+ process.exit(1);
+ }
+
+ try {
+ log('šŸ“ Running Poxy to generate documentation...', colors.yellow);
+
+ // Change to tomlplusplus directory and run poxy
+ process.chdir(tomlplusplusDir);
+
+ // Run poxy - it will use the poxy.toml config file
+ // Fix PATH to use Homebrew Python instead of Nix Python (if present)
+ const fixedPath = `/opt/homebrew/bin:${process.env.HOME}/.local/bin:${process.env.PATH}`;
+ execSync(poxyCommand, {
+ stdio: 'inherit',
+ env: { ...process.env, PATH: fixedPath }
+ });
+
+ const outputDir = join(tomlplusplusDir, 'html');
+ log('āœ… toml++ documentation built successfully!', colors.green);
+ log(`šŸ“ Output: ${outputDir}`, colors.blue);
+ log('šŸ“ Will be copied to: _site/tomlplusplus/', colors.blue);
+
+ } catch (error) {
+ log(`āŒ Failed to build documentation: ${error.message}`, colors.red);
+ log('\nšŸ’” Tips:', colors.yellow);
+ log(' - Make sure poxy.toml exists in website/tomlplusplus/', colors.yellow);
+ log(' - Check that all source files are present', colors.yellow);
+ log(' - Try running manually: cd website/tomlplusplus && poxy', colors.yellow);
+ process.exit(1);
+ } finally {
+ // Return to project root
+ process.chdir(projectRoot);
+ }
+}
+
+buildTomlPlusPlusDocs().catch(error => {
+ log(`\nāŒ Unexpected error: ${error.message}`, colors.red);
+ process.exit(1);
+});