View Source LivebookHelpers (livebook_helpers v0.0.8)

Documentation for LivebookHelpers.

Link to this section Summary

Functions

Takes a module and a path to a file, creates a livebook from the moduledocs in the given module. The .livemd extension is automatically added. Returns the file path for the created livebook.

Takes a module and a path to a file, creates a livebook from the moduledocs in the given module. The .livemd extension is automatically added. The provided deps are put into a Mix.install section at the start of the livebook, so the deps should be in the format that Mix.install allows.

Returns the text that can be used to create a livebook using the docs in the supplied module.

Link to this section Functions

Link to this function

livebook_from_module(module, livebook_path)

View Source

Takes a module and a path to a file, creates a livebook from the moduledocs in the given module. The .livemd extension is automatically added. Returns the file path for the created livebook.

This function will take a module and turn the module doc found there into a livebook. This make it really easy to create one set of information and have it be represented in different formats. For example you can write a README, use it as the moduledoc then run this function to spit out a livebook with all the same info.

Below is a summary of what we do to create the Livebook:

  • The module is used as the title for the Livebook.
  • Each function's @doc is put under a section with the function's name and arity.
  • doctests become (formatted) elixir cells
  • The magic line to make github render livebooks as markdown is added.

Examples

mix create_livebook_from_module LivebookHelpers "my_livebook"
Link to this function

livebook_from_module(module, livebook_path, deps)

View Source

Takes a module and a path to a file, creates a livebook from the moduledocs in the given module. The .livemd extension is automatically added. The provided deps are put into a Mix.install section at the start of the livebook, so the deps should be in the format that Mix.install allows.

This function will take a module and turn the module doc found there into a livebook. This make it really easy to create one set of information and have it be represented in different formats. For example you can write a README, use it as the moduledoc then run this function to spit out a livebook with all the same info.

Below is a summary of what we do to create the Livebook:

  • The module is used as the title for the Livebook.
  • Each function's @doc is put under a section with the function's name and arity.
  • doctests become (formatted) elixir cells
  • The magic line to make github render livebooks as markdown is added.

Examples

mix create_livebook_from_module LivebookHelpers "my_livebook" "[livebook_helpers: ">= 0.0.0"]"
Link to this function

livebook_string(module, deps)

View Source

Returns the text that can be used to create a livebook using the docs in the supplied module.

Link to this function

parse_bullet_point(list, indentation, livebook)

View Source
Link to this function

parse_doctest(list, elixir_cell)

View Source
Link to this function

parse_doctest_assertion(list, elixir_cell)

View Source
Link to this function

parse_elixir_cells(list, livebook)

View Source
Link to this function

parse_four_space_code_blocks(remaining_lines, four_space_elixir_block)

View Source
Link to this function

parse_module_doc(module_doc)

View Source
Link to this function

process_function_docs(function_docs, livebook)

View Source