1 stable release

1.0.0 Nov 9, 2020

#10 in #brackets

MIT license

13KB
270 lines

XMLB

XML but with Brackets

What

<root>
  <foo1>Some text</foo1>
  <bar thing="4"/>

  <!-- Comment 1 -->
  <!-- Comment 2 -->

  <baz foo1="bar1" foo2="bar2" foo3="3">
    <foo2>
      Some more text

      <!--
        Multi
        Line
        Comment
      -->
    </foo2>
  </baz>
</root>

Becomes

<root> {
  <foo1> { Some text }
  <bar thing="4">

  // Comment 1
  // Comment 2

  <baz foo1="bar1" foo2="bar2" foo3="3"> {
    <foo2> {
      Some more text

      /*
        Multi
        Line
        Comment
      */
    }
  }
}

XML But with Brackets!

How

use xmlb::XMLBFile;

fn main() {
    let source: String = xmlb_source_code;

    let xmlb_file = XMLBFile::from_string(source);

    // Convert to xml
    let xml = xmlb_file.to_xml(true); // true or false to keep comments or not
}

Dependencies

~2MB
~45K SLoC