Skip to content

Alusus library for translating from Markdown to HTML.

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

Alusus/MarkdownTranslator

Repository files navigation

MarkdownTranslator

[عربي]

Alusus library for translating from Markdown to HTML.

Usage

  • Add the library to the project:
import "Apm";
Apm.importFile("Alusus/MarkdownTranslator");
  • Instantiate the class:
def translator: MarkdownTranslator;
  • Convert from MD to HTML:
htmlString = translator.translate(markdownString);

The translate method takes s String and returns a String.

onHtmlTag Function

You can control the creation of HTML tags by setting the onHtmlTag closure, which receives 3 arguments:

  • tag: CharsPtr A string specifying the type of HTML tag being created. For example: h1.

  • sourceText1: String. A string containing the original text extracted from the MD file. This won't include markdown special characters, like #.

  • sourceText2: String. The second text extracted from the MD file for elements that has two pieces of text info, like anchor elements which has a label and a URL.

The closure should return a string, which is the generated HTML tag. If it returns an empty string then MarkdownTranslator will generate the HTML tag itself.


License

Copyright (C) 2026 Sarmad Abdullah

This project is licensed under the GNU Lesser General Public License v3.0 (LGPL-3.0). See the COPYING and COPYING.LESSER files for details.

About

Alusus library for translating from Markdown to HTML.

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Stars

Watchers

Forks

Packages

No packages published