Manidoc is an all-in-one app for creating, automating, and managing documentation. From AI-powered text generation and research, to batch creation from templates, and external tool integration such as FTP and Git — the script engine lets you automate everything exactly the way you want.
manidoc User Manual
1. 概要
2. Getting Started — Core Concepts
2.1. What is a Workspace?
A workspace is the folder where all your Manidoc data is stored. When you launch the app for the first time, you choose which folder to use. If you want to share data across multiple computers, you can point it to a cloud folder such as OneDrive or Dropbox.
2.2. What is a Project?
A project corresponds to one document or collection of information. You can have multiple projects inside a single workspace. Examples:
- "Product Release Notes"
- "Service Introduction Page"
- "Technical Research Report (auto-collected by AI)"
- "Periodic Update Procedures (auto-generated by scripts)"
- "Competitor & Latest-Info Summary (web research)"
- "Ideas & Planning Notes"
2.3. What is a Node?
A node is one "heading (page)" inside a project. Each node can hold the following content: Nodes can be nested (parent–child relationships). For example, you could place "Login" and "Logout" as children of "Basic Operations".
3. Using the Start Screen
This is the first screen you see when you launch the app. Use the left side for workspace and project operations; use the right side for the project list, AI, and scripts.
3.1. Choosing a Workspace
Enter the path of the folder where you want to store your data in the "Workspace" field at the top-left. You can also click the "Browse" button to select a folder.
3.2. Creating a New Project
- Type a name in the "New Project Name" field
- Click the "Create & Open" button
- The project editing screen opens immediately
3.3. Opening an Existing Project
Your projects are listed in the "Recent Projects" tab on the right. Double-click the project you want to open.
3.4. Reordering Projects
You can change the order of the project list in two ways: The new order is saved automatically.
3.5. Tag Feature
Attaching "tags" to projects lets you organize the list and create a hierarchical structure when doing bulk web export.
3.5.1. Assigning a Tag
Simply select a tag from the dropdown (combo box) at the right end of each project row. Select "(none)" to remove the tag.
3.5.2. Adding / Editing Tags (Tag Manager)
Click the "🏷 Tag Manager" button on the start screen to open the Tag Manager dialog.
3.5.3. Grouping by Tag
Click the "Group by Tag" button on the start screen to display the project list grouped by tag.
Click it again to return to normal view (sorted by SortOrder).
3.5.4. Tags and Bulk Web Export
When you run "🌐 Bulk Web Export" and at least one project has a tag assigned, the output uses a hierarchical structure.
output-folder/
├── index.html ← Top page (tag tiles + untagged projects)
├── tag_0/
│ ├── index.html ← Sub-page for tag "Operations Manual" (project tiles)
│ └── tagimg.png ← Tag image (if set)
├── tag_1/
│ └── index.html ← Sub-page for tag "Configuration Guide"
├── a/ ← Individual project HTML (same as before)
└── b/
- Top page: Lists tags as cards. Clicking a card navigates to that tag's sub-page.
- Tag sub-page: Lists the projects belonging to that tag, with a "← Back to Top" link.
- Untagged projects: Displayed directly at the bottom of the top page under an "(Untagged)" section.
- If no tags are assigned at all, the output uses the traditional flat structure.
3.6. Importing a Project
You can bring existing documents in as a project. The buttons become active after you select a workspace.
3.6.1. Import from Markdown File
Select a Markdown (.md) text file to import it as a project.
Use this when you want to edit and manage existing Markdown documents in Manidoc.
3.6.2. Import from HTML File
Select an HTML (.html) file to import it as a project.
Works with saved web pages or documents written in HTML.
3.6.3. Import from Web
Enter a URL to pull a web page in directly. The contents of a publicly accessible page can be imported and edited as a Manidoc project.
4. Editing a Project
Double-click a project to open the editing screen. The screen is divided into three columns: left, center, and right.
4.1. Toolbar Operations
The toolbar at the top of the editing screen gives you quick access to the most common operations.
4.1.1. Saving
Click the "Save" button to save all nodes of the current project to disk.
4.1.2. Reloading
Click the "Reload" button to reload the latest content from disk. Use this when the file has been changed externally, or when you want to discard unsaved changes and revert to the saved state.
4.1.3. Launching the Browser
Enter a URL and click the "Launch Browser" button to open that page in the built-in browser. You can combine this with the capture feature to import screenshots of that page as a node image.
4.1.4. Switching the Theme (Light / Dark)
Click the "Toggle Theme" button in the toolbar to switch the entire app between light mode and dark mode. The setting is remembered the next time you launch the app.
4.2. Left Panel — Node List (Structure Tree)
This is a table-of-contents-like list for your document. Click a node to display its content in the center panel. Adding a Node Click the "+ Add Item" button to add a new node. Right-clicking on the node list opens a context menu with the following options: Reordering Nodes You can use drag & drop or the arrow buttons. Drag & Drop:
- Drag a node and drop it onto the upper half of a target node to insert it immediately before that node at the same level (a blue line is shown)
- Drag a node and drop it onto the lower half of a target node to add it as a child of that node (a blue background is shown)
- Dropping onto a node's own descendants is automatically blocked (to prevent circular references) Arrow Buttons:
- ↑ / ↓ move the node one step within the same level
- ← promotes the node to the same level as its parent; → demotes it to become a child of the preceding sibling Deleting a Node Click the trash icon (🗑) to delete. Deleted nodes cannot be restored, so be careful. Blinking Highlight for the Selected Node The currently selected node blinks slowly in a color that depends on the theme.
- Dark mode: blue blink
- Light mode: green blink This makes it easy to see which node you are working on at a glance.
Keyword Search
Type a keyword in the search box at the top of the left panel and press Enter to search across all nodes' titles, articles, and comments.
Clicking a search result displays that node and highlights/selects the keyword in the editor.
Keyword Replace
Type the replacement text in the replace box below the search box and press Enter to enter replace mode.
Replace saves a snapshot per node and area (article / comment / title). Clicking [Undo] reverts that node-area to the state before its first replacement in this session.
4.3. Center Panel — Node Editing
This is where you enter and edit the content of the selected node.
4.3.1. Entering a Title
Type the heading in the text field at the top.
4.3.2. Writing the Article (Body)
This is the main text area. Toolbar buttons let you apply formatting such as bold, italic, strikethrough, bullet lists, numbered lists, and tables. Frequently used buttons: Click the "✨ AI Assistant" button to have the AI suggest improvements to your text. Click the "📝 Expand Editor" button to edit in a larger window.
4.3.3. Changing the Display Scale (Zoom)
Click the "−" and "+" buttons at the right end of the toolbar to change the text zoom level.
The current level is shown as a percentage between the buttons (e.g. 100%).
You can also use Ctrl + Mouse Wheel to zoom.
- Range: 50% – 300%
- The setting is stored separately for the article and comment areas
- The zoom level is restored the next time you launch the app
4.3.4. Setting an Image
You can attach one image to a node.
- "Select Image": Choose an image file from your computer
- "✨ Generate Image with AI": Describe the image in text and the AI generates it automatically
- "Edit": Add cropping, borders, or text to the image
- "Clear": Remove the attached image
Image files are automatically saved to the
imagesfolder inside the project folder.
4.3.5. Image Area Resize Buttons
Buttons above and below the image area let you resize the panels to suit your work.
4.3.6. Writing a Comment (Supplement)
A separate field for notes, cautions, or supplementary information. Shown below the article as a "Supplement" section in HTML export.
4.4. Right Panel — Preview
View a real-time HTML rendering of your edited content. Use the slider to adjust the display scale (25%–150%).
5. Capturing Screens into Nodes
Easily insert screenshots of other application windows — the kind you use constantly in a manual.
5.1. Steps
- Click the "Attach to App" button
- Select the application window you want to capture from the list and click "Select" (Manidoc itself appears at the top of the list)
- Select the target node in the left panel
- Click the "Capture" button — a screenshot of the selected window is inserted as the node image
5.2. Capturing Browser Operations
- Enter an address in the URL field and click the "Launch Browser" button
- The browser starts automatically and Manidoc detects its window
- Navigate to the screen you want in the browser, then click the "Capture" button
6. Using AI Features
Manidoc includes several AI features. You will need to configure an AI provider to use them. (Go to "⚙ Settings" → "AI Model" tab to configure.) Supported AI providers:
- Gemini API (Google) — Cloud-based. Obtain an API key from Google AI Studio.
- Local LLM (LM Studio, etc.) — Runs locally. Start LM Studio and set the endpoint URL.
6.1. AI Chat (AI Agent Tab)
Chat with the AI in the "AI Agent" tab on the start screen. You can discuss your manual content, ask the AI to research information, and more. Main buttons:
6.2. Improving Text with AI (While Editing Articles / Comments)
Click the "✨ AI Assistant" button in the editing area to have the AI suggest improvements to your text. Enter instructions for how you want it revised, then click "Run". After reviewing the suggestion, click "Apply to Content" to insert it into the body.
Note: Using the AI Assistant will remove any text formatting such as font color and font size. If you want to preserve formatting, apply it after using the AI Assistant.
6.3. Generating Images with AI
In the node editing screen, describe the image you want to create in the "Additional Instructions for AI" field. Example: "A diagram showing how to press a blue button" Click the "✨ Generate Image with AI" button to create the image.
7. Exporting
You can export your projects to HTML or Markdown.
7.1. HTML Export
Click the "HTML Export" button on the project editing screen.
An index.html is created in the export folder. Simply open it in a browser to view it.
HTML export automatically includes the following features:
- Table of contents menu (hamburger menu on the left)
- Section numbering (toggle on/off in settings)
- Text-to-speech button (toggle on/off in settings)
- Automatic image compression (toggle on/off in settings)
7.1.1. Adding a Table of Contents
Turn on the "Include TOC" checkbox in the toolbar to auto-generate a table of contents at the top of the page when exporting to HTML. Uncheck it to export without a table of contents.
7.2. Markdown Export
Click the "MD Export" button on the project editing screen.
The project content is saved as a .md file.
7.3. Bulk Web Export (All Projects)
Click the "🌐 Bulk Web Export" button on the start screen to export all projects in the workspace together as a single website.
Open the exported index.html to see a listing page for all projects.
8. Customizing Themes (Design)
You can change the design used in HTML exports.
8.1. Switching Light / Dark Theme
Click the "🌙 Toggle Theme" button in the top-right of the start screen to switch between light and dark mode. The setting is remembered the next time you launch the app.
8.2. Choosing an Existing Theme
Select from the "CSS Theme" dropdown in the top-right of the project editing screen.
8.3. Creating an Original Theme with AI
Click the "🎨 AI Theme Creator" button in the top-right of the start screen. Describe the design you want in text and click "✨ Generate CSS with AI" to create an original design theme. If you like it, click "Export & Save" to save it as a theme.
Note: AI Theme Creator requires the Gemini API. It is not available when using a Local LLM (LM Studio, etc.).
8.4. Editing a Theme File Directly
You can open a saved theme file ({workspace}/themes/ThemeName.css) in any text editor and edit it directly.
Theme files are primarily made up of a :root { } block (variable definitions for colors, font sizes, etc.), but you can also add other CSS rules beyond that block.
/* :root variable definitions — this part is generated by AI Theme Creator */
:root {
--primary-color: #0056b3;
--main-bg-color: #FAF7F2;
}
/* You can freely add rules below — they are preserved in HTML export */
h2 {
border-left: 4px solid var(--primary-color);
padding-left: 8px;
}
.comment-section {
font-style: italic;
}
Rules added outside
:rootare not overwritten during HTML export. After editing the file, you can apply it to the project and export right away.
9. Viewing Help
When you are not sure how to do something, Help Mode lets you jump directly to the relevant section of the manual.
9.1. Using Help Mode
- Click the "?" button in the top-right toolbar of the project editing screen to turn on Help Mode.
- The cursor changes to a question mark (❓).
- Click the UI element (button, editor, panel, etc.) you want to learn about.
- The normal action is suppressed; the help window opens instead.
- The manual automatically scrolls to the relevant section and highlights it in orange.
- To close help, click the "?" button again to turn off Help Mode.
9.2. About the Help Window
- The help window appears on the right side of the screen.
- You can freely resize and move the window.
- Once opened, the window is reused when you click on other elements (it scrolls without reloading the page).
9.3. Searching Inside the Help Window
Move focus to the help window and press Ctrl+F to open the in-page search bar. Type a keyword to highlight matching sections of the manual.
Tip: While Help Mode is active, all normal app interactions are disabled. Every click is treated as a help-jump.
10. Backup and Restore
We recommend backing up your important data regularly.
10.1. Backing Up a Single Project
Click the "Backup" button on the project list to save that project as a ZIP file.
10.2. Backing Up the Entire Workspace
Click the "💾 WS Backup" button on the start screen to save all projects together as a ZIP file.
10.3. Restoring
Click the "📂 WS Restore" or "PJ Restore" button and select the backup ZIP file to restore your data.
11. Script Feature (Macros)
In the "Scripts" tab, you can run automated processes (macros) written in JavaScript. This is useful for "processing multiple projects at once" or "automating the same operations every time". Even without programming knowledge, you can ask the AI to write scripts for you instantly.
11.1. Where to Store Script Files
Save .js files to the scripts folder inside your workspace folder.
Click the "📁 Open Folder" button to open that folder directly.
11.2. Running a Script
- Click the "🔄 Refresh" button to update the list
- Click the "▶ Run" button next to the script you want to execute
- The output appears in the log area at the bottom of the screen
- To stop mid-run, click the "⏹ Stop" button
11.3. Having the AI Write Scripts for You
You can delegate script writing to an AI such as ChatGPT or Gemini. Follow these steps:
- Give the AI the Manidoc Script API Reference (the section at the end of this manual)
- Explain what you need in plain language: "Write me a script that does ○○"
- Save the generated script to the
scriptsfolder and run it
Example: "Write a script that lists all projects and exports them to a CSV file"
11.4. What Scripts Can Do
11.4.1. ① Auto-generate text with AI, collect information, and batch-create from templates
Prepare a list of product names or topics and the AI automatically writes a document for each one.
// Load a product list and have AI auto-generate a manual for each product
var products = manidoc.readFile("data/products.txt").split("\n");
for (var i = 0; i < products.length; i++) {
var name = products[i].trim();
if (name === "") continue;
var md = manidoc.askAIText(name + "の操作マニュアルをMarkdownで書いてください。## で章を分けること。");
var proj = manidoc.createProject(name + " マニュアル");
var top = proj.addNode("はじめに");
top.importMarkdown(md);
proj.save();
manidoc.log(name + " 完了");
}
11.4.2. ② Automatically capture screenshots and attach them to nodes
Capture application screens in sequence and automatically insert them into the corresponding nodes.
// Capture an app's screens in sequence and attach them to nodes
var proj = manidoc.openProject("操作マニュアル");
var steps = ["ログイン画面", "メインメニュー", "設定画面"];
for (var i = 0; i < steps.length; i++) {
var node = proj.findNode(steps[i]);
if (node === null) node = proj.addNode(steps[i]);
var path = manidoc.captureWindow("MyApp", "screenshots/" + i + ".png");
node.setImage(path);
manidoc.log(steps[i] + " キャプチャ完了");
manidoc.sleep(1000);
}
proj.save();
11.4.3. ③ Run external commands such as FTP and Git directly from a script
HTML export → Git commit → FTP upload, all in one button click.
// Export HTML, commit to Git, then upload via FTP
var proj = manidoc.openProject("製品マニュアル");
var htmlPath = proj.exportHtml(true);
manidoc.log("HTML出力: " + htmlPath);
// Git commit
var git = manidoc.execute("git add . && git commit -m \"マニュアル更新\"");
manidoc.log(git.success ? "Gitコミット完了" : "Gitエラー: " + git.error);
// FTP upload
var ftp = manidoc.execute("curl -T export/index.html ftp://user:pass@example.com/public_html/", 60);
manidoc.log(ftp.success ? "FTPアップロード完了" : "FTPエラー: " + ftp.error);
11.4.4. ④ Publish and share in HTML and Markdown formats
Batch-export all projects in both formats at once.
// Batch-export all projects in both HTML and Markdown
var names = manidoc.getProjects();
manidoc.log("対象: " + names.length + " プロジェクト");
for (var i = 0; i < names.length; i++) {
var proj = manidoc.openProject(names[i]);
if (proj === null) continue;
var html = proj.exportHtml(true);
var md = proj.exportMarkdown();
manidoc.log(names[i] + " → HTML: " + html);
manidoc.log(names[i] + " → MD: " + md);
}
manidoc.log("一括書き出し完了");
12. Settings
Click "⚙ Settings" in the top-right of the start screen to change various settings.
12.1. AI Model Tab
About the Gemini API Key You can get one for free at Google AI Studio, but Web search (Grounding) and image generation may require a paid plan.
About Local LLM Start a local inference server such as LM Studio and enter its endpoint URL. Web search and image generation are not supported. No API key is required.
12.2. Export Settings Tab
13. Keyboard Shortcuts
14. Frequently Asked Questions
14.1. Q. The AI does not respond
Check that your API key is configured in "⚙ Settings". If you have exceeded the free tier, wait a while and try again.
14.2. Q. My project does not appear in the list
Verify that the correct workspace folder is selected.
14.3. Q. Images are not showing in the HTML export
Moving the export folder to a different location can break image paths. Copy and move the entire folder together.
14.4. Q. I don't know how to write scripts
Copy the "Script API Reference" section at the end of this manual and give it to ChatGPT, Gemini, or another AI along with a description like "Write me a script that does ○○" — it will produce a working script right away.
15. Script API Reference
This section is a specification sheet to include when asking an AI to write scripts for you.
Scripts are written in JavaScript and control Manidoc through the manidoc object.
Limitations
- Memory limit: 32 MB
- Execution time: 60 seconds by default (stops automatically when exceeded). Use
manidoc.setTimeout()to change (see below)- File operations are limited to within the workspace folder
15.1. Basic Syntax
// Output to log
manidoc.log("Starting process");
// Create a project and add a node
var proj = manidoc.createProject("Manual Name");
var node = proj.addNode("Introduction");
node.article = "Write the body text here.";
proj.save();
manidoc.log("Done");
15.2. manidoc Object — Project Operations
15.2.1. manidoc.createProject( projectName )
Creates a new project.
var proj = manidoc.createProject("新しいマニュアル");
15.2.2. manidoc.openProject( projectName )
Opens an existing project by name. The name is matched by partial match.
Returns null if not found.
var proj = manidoc.openProject("社内システム");
if (proj === null) {
manidoc.log("プロジェクトが見つかりません");
}
15.2.3. manidoc.openProjectByRegex( regexPattern )
Opens a project whose name matches a regular expression pattern.
Useful when you don't know the exact name or want to filter by condition.
Returns null if not found.
// Open a project whose name contains "2026"
var proj = manidoc.openProjectByRegex("2026");
// Open a project whose name starts with "製品"
var proj = manidoc.openProjectByRegex("^製品");
if (proj === null) {
manidoc.log("該当プロジェクトが見つかりません");
}
15.2.4. manidoc.getProjects()
Returns an array of all project names in the workspace.
var names = manidoc.getProjects();
for (var i = 0; i < names.length; i++) {
manidoc.log(names[i]);
}
15.2.5. manidoc.deleteProject( projectName )
Permanently deletes a project. This cannot be undone.
manidoc.deleteProject("不要なプロジェクト");
15.2.6. manidoc.importFromMarkdown( filePath )
Imports a project from a Markdown file. The path can be specified relative to the workspace folder.
var proj = manidoc.importFromMarkdown("docs/manual.md");
15.3. Project (proj) Operations
Use these on the object returned by createProject or openProject.
15.3.1. Properties
15.3.2. proj.save()
Saves changes to disk. Always call this after making edits.
proj.name = "新しい名前";
proj.save();
15.3.3. proj.addNode( title )
Adds a root node. Returns the added node.
var node = proj.addNode("第1章 基本操作");
15.3.4. proj.getNode( title )
Searches for a root node by title (exact match).
var node = proj.getNode("第1章 基本操作");
15.3.5. proj.findNode( title )
Searches all levels (including child nodes) by title.
var node = proj.findNode("ログイン方法");
15.3.6. proj.getNodes()
Returns all root nodes as an array.
var nodes = proj.getNodes();
for (var i = 0; i < nodes.length; i++) {
manidoc.log(nodes[i].title);
}
15.3.7. proj.removeNode( title )
Removes the root node with the specified title.
proj.removeNode("不要な章");
proj.save();
15.3.8. proj.exportHtml( includeToc )
Exports the project as an HTML file.
Returns the path of the output index.html.
var path = proj.exportHtml(true); // true = include table of contents
manidoc.log("出力先: " + path);
15.3.9. proj.exportMarkdown()
Exports the project as a Markdown file. Returns the path of the output file.
var path = proj.exportMarkdown();
manidoc.log("出力先: " + path);
15.4. Node (node) Operations
Use these on the object returned by addNode / getNode / findNode, etc.
15.4.1. Node Properties
node.title = "ログイン方法";
node.article = "## 手順\n1. ID を入力\n2. パスワードを入力\n3. ログインボタンを押す";
node.comment = "パスワードは8文字以上が必要です。";
proj.save();
15.4.2. node.addChild( title )
Adds a child node.
var parent = proj.addNode("基本操作");
var child = parent.addChild("ログイン方法");
child.article = "ログインの手順です。";
proj.save();
15.4.3. node.getChild( title )
Searches for a direct child node by title.
var child = node.getChild("ログイン方法");
15.4.4. node.getChildren()
Returns all child nodes as an array.
var children = node.getChildren();
15.4.5. node.setImage( imageFilePath )
Attaches an image file to the node.
The file is automatically copied to the project's images folder.
node.setImage("screenshots/login.png");
proj.save();
15.4.6. node.setOptimizedImage( imageFilePath, quality, maxSize )
Compresses and attaches an image to the node. Use this to reduce file size.
// Resize to a max of 1920px at quality 80 and attach
node.setOptimizedImage("screenshots/login.png", 80, 1920);
proj.save();
15.4.7. node.clearImage()
Removes the image attached to the node.
node.clearImage();
proj.save();
15.4.8. node.importMarkdown( markdownText )
Parses Markdown text and adds it as child nodes of this node. Handy for passing AI responses directly to auto-generate a node structure.
- The leading
# Headingis used as the title of this node - Headings from
##onward become child nodes (hierarchy is preserved) - Returns an array of the added child nodes
var node = proj.addNode("第1章 基本操作");
// Have AI write the content in Markdown, then expand it as child nodes
var md = manidoc.askAIText("「基本操作」の操作マニュアルを Markdown で書いて。## で各手順を分けること。");
node.importMarkdown(md);
proj.save();
15.5. manidoc Object — Screen Capture
15.5.1. manidoc.captureWindow( windowTitle, savePath )
Captures the window with the specified title and saves it as an image file. The window title is matched by partial match.
var path = manidoc.captureWindow("Google Chrome", "screenshots/chrome.png");
node.setImage(path);
proj.save();
15.5.2. manidoc.captureSelf( savePath )
Captures the Manidoc window itself and saves it. No window title is needed.
var path = manidoc.captureSelf("screenshots/manidoc.png");
node.setImage(path);
proj.save();
15.6. manidoc Object — File Operations
All paths are specified relative to the workspace folder.
15.6.1. manidoc.readFile( path )
Reads a text file and returns its contents.
var text = manidoc.readFile("data/list.txt");
15.6.2. manidoc.writeFile( path, content )
Writes a text file. Creates the file if it does not exist.
manidoc.writeFile("output/result.txt", "Process complete");
15.6.3. manidoc.fileExists( path )
Checks whether a file or folder exists.
if (manidoc.fileExists("data/list.txt")) {
manidoc.log("File found");
}
15.6.4. manidoc.deleteFile( path )
Deletes a file or folder.
manidoc.deleteFile("output/old_result.txt");
15.7. manidoc Object — Log and Info
15.7.1. manidoc.log( message )
Records a message in the execution log. Displayed in the log area of the Scripts tab.
manidoc.log("Process complete");
15.7.2. manidoc.getLog()
Returns all log messages recorded so far as a single string.
var allLog = manidoc.getLog();
15.7.3. manidoc.saveLog( savePath )
Saves the current log to a file.
manidoc.saveLog("logs/run_log.md");
15.7.4. manidoc.now()
Returns the current date and time as a string in yyyy/MM/dd HH:mm:ss format.
manidoc.log("Run time: " + manidoc.now());
15.7.5. manidoc.getWorkspacePath()
Returns the absolute path of the workspace folder.
manidoc.log("Workspace: " + manidoc.getWorkspacePath());
15.7.6. manidoc.sleep( milliseconds )
Pauses execution for the specified number of milliseconds.
manidoc.sleep(1000); // Wait 1 second
15.7.7. manidoc.version()
Returns the Script API version.
manidoc.log("API version: " + manidoc.version());
15.7.8. manidoc.setTimeout( seconds )
Changes the script execution timeout. Must be placed at the very first line of the script. Writing it later has no effect.
// Example 1: Extend the timeout to 5 minutes (300 seconds)
manidoc.setTimeout(300);
// Example 2: Disable the timeout (for long batch processes)
manidoc.setTimeout(0);
manidoc.log("Starting process");
// ... long process ...
manidoc.log("Done");
Note:
setTimeout(0)can cause Manidoc to become unresponsive if the script contains a long-running or infinite loop. It is recommended to specify the minimum number of seconds needed.
15.8. Browser Recording
Press the 🔴 Record button in the project view to launch a Chromium browser and automatically record your interactions.
15.8.1. Recording Control Window
A floating window appears at the top-left of the screen when the browser launches. The window can be moved by dragging.
15.8.2. Note on 📷 Manual Capture
Capture image save location: {ProjectFolder}/captures/cap_yyyyMMdd_HHmmss_NNN.png
⚠ If the browser is closed, pressing 📷 does nothing (no error message is shown). Make sure the browser window is open before pressing the button. You can also check the state with
browser.isOpen().
15.8.3. About DevTools Breakpoints
⚠ If you have set breakpoints in the browser's developer tools (DevTools), the following issues may occur.
Situation Effect Stopped at a breakpoint during recording Clicks and inputs while paused are not recorded (gaps appear in the script) Stopped at a breakpoint during playback Waits until timeout (~30 seconds), then skips to the next action DevTools open but no breakpoints Generally no effect It is recommended to remove all breakpoints before recording or playing back.
15.8.4. Generated Script
Pressing ⏹ Stop & Save generates {workspace}/scripts/rec_yyyyMMdd_HHmmss.js.
Running it from the Scripts tab replays the same operations in Chromium.
15.9. Browser Operation API
15.9.1. manidoc.openBrowser( url )
Launches Microsoft Edge or Google Chrome (whichever is installed on the system) and returns a browser operation object. Cannot launch if neither Edge nor Chrome is installed.
var browser = manidoc.openBrowser("https://example.com");
// Always close the browser when done
browser.close();
Methods on the returned object: Selector examples:
browser.click("#login-btn"); // ID
browser.fill("[name='username']", "admin"); // name attribute
browser.click("text=ログイン"); // text
browser.fill("[placeholder='パスワード']", "pass"); // placeholder
Screenshot save location:
Screenshots are automatically saved to the captures/ folder in the workspace.
var path = browser.screenshot(); // "captures/cap_20260306_143022_000.png"
var node = proj.addNode("Step 1");
node.setImage(path);
15.10. manidoc Object — Input / Selection Dialogs
You can prompt the user for input or a selection while a script is running.
15.10.1. manidoc.inputBox( message )
Displays a text input dialog.
Returns the entered string when OK is clicked. Returns an empty string "" if cancelled.
var name = manidoc.inputBox("Enter the project name");
if (name === "") {
manidoc.log("Cancelled");
} else {
var proj = manidoc.createProject(name);
proj.save();
}
15.10.2. manidoc.selectionBox( message, choices )
Displays a selection dialog with a combo box.
Choices are specified as a comma-separated string.
Returns the selected value when OK is clicked. Returns an empty string "" if cancelled.
var category = manidoc.selectionBox("Select a category", "Operations Manual,Configuration Guide,FAQ,Release Notes");
if (category !== "") {
manidoc.log("Selected: " + category);
}
15.11. manidoc Object — AI Integration
You can delegate processing to the AI from a script. An API key must be configured.
15.11.1. Method Summary
instructionPathis a.mdfile specified relative to the workspace- Set
webSearchtotrueto use internet search (paid plans only; ignored when using Local LLM) systemPromptis optional
15.11.2. Result Object (returned by
{
success: true, // Whether it succeeded
response: "...", // AI response text (when success=true)
error: "" // Error message (when success=false)
}
15.11.3. Usage Examples
// ── Pattern 1: Simple call ──────────────────────────
try {
var md = manidoc.askAI("prompts/request.md");
var proj = manidoc.importFromMarkdown("temp/draft.md");
manidoc.writeFile("temp/draft.md", md);
proj.save();
manidoc.log("Done: " + proj.name);
} catch (e) {
manidoc.log("Error: " + e.message);
}
// ── Pattern 2: Receive error in a variable ─────────────────────
var result = manidoc.askAIResult("prompts/request.md");
if (!result.success) {
manidoc.log("Failed: " + result.error);
} else {
manidoc.log(result.response);
}
// ── Pattern 3: Pass text directly ─────────────────────────
var r = manidoc.askAITextResult("Write Python installation instructions in Markdown");
if (r.success) manidoc.log(r.response);
Note:
webSearch: trueonly works with a paid-plan API key. Free-tier keys will get a 400/403 error.
15.12. manidoc Object — Test Support
Features for verifying behavior and running tests in scripts.
15.12.1. manidoc.testStart( testName )
Starts a test case.
manidoc.testStart("Project Creation Test");
15.12.2. manidoc.assert( condition, message )
Records a FAIL if the condition is false.
var proj = manidoc.openProject("テスト");
manidoc.assert(proj !== null, "Project should exist");
15.12.3. manidoc.assertEqual( expected, actual, message )
Records a FAIL if the two values are not equal.
manidoc.assertEqual(3, proj.nodeCount, "Node count should be 3");
15.12.4. manidoc.assertFileExists( path, message )
Records a FAIL if the file does not exist.
manidoc.assertFileExists("output/result.html", "HTML should have been exported");
15.12.5. manidoc.testPass( message ) / manidoc.testFail( message )
Explicitly records a test result.
if (proj !== null) {
manidoc.testPass("Project found");
} else {
manidoc.testFail("Project not found");
}
15.12.6. manidoc.getTestSummary()
Returns a summary of test results in { total, passed, failed, results[] } format.
var summary = manidoc.getTestSummary();
manidoc.log("Total: " + summary.total + " / Passed: " + summary.passed + " / Failed: " + summary.failed);
15.13. manidoc Object — External Command Execution
15.13.1. manidoc.execute( command, timeoutSeconds )
Executes an external command. Lets you call tools like Git and SFTP from a script.
The timeout defaults to 30 seconds if omitted.
Returns an object in { success, exitCode, output, error } format.
var result = manidoc.execute("git status");
if (result.success) {
manidoc.log(result.output);
} else {
manidoc.log("Error: " + result.error);
}
Warning: Be careful not to accidentally run destructive commands such as delete operations.
15.14. manidoc Object — Script Management
15.14.1. manidoc.listScripts( subfolderName )
Returns a list of script file paths registered in manifest.json inside the specified folder.
Defaults to the "recordings" folder if the subfolder name is omitted.
var scripts = manidoc.listScripts("recordings");
for (var i = 0; i < scripts.length; i++) {
manidoc.log(scripts[i]);
}
15.14.2. manidoc.runScript( scriptPath )
Adds another script file to the execution queue. It will be executed in order after the current script finishes.
manidoc.runScript("scripts/export_all.js");
15.15. Script Examples
15.15.1. Example 1: Log all project names
var names = manidoc.getProjects();
manidoc.log("Project count: " + names.length);
for (var i = 0; i < names.length; i++) {
manidoc.log((i + 1) + ". " + names[i]);
}
15.15.2. Example 2: Create a new project with structure
var proj = manidoc.createProject("操作マニュアル");
proj.description = "システムの基本操作説明書";
var ch1 = proj.addNode("第1章 はじめに");
ch1.article = "このマニュアルでは基本的な使い方を説明します。";
var ch2 = proj.addNode("第2章 基本操作");
ch2.addChild("ログイン方法");
ch2.addChild("ログアウト方法");
proj.save();
manidoc.log("Project created: " + proj.name);
15.15.3. Example 3: Capture the Manidoc screen and attach it to a node
var proj = manidoc.openProject("操作マニュアル");
var node = proj.findNode("ログイン方法");
var imgPath = manidoc.captureSelf("screenshots/login_screen.png");
node.setImage(imgPath);
proj.save();
manidoc.log("Capture complete");
15.15.4. Example 4: Batch-export all projects to HTML
var names = manidoc.getProjects();
for (var i = 0; i < names.length; i++) {
var proj = manidoc.openProject(names[i]);
if (proj !== null) {
var path = proj.exportHtml(true);
manidoc.log(names[i] + " → " + path);
}
}
manidoc.log("Batch export complete");
15.15.5. Example 5: Interactively create a project with dialogs
Ask the user for a name and category during execution, then create the project accordingly.
// Ask the user for a project name
var projName = manidoc.inputBox("Enter the name of the project to create");
if (projName === "") {
manidoc.log("Cancelled");
} else {
// Ask the user to select a category
var category = manidoc.selectionBox(
"Select the document type",
"Operations Manual,Configuration Guide,FAQ,Release Notes,Proposal"
);
var proj = manidoc.createProject(projName);
proj.description = category !== "" ? category : "Document";
// Add an initial structure based on the category
if (category === "Operations Manual") {
proj.addNode("Introduction");
proj.addNode("Basic Operations");
proj.addNode("FAQ");
} else if (category === "FAQ") {
proj.addNode("Installation");
proj.addNode("Usage");
proj.addNode("Troubleshooting");
} else {
proj.addNode("Overview");
proj.addNode("Details");
}
proj.save();
manidoc.log("Created: " + proj.name + " (" + proj.description + ")");
}
15.15.6. Example 6: Auto-generate nodes from CSV data
Read data from a text file and expand it into a node structure.
// Example content of data/chapters.txt:
// Chapter 1: Introduction
// Chapter 2: Basic Operations
// Chapter 3: Advanced Topics
var text = manidoc.readFile("data/chapters.txt");
var lines = text.split("\n");
var proj = manidoc.createProject("自動生成マニュアル");
for (var i = 0; i < lines.length; i++) {
var title = lines[i].trim();
if (title === "") continue;
var node = proj.addNode(title);
node.article = "## " + title + "\n\nEnter content here.";
manidoc.log("Added: " + title);
}
proj.save();
// Log the result to a file
manidoc.writeFile("logs/chapter_import.txt",
manidoc.now() + " " + proj.name + " created (" + proj.nodeCount + " chapters)");
manidoc.log("Done: " + proj.nodeCount + " chapters created");
15.15.7. Example 7: Batch-import Markdown files as projects
Import multiple .md files in a folder as separate projects.
var files = ["input/manual_a.md", "input/manual_b.md", "input/manual_c.md"];
for (var i = 0; i < files.length; i++) {
var path = files[i];
if (!manidoc.fileExists(path)) {
manidoc.log("Skipped (file not found): " + path);
continue;
}
manidoc.log("Importing: " + path);
var proj = manidoc.importFromMarkdown(path);
proj.save();
var htmlPath = proj.exportHtml(true);
manidoc.log("Done: " + proj.name + " → " + htmlPath);
}
manidoc.log("All imports complete: " + manidoc.now());
15.15.8. Example 8: Filter projects with regex and update them
Find old projects containing "2025" and automatically replace the year.
var names = manidoc.getProjects();
var count = 0;
for (var i = 0; i < names.length; i++) {
// Target projects whose name contains "2025"
if (names[i].indexOf("2025") === -1) continue;
var proj = manidoc.openProject(names[i]);
if (proj === null) continue;
var oldName = proj.name;
proj.name = oldName.replace("2025", "2026");
proj.save();
manidoc.log("Updated: " + oldName + " → " + proj.name);
count++;
}
manidoc.log("Update complete: " + count + " item(s)");
15.15.9. Example 9: Automate browser and capture screens
Log into a web system and capture the main screens in sequence, attaching them to nodes.
var proj = manidoc.openProject("Webシステム操作マニュアル");
if (proj === null) proj = manidoc.createProject("Webシステム操作マニュアル");
var browser = manidoc.openBrowser("https://example.com/login");
// Login
browser.fill("[name='username']", "admin");
browser.fill("[name='password']", "password");
browser.click("text=ログイン");
browser.waitForUrl("dashboard");
// Capture the dashboard screen
var node1 = proj.addNode("Dashboard");
var shot1 = browser.screenshot();
node1.setImage(shot1);
node1.article = "This is the top screen shown after login.";
// Navigate to settings and capture
browser.goto("https://example.com/settings");
var node2 = proj.addNode("Settings Screen");
var shot2 = browser.screenshot();
node2.setImage(shot2);
node2.article = "The screen where you change various settings.";
browser.close();
proj.save();
manidoc.log("Capture complete: " + proj.nodeCount + " screen(s)");
15.15.10. Example 10: Re-optimize all node images
Compress and resize all images in a project to reduce file size.
var proj = manidoc.openProject("操作マニュアル");
var nodes = proj.getNodes();
var count = 0;
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
var imgPath = node.imagePath;
if (imgPath === "" || imgPath === null) continue;
// Optimize at quality 80, max 1280px and overwrite
node.setOptimizedImage(imgPath, 80, 1280);
count++;
manidoc.log("Optimized: " + node.title);
}
proj.save();
manidoc.log("Optimization complete: " + count + " image(s) processed");
15.15.11. Example 11: Verify project content with the test feature
Automatically check that required items are present in all manuals.
manidoc.log("Quality check started: " + manidoc.now());
var names = manidoc.getProjects();
for (var i = 0; i < names.length; i++) {
var proj = manidoc.openProject(names[i]);
if (proj === null) continue;
manidoc.testStart(proj.name);
// At least one root node must exist
manidoc.assert(proj.nodeCount > 0, "Nodes must exist");
// An "Introduction" or "Overview" node must exist
var intro = proj.findNode("はじめに");
var overview = proj.findNode("概要");
manidoc.assert(intro !== null || overview !== null, "An introductory node must exist");
// An HTML export file must exist
var htmlExists = manidoc.fileExists("export/" + proj.name + "/index.html");
manidoc.assert(htmlExists, "HTML must have been exported");
}
var summary = manidoc.getTestSummary();
manidoc.log("Check result: " + summary.passed + "/" + summary.total + " passed");
// Save the result to a file
manidoc.saveLog("logs/quality_check_" + manidoc.now().replace(/[/ :]/g, "") + ".txt");