vibe.d beta banner
get vibe.d
0.7.30

Function getMarkdownOutline

Returns the hierarchy of sections

Prototype

Section[] getMarkdownOutline(
  string markdown_source,
  scope MarkdownSettings settings = null
);

Example

import std.conv : to;
assert(getMarkdownOutline("## first\n## second\n### third\n# fourth\n### fifth") ==
	[
		Section(2, " first", "first"),
		Section(2, " second", "second", [
			Section(3, " third", "third")
		]),
		Section(1, " fourth", "fourth", [
			Section(3, " fifth", "fifth")
		])
	]
);
Authors

Sönke Ludwig

Copyright

© 2012-2014 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.