Super fast and efficient Markdown to Jira Confluence Markup Converter powered by Rust and WebAssembly (Wasm). This tool allows users to seamlessly convert Markdown content into Confluence-compatible markup for enhanced documentation workflows.
- Lightning Fast: Built with Rust for optimal speed and performance.
- Web Ready: Powered by Wasm for live usage in web applications.
- Markdown to Confluence: Converts Markdown elements like:
- Headings (
#,##, etc.) into Confluence-style headings (h1.,h2., etc.). - Lists (
-or1.) into Confluence lists. - Code blocks into
{code}blocks with language highlighting. - Inline code into
{code}inline styles. - Emphasis and strong text into
_and*.
- Headings (
- Advanced Features:
- Handles HTML within Markdown for raw HTML passthrough.
- Tracks list nesting levels for accurate rendering.
- Customizable support for additional Markdown attributes (
id,class, etc.).
- Simple API: Easy-to-use function for converting Markdown strings to Confluence markup.
- Add the Wasm module to your project.
- Initialize the Wasm package and call the
convert_markdown_to_confluencefunction.
Example (JavaScript):
import init, {
convert_markdown_to_confluence,
} from "./markdown_to_confluence_converter.js";
async function convert() {
await init(); // Initialize the Wasm module
const markdown = `
# Welcome
## Subheading
- Bullet item 1
- Bullet item 2
\`\`\`rust
fn main() {
println!("Hello, Confluence!");
}
\`\`\`
`;
const result = convert_markdown_to_confluence(markdown);
console.log(result);
}
convert();Add this converter as part of your Rust application:
-
Import the module:
use your_crate::convert_markdown_to_confluence;
-
Convert Markdown directly:
fn main() { let markdown = " # Heading - Item 1 - Item 2 ```rust println!(\"Hello, Confluence!\"); ``` "; let confluence_markup = convert_markdown_to_confluence(markdown); println!("{}", confluence_markup); }
- Parses Markdown using
pulldown_cmark. - Translates Markdown elements into Confluence-style syntax:
- Headings: Maps Markdown headers (
#,##, etc.) toh1.,h2., etc. - Lists: Handles both ordered and unordered lists with proper nesting.
- Code Blocks: Converts fenced or indented blocks to
{code}sections. - Inline Styles: Supports emphasis (
_), strong text (*), and inline code ({code}).
- Headings: Maps Markdown headers (
We welcome contributions to make this converter even better! Follow these steps to get started:
-
Clone the repository:
git clone https://github.com/your-username/markdown-to-confluence.git cd markdown-to-confluence -
Build the Wasm module:
wasm-pack build --target web
-
Test the project locally with your Markdown examples.
Feel free to open issues or submit pull requests on GitHub.
This project is licensed under the MIT License.
For questions or feedback, feel free to open an issue or contact us at [email protected].
