Re: Tutorial book with runable code for Postgres? - Mailing list pgsql-docs

From Kirk Wolak
Subject Re: Tutorial book with runable code for Postgres?
Date
Msg-id CACLU5mRw9BvExyjeHDfUhg6=y=LZjLho4srcvbtycSU1Z=rhqA@mail.gmail.com
Whole thread Raw
In response to Tutorial book with runable code for Postgres?  (Matous Jan Fialka <mjf@mjf.cz>)
Responses Re: Tutorial book with runable code for Postgres?  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-docs
On Tue, Nov 29, 2022 at 3:40 AM Matous Jan Fialka <mjf@mjf.cz> wrote:
Hello.

I would like to get some opinion on a petite idea I got while reading
the "nextval
parameter is not clear" thread. Because it may not fit well to the
thread itself
I managed to create a new one instead...

+1 (right approach, I was clearly wrong, learning...)
...
The very best example of the approach of a book with runable examples
is the
"The Rust Programming Language" [1][2] aka "The Book". Who has not
known about it,
please give it few minutes to see how it works and what a great
experience it is
to read it. :-)

I actually recorded this interaction.  I think this is cool.
And as I think about WHERE this goes, I DEFINITELY believe it goes
in the tutorial world.  I love the "peek" and the "play" icons, on mouse over.

for those that want to see it themselves:
https://rust-lang.github.io/mdBook/format/mdbook.html

And scroll to the bottom of that page.
 
...
I am also not aware if DB Fiddle or another service allows to run
examples covered
in such tutorial book via some API or not. If not, the results could
still be
"pregenerated" and hardcoded at compile time. Maybe, in this case, it
would be even
better.


If in the tutorial we used this "hiding" technique to explain the code,
but expanded it so it was runnable, that would be awesome.

I like the idea of it being able to go directly to: https://www.db-fiddle.com/
to either a specific preloaded example, or better, pass in our code...
Especially if we could do it using one CSS/Javascript wrapper!
 

References:
[1] https://doc.rust-lang.org/book/
[2] https://github.com/rust-lang/book (source code of "the book")
[3] https://rust-lang.github.io/mdBook/format/mdbook.html
--
Matous Jan Fialka
Thanks... Let's hope the discussion gets some traction...
 

pgsql-docs by date:

Previous
From: Kirk Wolak
Date:
Subject: Re: nextval parameter is not clear
Next
From: "David G. Johnston"
Date:
Subject: Re: Tutorial book with runable code for Postgres?