A command-line tool to convert Markdown files to Trac wiki format.
- Headers: Convert
# Header
to= Header =
- Text Formatting: Bold (
**bold**
→'''bold'''
), Italic (*italic*
→''italic''
), Strikethrough (~~text~~
) - Links:
[text](url)
→[url text]
- Images:

→[[Image(image.png, alt)]]
- Code Blocks: Support for syntax highlighting with language detection
- Tables: Convert Markdown tables to Trac table format
- Lists: Ordered and unordered lists with nesting support
- Checkboxes: Task lists (
- [x] Done
→* [X] Done
) - Blockquotes: Quote formatting
- Horizontal Rules:
---
→----
- Footnotes: Reference-style footnotes
Download the latest release for your platform from the releases page:
- Linux:
md2trac_v*.*.*.linux_amd64.tar.gz
- macOS:
md2trac_v*.*.*.darwin_amd64.tar.gz
- Windows:
md2trac_v*.*.*.windows_amd64.zip
Extract the binary and add it to your PATH.
git clone https://github.com/mi8bi/md2trac.git
cd md2trac
go build -o md2trac ./cmd/md2trac
# Convert input.md to input.wiki
md2trac input.md
# Convert input.md to custom output file
md2trac input.md output.wiki
# Convert documentation.md to trac format
md2trac documentation.md docs/trac-format.wiki
Usage: md2trac input.md [output.wiki]
If output file is not specified, it will be input filename with .wiki extension
# Main Title
## Section Title
### Subsection
↓
= Main Title =
== Section Title ==
=== Subsection ===
**Bold text**
*Italic text*
***Bold and italic***
~~Strikethrough~~
`inline code`
↓
'''Bold text'''
''Italic text''
'''''Bold and italic'''''
~~Strikethrough~~
`inline code`
```python
def hello_world():
print("Hello, World!")
↓
{{{
#!python
def hello_world():
print("Hello, World!")
}}}
| Name | Age | City |
|------|-----|------|
| John | 30 | NYC |
| Jane | 25 | LA |
↓
|| Name || Age || City ||
|| John || 30 || NYC ||
|| Jane || 25 || LA ||
1. First item
2. Second item
- Nested item
- Another nested item
3. Third item
- [x] Completed task
- [ ] Pending task
↓
1. First item
1. Second item
* Nested item
* Another nested item
1. Third item
* [X] Completed task
* [ ] Pending task
Code blocks support syntax highlighting for various languages:
python
,javascript
,java
,c
,cpp
,go
json
(converted to JavaScript highlighting)http
(converted to plain text)html
,css
,xml
- And many more...
- Go 1.24.4 or later
# Clone the repository
git clone https://github.com/mi8bi/md2trac.git
cd md2trac
# Install dependencies
go mod tidy
# Build the binary
go build -o md2trac ./cmd/md2trac
# Run tests
go test ./...
# Run all tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Run specific test
go test ./internal/convert -v
md2trac/
├── cmd/md2trac/ # Main application entry point
│ └── main.go
├── internal/convert/ # Core conversion logic
│ ├── convert.go
│ └── convert_test.go
├── .github/ # GitHub Actions workflows
│ ├── workflows/
│ └── dependabot.yml
├── .goreleaser.*.yaml # Release configuration
├── go.mod # Go module definition
└── README.md # This file
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Add tests for new functionality
- Ensure all tests pass (
go test ./...
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
To add support for new Markdown elements:
- Add the conversion logic to
internal/convert/convert.go
- Add corresponding tests to
internal/convert/convert_test.go
- Update this README with examples
- Nested blockquotes are simplified to single-level quotes
- Complex table formatting (alignment, colspan) is not supported
- Some advanced Markdown features may not have direct Trac equivalents
This project is licensed under the MIT License - see the LICENSE file for details.
See Releases for version history and changes.
- 🐛 Bug Reports: GitHub Issues
- 💡 Feature Requests: GitHub Issues
- 📖 Documentation: This README and inline code comments
- Trac - The project management and bug tracking system
- CommonMark - Markdown specification reference