www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - hunt-markdown 1.0.0 released,

reply zoujiaqing <zoujiaqing gmail.com> writes:
hunt-markdown is powerfull markdown spec parsing and randering 
library for Dlang. It's fast and clean. Api design like java's 
commonmark library.

example code:
```import hunt.markdown.node.Node;
import hunt.markdown.parser.Parser;
import hunt.markdown.renderer.html.HtmlRenderer;

Parser parser = Parser.builder().build();
Node document = parser.parse("This is *New*");
HtmlRenderer renderer = HtmlRenderer.builder().build();
renderer.render(document);  // "<p>This is <em>New</em></p>\n"
```

More markdown spec like this:
https://spec.commonmark.org/0.28/


Github reposirory:
https://github.com/huntlabs/hunt-markdown
Feb 19 2019
next sibling parent reply Guillaume Piolat <first.last gmail.com> writes:
On Tuesday, 19 February 2019 at 10:36:38 UTC, zoujiaqing wrote:
 hunt-markdown is powerfull markdown spec parsing and randering 
 library for Dlang. It's fast and clean. Api design like java's 
 commonmark library.

 example code:
 ```import hunt.markdown.node.Node;
 import hunt.markdown.parser.Parser;
 import hunt.markdown.renderer.html.HtmlRenderer;

 Parser parser = Parser.builder().build();
 Node document = parser.parse("This is *New*");
 HtmlRenderer renderer = HtmlRenderer.builder().build();
 renderer.render(document);  // "<p>This is <em>New</em></p>\n"
 ```

 More markdown spec like this:
 https://spec.commonmark.org/0.28/


 Github reposirory:
 https://github.com/huntlabs/hunt-markdown
Very cool! I don't think we had a CommonMark parser.
Feb 19 2019
parent zoujiaqing <zoujiaqing gmail.com> writes:
On Tuesday, 19 February 2019 at 12:22:29 UTC, Guillaume Piolat 
wrote:
 On Tuesday, 19 February 2019 at 10:36:38 UTC, zoujiaqing wrote:
 hunt-markdown is powerfull markdown spec parsing and randering 
 library for Dlang. It's fast and clean. Api design like java's 
 commonmark library.

 example code:
 ```import hunt.markdown.node.Node;
 import hunt.markdown.parser.Parser;
 import hunt.markdown.renderer.html.HtmlRenderer;

 Parser parser = Parser.builder().build();
 Node document = parser.parse("This is *New*");
 HtmlRenderer renderer = HtmlRenderer.builder().build();
 renderer.render(document);  // "<p>This is <em>New</em></p>\n"
 ```

 More markdown spec like this:
 https://spec.commonmark.org/0.28/


 Github reposirory:
 https://github.com/huntlabs/hunt-markdown
Very cool! I don't think we had a CommonMark parser.
Thanks for your support :)
Feb 22 2019
prev sibling next sibling parent reply =?UTF-8?Q?S=c3=b6nke_Ludwig?= <sludwig+d outerproduct.org> writes:
Am 19.02.2019 um 11:36 schrieb zoujiaqing:
 hunt-markdown is powerfull markdown spec parsing and randering library 
 for Dlang. It's fast and clean. Api design like java's commonmark library.
 
 example code:
 ```import hunt.markdown.node.Node;
 import hunt.markdown.parser.Parser;
 import hunt.markdown.renderer.html.HtmlRenderer;
 
 Parser parser = Parser.builder().build();
 Node document = parser.parse("This is *New*");
 HtmlRenderer renderer = HtmlRenderer.builder().build();
 renderer.render(document);  // "<p>This is <em>New</em></p>\n"
 ```
 
 More markdown spec like this:
 https://spec.commonmark.org/0.28/
 
 
 Github reposirory:
 https://github.com/huntlabs/hunt-markdown
Since the code appears to be a direct port from Atlassian's library, you should also include the BSD license file, including the original copyright notice (https://github.com/atlassian/commonmark-java/blob/master/LICENSE.txt). Not sure whether the Apache-2.0 license that is set in dub.sdl is compatible. Personally, I would also always explicitly mention the source project when doing a fork like this, since it can help a lot in terms of communicating the exposed API, as well as the code stability to be expected. Also, should the project stop being maintained at some point, the original project may still continue to be supported, so backporting changes can be an option. Since we are talking about server applications, tracking inherited security issues can also be important, so documenting the version/commit on which the port is based is also a good idea (probably most important for hunt-http etc.).
Feb 19 2019
parent zoujiaqing <zoujiaqing gmail.com> writes:
On Tuesday, 19 February 2019 at 15:49:55 UTC, Sönke Ludwig wrote:
 Am 19.02.2019 um 11:36 schrieb zoujiaqing:
 [...]
Since the code appears to be a direct port from Atlassian's library, you should also include the BSD license file, including the original copyright notice (https://github.com/atlassian/commonmark-java/blob/master/LICENSE.txt). Not sure whether the Apache-2.0 license that is set in dub.sdl is compatible. Personally, I would also always explicitly mention the source project when doing a fork like this, since it can help a lot in terms of communicating the exposed API, as well as the code stability to be expected. Also, should the project stop being maintained at some point, the original project may still continue to be supported, so backporting changes can be an option. Since we are talking about server applications, tracking inherited security issues can also be important, so documenting the version/commit on which the port is based is also a good idea (probably most important for hunt-http etc.).
Thanks and agreed! add origin project information. About license, DotNetty use netty APIs, but netty use Apache-2.0 and DotNetty use MIT license.
Feb 20 2019
prev sibling parent Cym13 <cpicard openmailbox.org> writes:
On Tuesday, 19 February 2019 at 10:36:38 UTC, zoujiaqing wrote:
 hunt-markdown is powerfull markdown spec parsing and randering 
 library for Dlang. It's fast and clean. Api design like java's 
 commonmark library.

 example code:
 ```import hunt.markdown.node.Node;
 import hunt.markdown.parser.Parser;
 import hunt.markdown.renderer.html.HtmlRenderer;

 Parser parser = Parser.builder().build();
 Node document = parser.parse("This is *New*");
 HtmlRenderer renderer = HtmlRenderer.builder().build();
 renderer.render(document);  // "<p>This is <em>New</em></p>\n"
 ```

 More markdown spec like this:
 https://spec.commonmark.org/0.28/


 Github reposirory:
 https://github.com/huntlabs/hunt-markdown
A cool addition would be a sanatizer to allow processing markdown provided by users in a secure way. Right now trying to build something like a forum supporting markdown would only end in lots of XSS everywhere. The end developer could probably create a sanatizer himself but: * security works best when the wheel isn't invented over and over again, such piece of software is hard to get right[1], better have a centralized effort * writting a sanitizer requires building a MD parser so it's worth baking it into the library (but with a way to disable it for trusted inputs). Otherwise, it would be good to mention that this is not fit to manage user inputs and should be kept server-side. [1]: http://danlec.com/blog/hacking-stackoverflow-com-s-html-sanitizer
Feb 23 2019