Livebook (Anoma v0.34.0)
I generate out extra information for Livebook
My main purpose is to generate out the TOC for each livebook document we have.
to do this please run toc_toplevel/0
To set a certain order please set sort_order/0
to have the updated
order
API
Summary
Functions
I replace the header with the given TOC
I provide an example of what a TOC looks like
Generates out a TOC, given a series of nested documents
I get out all live view docs
Gets all livemd documents in a sorted list given a path.
I generate out the TOC for all liveview docs
Types
Functions
@spec add_heading_num([String.t()]) :: [ {String.t(), non_neg_integer(), non_neg_integer()} ]
I replace the header with the given TOC
Example
markdown_text = "## Intro ...
Index
text here ## Conclusion All good"
Livebook.change_header(markdown_text, "##", "Index", "New Content") |> IO.puts
## Intro ...
## Index
New Content
## Conclusion
All good
:ok
@spec count_depth(Path.t()) :: non_neg_integer()
@spec example_toc() :: :ok
I provide an example of what a TOC looks like
@spec generate_heading( String.t(), non_neg_integer(), non_neg_integer(), non_neg_integer() ) :: String.t()
@spec generate_toc([Path.t()], non_neg_integer()) :: String.t()
Generates out a TOC, given a series of nested documents
We take a path, and a place where we should be calculating the TOC from.
Example
@spec get_all_livemd_documents() :: [Path.t()]
I get out all live view docs
Gets all livemd documents in a sorted list given a path.
@spec sort_order() :: sort()
@spec toc_toplevel() :: :ok
I generate out the TOC for all liveview docs