Elixir Livebook is a secret weapon for documentation
1–10 of 72 posts
Re: Elixir Livebook is a secret weapon for documentation
#2Re: Elixir Livebook is a secret weapon for documentation
#3this is really interesting. I've never thought on using this or any jupyter-like tools to document working software. Maybe I'll try it later
There are still some rough edges -- it would be nice if livebook could cache prerendered content. for example, kino graphs only chuck a big fat JSON into a html comment, it would be nice if it also popped out an svg or encoded png with data uri.
Re: Elixir Livebook is a secret weapon for documentation
#4I'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 blocks.
Re: Elixir Livebook is a secret weapon for documentation
#5The 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…
However, do I understand it correctly that this allows me to output verified, working code in my test suite, but its not a tool that I can embed in my docs to create runnable code samples? (which is what the OP is showing).
super valuable either way, just trying to validate understanding.
Re: Elixir Livebook is a secret weapon for documentation
#6It's one of my favorite tools.
Re: Elixir Livebook is a secret weapon for documentation
#7They 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.
Re: Elixir Livebook is a secret weapon for documentation
#8The 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…
That's fantastic. We use Kotlin to build Taxi (taxilang.org) and orbitalhq.com. this would be an awesome addition to our docs. However, do I understand it correctly that this allows me to output verified, working code in my test suite, but its not a tool that I can embed in my docs to create runnable code samples? (which is what the OP is showing). super valuable either way, just trying to validate understanding.
I'm not aware of anything exactly like Livebook in the Kotlin ecosystem but you might be interested in kotlinx-knit which takers a more incremental approach to executable documentation:
https://github.com/Kotlin/kotlinx-knit
Neither of these approaches will result in interactive documentation.
Re: Elixir Livebook is a secret weapon for documentation
#9I 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.
Re: Elixir Livebook is a secret weapon for documentation
#10The 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…
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.