diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..df581c6
Binary files /dev/null and b/.DS_Store differ
diff --git a/.browserslistrc b/.browserslistrc
deleted file mode 100644
index eb0692b..0000000
--- a/.browserslistrc
+++ /dev/null
@@ -1 +0,0 @@
-Node >= 16
diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index a5afd84..0000000
--- a/.editorconfig
+++ /dev/null
@@ -1,11 +0,0 @@
-# http://editorconfig.org
-root = true
-
-[*]
-indent_style = space
-indent_size = 2
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-quote_type = single
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
deleted file mode 100644
index d10402e..0000000
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ /dev/null
@@ -1,37 +0,0 @@
----
-name: Bug report
-about: For bugs that exist in markmap for VSCode
-title: "[BUG] "
-labels: bug
-assignees: ''
----
-
-- [ ] I have searched for existing issues that already reported this problem and found none
-- [ ] The bug for the VSCode plugin
-
-- [ ] The bug is also present in [the web version of VSCode](https://vscode.dev) or GitHub Codespaces
-
-**Describe the bug**
-
-
-
-**To Reproduce**
-
-
-
-**Expected behavior**
-
-
-
-**Actual behavior**
-
-
-
-**Environment:**
-
-- OS: [e.g. macOS]
-
-**Additional context**
-
-
-
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
deleted file mode 100644
index fe310f5..0000000
--- a/.github/workflows/release.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-name: Release
-
-on:
- push:
- tags:
- - v*
-
-jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: '22'
- registry-url: 'https://registry.npmjs.org'
- - uses: pnpm/action-setup@v4
- with:
- version: 9
- - name: Install deps
- run: pnpm i
- - name: Publish to Open VSX Registry
- continue-on-error: true
- uses: HaaLeo/publish-vscode-extension@v1
- with:
- pat: ${{ secrets.OVSX_TOKEN }}
- dependencies: false
- - name: Publish to Visual Studio Marketplace
- continue-on-error: true
- uses: HaaLeo/publish-vscode-extension@v1
- with:
- pat: ${{ secrets.VSCE_TOKEN }}
- dependencies: false
- registryUrl: https://marketplace.visualstudio.com
diff --git a/.gitignore b/.gitignore
index c6abc88..f5a7741 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,7 @@ node_modules
*.vsix
.vscode-test-web/
.vscode/settings.json
+output.html
+mindmap.html
+/webapp/mindmap.html
+/webapp/.env
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..a30419a
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,47 @@
+# .gitlab-ci.yml - Placed in the ROOT directory
+
+image: node:18 # Use a Node.js image compatible with your project (Node 18+ needed for fetch in convert.js)
+
+stages:
+ - deploy
+
+deploy_webapp:
+ stage: deploy
+ # Optional: Only run on changes to the main branch or specific directories
+ # rules:
+ # - if: '$CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "master"'
+ # changes:
+ # - webapp/**/* # Trigger only if webapp files change
+ # - .gitlab-ci.yml
+ script:
+ - echo "Deploying webapp..."
+ - cd webapp # Navigate into the webapp directory
+ - echo "Current directory: $(pwd)"
+ - echo "Listing files: $(ls -la)"
+ - echo "Node version: $(node -v)"
+ - echo "NPM version: $(npm -v)"
+ - echo "Installing dependencies using npm ci..."
+ - npm ci # Use 'ci' for faster, deterministic installs based on package-lock.json
+ - echo "Dependencies installed."
+ # --- Deployment Action ---
+ # The following command STARTS the server, but it will only run for the duration of the CI job.
+ # For persistent deployment, you need a runner configured to host Node.js apps
+ # (e.g., using pm2, Docker on a server, Kubernetes, etc.)
+ # Option 1: Run directly (for testing CI step, NOT persistent)
+ # - node server.js
+ # Option 2: Use PM2 (if installed on your runner/server)
+ # - npm install -g pm2 # Or ensure pm2 is pre-installed
+ # - pm2 start server.js --name mindmap-webapp --update-env # Starts or restarts the app
+ # Option 3: Build & Push Docker image (Requires Dockerfile and GitLab Container Registry setup)
+ # See Dockerfile example below. Uncomment and adapt if using Docker.
+ # - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
+ # - docker build -t $CI_REGISTRY_IMAGE:latest .
+ # - docker push $CI_REGISTRY_IMAGE:latest
+ # --- Choose ONE deployment strategy appropriate for your runner/hosting ---
+ - echo "Build complete. Runner needs to handle persistent execution."
+ - echo "To run manually: cd webapp && node server.js"
+ - npm install -g pm2 # Or ensure it's pre-installed on the runner machine
+ - pm2 restart server.js --name mindmap-webapp || pm2 start server.js --name mindmap-webapp
+ environment:
+ name: production # Optional: Define environment
+ # url: http://your-deployment-url.com # Optional: Link to deployed app
\ No newline at end of file
diff --git a/.husky/pre-commit b/.husky/pre-commit
deleted file mode 100644
index c27d889..0000000
--- a/.husky/pre-commit
+++ /dev/null
@@ -1 +0,0 @@
-lint-staged
diff --git a/.husky/pre-push b/.husky/pre-push
deleted file mode 100755
index 3867a0f..0000000
--- a/.husky/pre-push
+++ /dev/null
@@ -1 +0,0 @@
-npm run lint
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
deleted file mode 100644
index 3ac9aeb..0000000
--- a/.vscode/extensions.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- // See http://go.microsoft.com/fwlink/?LinkId=827846
- // for the documentation about the extensions.json format
- "recommendations": [
- "dbaeumer.vscode-eslint"
- ]
-}
diff --git a/.vscode/launch.json b/.vscode/launch.json
deleted file mode 100644
index ff3ac5d..0000000
--- a/.vscode/launch.json
+++ /dev/null
@@ -1,19 +0,0 @@
-// A launch configuration that compiles the extension and then opens it inside a new window
-// Use IntelliSense to learn about possible attributes.
-// Hover to view descriptions of existing attributes.
-// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
-{
- "version": "0.2.0",
- "configurations": [
- {
- "name": "Run Extension",
- "type": "extensionHost",
- "request": "launch",
- "args": [
- "--extensionDevelopmentPath=${workspaceFolder}"
- ],
- "outFiles": ["${workspaceFolder}/out/**/*.js"],
- "preLaunchTask": "${defaultBuildTask}"
- }
- ]
-}
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
deleted file mode 100644
index dd2c726..0000000
--- a/.vscode/tasks.json
+++ /dev/null
@@ -1,15 +0,0 @@
-// See https://go.microsoft.com/fwlink/?LinkId=733558
-// for the documentation about the tasks.json format
-{
- "version": "2.0.0",
- "tasks": [
- {
- "type": "npm",
- "script": "build",
- "group": {
- "kind": "build",
- "isDefault": true
- }
- }
- ]
-}
diff --git a/.vscodeignore b/.vscodeignore
deleted file mode 100644
index 7eb8306..0000000
--- a/.vscodeignore
+++ /dev/null
@@ -1,16 +0,0 @@
-**/*.map
-**/*.ts
-gulpfile.js
-pnpm-lock.yaml
-rollup.conf.mjs
-src/**
-tsconfig.json
-babel.config.cjs
-eslint.config.mjs
-.browserslistrc
-.editorconfig
-.github/**
-.gitignore
-.husky/**
-.npmrc
-.vscode/**
diff --git a/README.md b/README.md
index c0ce8bc..e69de29 100644
--- a/README.md
+++ b/README.md
@@ -1,40 +0,0 @@
-# markmap-vscode
-
-[](https://marketplace.visualstudio.com/items?itemName=gera2ld.markmap-vscode)
-[](https://open-vsx.org/extension/gera2ld/markmap-vscode)
-
-This extension integrates [markmap](https://markmap.js.org/) into VSCode.
-
-## Features
-
-- Preview markdown files as markmap
-- Edit markdown files in a text editor and the markmap will update on the fly
-- Works offline
-
-
-
-## Usage
-
-### Command Palette
-
-Open a markdown file. Then open the Command Palette (⇧⌘P) and search `Open as markmap`, press enter.
-
-### Context menu
-
-Right click on a markdown file, then choose `Open as markmap`.
-
-### Button on title-bar
-
-Open a markdown file. Find the markmap icon on the editor title-bar and click it.
-
-
-
-## Configuration
-
-### Custom CSS
-
-Extra CSS to customize the style of markmap.
-
-### Default Options
-
-Default options for Markmap, see for more details.
diff --git a/assets/dark.svg b/assets/dark.svg
deleted file mode 100644
index 77fe1ee..0000000
--- a/assets/dark.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/assets/favicon.png b/assets/favicon.png
deleted file mode 100644
index 0bb9b7d..0000000
Binary files a/assets/favicon.png and /dev/null differ
diff --git a/assets/light.svg b/assets/light.svg
deleted file mode 100644
index e0f8e34..0000000
--- a/assets/light.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/assets/style.css b/assets/style.css
deleted file mode 100644
index 91f3b93..0000000
--- a/assets/style.css
+++ /dev/null
@@ -1,25 +0,0 @@
-html,
-body {
- margin: 0;
- padding: 0;
-}
-
-.button-panel {
- position: absolute;
- right: 20px;
- bottom: 20px;
- background: #fff8;
- border-radius: 4px;
-}
-
-.mm-toolbar {
- position: absolute;
- bottom: 20px;
- right: 20px;
-}
-
-.btn-text {
- height: auto;
- padding-left: 4px;
- padding-right: 4px;
-}
diff --git a/babel.config.cjs b/babel.config.cjs
deleted file mode 100644
index faffcb3..0000000
--- a/babel.config.cjs
+++ /dev/null
@@ -1,6 +0,0 @@
-module.exports = {
- presets: [
- '@babel/preset-env',
- '@babel/preset-typescript',
- ],
-};
diff --git a/convert.js b/convert.js
new file mode 100644
index 0000000..3f8f807
--- /dev/null
+++ b/convert.js
@@ -0,0 +1,138 @@
+/**
+ * convert.js
+ *
+ * Usage:
+ * node convert.js path/to/input.md path/to/output.html
+ *
+ * This uses Node ≥18’s built-in fetch. If you're on Node 18+, no need to install node-fetch.
+ */
+
+const fs = require("fs");
+const { Transformer } = require("markmap-lib");
+
+/**
+ * Helper: built-in fetch to load JS from a CDN
+ * (Node v18+ automatically has fetch in global scope).
+ */
+async function fetchText(url) {
+ console.log(`Workspaceing: ${url}`);
+ const res = await fetch(url);
+ if (!res.ok) {
+ throw new Error(`Failed to fetch ${url}: ${res.status}`);
+ }
+ return res.text();
+}
+
+/**
+ * We’ll create final HTML by hand so we don’t rely on
+ * markmap-lib’s "fillTemplate" subpath (which isn't exported).
+ */
+function buildHtml({ rootData, scripts, css, markmapOptions = {} }) {
+ // Scripts are plain JS strings that we’ll inline in `)
+ .join("\n")}
+
+
+