#compiler #markdown #nmd

bin+lib nmd-core

Official NMD compiler core

8 unstable releases (3 breaking)

new 0.40.0 Sep 1, 2024
0.39.0 Aug 6, 2024
0.38.0 Aug 2, 2024
0.37.4 Aug 1, 2024
0.37.0 Jul 31, 2024

#1797 in Development tools

Download history 258/week @ 2024-07-26 321/week @ 2024-08-02 14/week @ 2024-08-09 2/week @ 2024-08-16 3/week @ 2024-08-23 156/week @ 2024-08-30

185 downloads per month
Used in nmd

Custom license

4MB
9K SLoC

Rust 7.5K SLoC // 0.0% comments JavaScript 1K SLoC // 0.0% comments

Logo

License Version

NMD core

nmd-core is the core of NMD. It can be used to load and build NMD files or dossier.

If you want know more about NMD, please, you should open this link.

To get start add nmd-core to your project:

cargo add nmd-core

let dossier_path = PathBuf::from(...)

let format = OutputFormat::Html;

let codex = Codex::of_html(CodexConfiguration::default());


// === Load ===

let loader_configuration = LoaderConfiguration::default();

let mut dossier = Loader::load_dossier_from_path_buf(dossier_path, &codex, &loader_configuration)?;


// === Compile ===

let compilation_configuration = CompilationConfiguration::default();

let compilation_configuration_overlay = Arc::new(RwLock::new(CompilationConfigurationOverLay::default()));

Compiler::compile_dossier(&mut dossier, &format, &codex, &compilation_configuration, compilation_configuration_overlay)?;


// === Assemble ===

let html_assembler_configuration = HtmlAssemblerConfiguration::default();

let artifact = HtmlAssembler::assemble_dossier(&dossier, &html_assembler_configuration)?;


// === Dump === 

let dump_configuration = DumpConfiguration::new(...);

artifact.dump(&dump_configuration)?;

Documentation

Full documentation

NMD Syntax

NMD Standard Syntax

[!WARNING] NMD syntax is working in progress yet, you can contribute following contribution guidelines!

Develop

Develop check list

Known issues

  • Paragraphs and text are not parsed in tables
  • Nested text modifiers could be compiled wrongly (e.g. *this is a **phrase** with some bold*.)
  • List with empty lines between two items
  • Missed tab as modifier
  • Missed style for simples quotes
  • Text between two list items

Author

Nicola Ricciardi

Contributing

If you would like to contribute to the development of the NMD compiler, please follow contribution guidelines.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Dependencies

~12–29MB
~427K SLoC