This concept sounds quite a bit like the usage of .mdx files in OCaml. Those are markdown files which can load and execute OCaml code in them. They are useful for unit testing code like libraries, providing usage examples for end-users (as well as the text format markdown usually supports) and testing it at the same time. Definitely a great idea for documentation, and one which I should use more of. https://github.co…
Elixir Livebook is a secret weapon for documentation
11–20 of 72 posts
Re: Elixir Livebook is a secret weapon for documentation
#12This concept sounds quite a bit like the usage of .mdx files in OCaml. Those are markdown files which can load and execute OCaml code in them. They are useful for unit testing code like libraries, providing usage examples for end-users (as well as the text format markdown usually supports) and testing it at the same time. Definitely a great idea for documentation, and one which I should use more of. https://github.co…
Re: Elixir Livebook is a secret weapon for documentation
#13The ability to execute sample code during documentation generation seems invaluable. Instead of being subject to rot, documentation turns into an executable test suite. I've been working on something like this for Kotlin using a compiler plugin that allows code to access the source text of lambdas, functions and classes being executed. You write code that spits out markdown and captures its own source into code block…
A related Elixir feature you might also find interesting is Doctests: https://elixir-lang.org/getting-started/mix-otp/docs-tests-a... You can write inline examples in your docstrings and they’re automatically turned into unit tests. So again you get that documentation as an executable test suite not subject to rot, but at a per-function level. Same kind of idea but different levels of the documentation stack.
Re: Elixir Livebook is a secret weapon for documentation
#14I would suggest to anyone to download Livebook and test it out, even if you don't know Elixir or Erlang. You can do so much with it. I even use it for things outside of programming due to it being pretty much a markdown notebook that you can run code inside of. It's one of my favorite tools.
To do so much with it you need to know Elixir or Erlang ;)
You might have to Google how to read a file in Elixir, but you don't actually need to know Elixir.
In the future, you won't even need to know that to use it.
Re: Elixir Livebook is a secret weapon for documentation
#15Earlier quoted context omitted.
To do so much with it you need to know Elixir or Erlang ;)
You actually don't. You can use smart cells which lets you do a lot without actually coding. You can transform data, build charts, run AI model and more all without writing code. You might have to Google how to read a file in Elixir, but you don't actually need to know Elixir. In the future, you won't even need to know that to use it.
Mind blown.gif
:)
Re: Elixir Livebook is a secret weapon for documentation
#16Re: Elixir Livebook is a secret weapon for documentation
#17Org-babel can do a lot of this, no?
Don't get me wrong, I love org babel but there are some advantages of the browser based approach.
Re: Elixir Livebook is a secret weapon for documentation
#18I built this tool to let people generate evergreen markdown documentation from annotated type-safe YAML integration tests:
Re: Elixir Livebook is a secret weapon for documentation
#19Re: Elixir Livebook is a secret weapon for documentation
#20Org-babel can do a lot of this, no?
Yeah but to be fair, it's a bit gnarly to get set up and it can't do interactive graphs. Don't get me wrong, I love org babel but there are some advantages of the browser based approach.