Stream: contributing

Topic: Try out collapsible sections in tutorial


view this post on Zulip John Konecny (Jun 16 2024 at 12:47):

I was thinking about doing "Try out collapsible sections in tutorial", but I'm not clear on exactly what needs to be changed. Is the expectation that some existing examples will be collapsible or are you thinking about embedding the REPL as a collapsible section in each part of the tutorial that has an example?

view this post on Zulip Anton (Jun 17 2024 at 09:26):

Hi @John Konecny, thanks for helping out :)
The intention of the collapsible sections is to allow for the inclusion of explanations that reveal what's going on behind the scenes (for the interested reader) or those that explain difficult concepts in a different way. Also, a chapter could include a basic example and in a collapsible section we could have a more involved example. It would just be a general tool that would allow us to deliver value for the certain groups of readers without increasing the length of the tutorial for everyone.

view this post on Zulip John Konecny (Jun 17 2024 at 14:17):

@Anton that makes sense. Is the goal of this ticket then to set up the css styling/js interactivity so that it's easy to add collapsible sections when needed?

view this post on Zulip Anton (Jun 17 2024 at 14:24):

I just realized collapsible sections work with the HTML tag <details>, so perhaps something like this already works?

<details><summary>Toggle me!</summary>Here are the details</details>

Can you give that a try? It's possible we can e.g. paste this HTML straight into one of our md files and it could already work and perhaps look nice as well...

view this post on Zulip John Konecny (Jul 09 2024 at 11:53):

I finally got around to trying this. I'm having issue with building the website. I don't have the correct version of GLIBC. Now obviously the solution is to install the correct version of GLIBC, but isn't nix supposed to handle this for me? I know nothing about nix, but the little I read about it seems to indicate that it should be downloading managing dependencies for me.

$ ./www/build-dev-local.sh
++ dirname ./www/build-dev-local.sh
+ DIR=./www
+ cd ./www
+ rm -rf dist/
+ cp -r build dist/
+ cp -r public/different-names public/favicon.svg public/license public/site.css public/site.js public/zulip-icon-circle.svg dist/
+ roc run main.roc -- content/ dist/
roc: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /nix/store/c2yb135iv4maadia5f760b3xhbh6jh61-gcc-13.2.0-lib/lib/libstdc++.so.6)
roc: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/c2yb135iv4maadia5f760b3xhbh6jh61-gcc-13.2.0-lib/lib/libstdc++.so.6)
 $ ldd --version
ldd (GNU libc) 2.39
$Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$Written by Roland McGrath and Ulrich Drepper.

view this post on Zulip Anton (Jul 09 2024 at 13:10):

but isn't nix supposed to handle this for me?

Yes indeed, I suspect this happens because the static site gen release was not built with musl, I'll make an issue there. Can you share your OS+version?

Just to double check, did you execute all previous steps?

cd roc
nix develop
./www/build.sh
# make the roc command available
export PATH="$(pwd)/target/release/:$PATH"
bash ./www/build-dev-local.sh

view this post on Zulip Anton (Jul 09 2024 at 13:32):

https://github.com/lukewilliamboswell/basic-ssg/issues/3

view this post on Zulip John Konecny (Jul 09 2024 at 14:48):

instead of nix develop I did nix develop --extra-experimental-features nix-command --extra-experimental-features flakes, but yes to everything else.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy

view this post on Zulip Luke Boswell (Jul 09 2024 at 20:18):

I'll try and make a new release later today using musl.

In the meantime you can clone basic-ssg and build it using run.sh, then for the roc website build script use a local path to your basic-ssg/platform/ directory.

view this post on Zulip Luke Boswell (Jul 09 2024 at 20:19):

The roc website uses the basic-ssg release here

https://github.com/roc-lang/roc/blob/0d9db5bf2dfbc035c8c56a1c65be9047e8583fb8/www/main.roc#L1

So you can use a relative path instead.

view this post on Zulip John Konecny (Jul 09 2024 at 22:37):

Thanks for all the help! No need to rush for me, but I appreciate it!

view this post on Zulip Luke Boswell (Jul 10 2024 at 06:14):

@John Konecny can you please give this release a try? https://github.com/lukewilliamboswell/basic-ssg/releases/tag/0.3.0

view this post on Zulip John Konecny (Jul 10 2024 at 12:31):

@Anton

So it looks like I was being dumb. When I did a which roc after doing export PATH="$(pwd)/target/release/:$PATH" it was pointing to a build I downloaded and not my local build of roc. :distraught: I just needed to change the path to $(pwd)/target/debug. The funny thing is I checked yesterday before I messaged you guys, but my mind didn't comprehend that it was pointed to the wrong build. :cry:

@Luke Boswell

Your change isn't working for me, but given my issues with debugging I want to make sure I'm doing everything right this time. This is the commit I made to add your build. Is this the right way to do it?

Here are the results I got.

$ ./www/build-dev-local.sh
++ dirname ./www/build-dev-local.sh
+ DIR=./www
+ cd ./www
+ rm -rf dist/
+ cp -r build dist/
+ cp -r public/different-names public/favicon.svg public/license public/site.css public/site.js public/zulip-icon-circle.svg dist/
+ roc run main.roc -- content/ dist/
Missing directory arguments, usage example: roc app.roc -- path/to/input/dir path/to/output/dir

view this post on Zulip Luke Boswell (Jul 10 2024 at 22:20):

It looks like you're doing everything right.

The not receiving args issue is a known rust musl issue that isn't specific to roc at all. I thought it was fixed in the 1.78 stable release, I guess that is why Anton has bumped us up to a nightly 1.79 release for basic-cli.

Should be an easy fix if that is all it is. But the Windows stuff I was trying to get working, has only rustc toolchains for the stable release. I guess if we have to choose between the two it's a working linux release now, and by the time we circle back to Windows there should be a stable release with the musl fix.

view this post on Zulip Anton (Jul 12 2024 at 12:32):

I thought it was fixed in 1.79 but after updating to that version it still happens :/ I re-opened that issue https://github.com/roc-lang/basic-cli/issues/82

view this post on Zulip Anton (Jul 12 2024 at 12:34):

Anton has bumped us up to a nightly 1.79 release for basic-cli

basic-cli is on 1.79 stable

view this post on Zulip Luke Boswell (Jul 12 2024 at 23:13):

ohk, we'll I dont think we have a great way to proceed and make basic-ssg work for the linux musl. We will just have to wait until rustc toolchains catch up I think.

view this post on Zulip John Konecny (Jul 13 2024 at 13:09):

Anton said:

I just realized collapsible sections work with the HTML tag <details>, so perhaps something like this already works?

<details><summary>Toggle me!</summary>Here are the details</details>

Can you give that a try? It's possible we can e.g. paste this HTML straight into one of our md files and it could already work and perhaps look nice as well...

Yeah that works, but, as you can see, it needs some styling. I'm will to work on that if you're okay with me doing it.
If you're okay with me doing this could you please let me know if there is a specific look you had in mind and if there is any existing content you think is a good candidate to add this feature to?

ss.png

view this post on Zulip Anton (Jul 13 2024 at 13:17):

I'm will to work on that if you're okay with me doing it.

Totally :)

could you please let me know if there is a specific look you had in mind

I don't have a specific look in mind, I would recommend to: keep it simple, make the colors fit with the rest of the tutorial, use sharp corners and no curves to fit with the rest.

view this post on Zulip Anton (Jul 13 2024 at 13:23):

is any existing content you think is a good candidate to add this feature to?

I'll take a look

view this post on Zulip Anton (Jul 13 2024 at 13:27):

This paragraph seems well suited:

By the way, there are two common ways to pronounce "tuple"—one sounds like "two-pull" and the other rhymes with "supple"—and although no clear consensus has emerged in the programming world, people seem generally accepting when others pronounce it differently than they do.

view this post on Zulip Anton (Jul 13 2024 at 13:29):

Instead of the "Toggle me" we could use "Pronouncing tuple"

view this post on Zulip John Konecny (Jul 13 2024 at 13:37):

Thanks for the quick replies as always! Time for some CSS adventures!

view this post on Zulip John Konecny (Jul 13 2024 at 18:18):

I made a PR


Last updated: Jul 26 2025 at 12:14 UTC