An AI-powered tool for manipulating and managing Markdown files, supporting both script-based and notebook-based workflows. Leveraging the OpenAI API, it provides features for editing, summarizing, and converting Markdown content. Deno is used instead of node for javasript/typescript execution and the deno kernel is used with Jupyter to provide javsacript/typescript notebooks.
-
Clone the Repository:
git clone <repository-url> cd meta-markdown
-
Mount Markdown Directory:
-
Modify
docker-compose.yml
to mount your directory at/markdown
. For example:services: devcontainer: volumes: - ./your-markdown-directory:/markdown
-
-
Configure AI Service:
-
Copy
.env.example
to.env
and add your OpenAI API key:cp .env.example .env
Edit
.env
and set your OpenAI API key:OPENAI_API_KEY=your-openai-api-key
-
-
Run Dev Container from VS Code:
- Open the project in VS Code.
- Install the Dev Containers extension if not already installed.
- Use Reopen in Container to launch the development environment.
-
Install VS Code Extensions:
-
Install the following extensions:
- Deno (
denoland.vscode-deno
) - Jupyter (
ms-toolsai.jupyter
)
- Deno (
-
```
-
Watching Scripts:
-
To watch scripts for changes and automatically re-run them:
deno task watch-scripts
-
-
demo.ts
- Demonstrates Markdown manipulation and AI integration.
- Performs tasks like inserting headings, summarizing content, improving style, and checking grammar.
-
demoUI.ts
- Shows a simple UI interaction example using alert, confirm, and prompt dialogs.
-
To run a specific script, use the
deno run
command with necessary permissions. For example:deno run --allow-read --allow-write src/scripts/grammarCheck.js
Adjust the permissions as required by the script.
-
Opening Notebooks:
- Open the
.ipynb
files in thesrc/notebooks
directory using VS Code.
- Open the
-
Executing Cells:
- Execute the cells to perform AI-based manipulations on Markdown content.
-
Notes:
- Ensure that the Jupyter extension is installed and that the Deno kernel is available.
- Deno caches imports, so you may need to restart the kernel to refresh dependencies.
-
Environment Variables:
OPENAI_API_KEY
: Your OpenAI API key.OPENAI_MODEL
: The OpenAI model to use (default is specified inconfig.ts
).MARKDOWN_DIR
: The directory where your Markdown files are located.
-
Configuration File:
config.ts
contains configuration settings that can be customized.
-
Dependencies and Import Maps:
- The project uses Deno for dependency management.
- Dependencies are specified in
import_map.json
.
-
Logging and Debugging:
- The tool includes logging utilities (
logger.ts
) to assist with debugging.
- The tool includes logging utilities (
-
AI Models and Limits:
- Be aware of the OpenAI API limits and associated costs.
-
Markdown Directory:
- The default Markdown directory is
/workspace/markdown_example
but can be customized inconfig.ts
or via environment variables.
- The default Markdown directory is
Contributions are welcome! Feel free to open issues or submit pull requests.