markdata 1.2.0
Markdown metadata parser
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
markdata
Markdata lets you parse and serialize MultiMarkdown metadata. Additionally it returns a string without the metadata block
markdata doesn't require any additional dependencies and is licensed under LGPL-3.0.
markdata currently supports deserializing into classes and strucs.
Currently you can deserialize the following types: string, string[], Date, DateTime
and any types that can be converted using std.conv.to
.
You can add more types by editing the parseValue function in deserializer.d
Examples
Examples can be found in the examples folder. Here's a snippet of code from the exaple:
import std.file;
import markdata.parser;
import markdata.deserializer;
class Info
{
int Year;
string Author;
@MetaKey("Some other data")
string[] OtherData;
}
...
string md = readText("example.md");
auto meta = parseMetadata(md);
writeln("Metadata:");
writeln(meta.data);
// ["Project Name":["Markdata"], ...
writeln("Remaining Text:");
writeln(meta.remainingText);
// This is the **markdown** text ...
Info inf = deserializeMetadata!Info(meta.data);
writeln("Author: \t" ~ inf.Author);
// Author: Ryhon ...
- Registered by Ryhon
- 1.2.0 released 2 years ago
- ryhn-link/markdata
- LGPL-3.0
- Copyright © 2021, Ryhon
- Authors:
- Dependencies:
- none
- Versions:
-
1.2.0 2022-May-09 1.1.0 2021-Jan-20 1.0.0 2021-Jan-19 ~main 2022-May-09 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
24 downloads total
-
- Score:
- 0.7
- Short URL:
- markdata.dub.pm