Flutter-Bounty-Hunters / static_shock

A static site generator for Dart.
MIT License
107 stars 5 forks source link

Extended markdown support: Copy button on code blocks #126

Open suragch opened 3 months ago

suragch commented 3 months ago

For a coding tutorial, it would be great to have a way to include a copy button on code blocks, similar to what GitHub does:

print('Click the Copy button');

Not every code block should have a copy button. For example, when you are listing a bunch of shell commands, it doesn't make sense:

mkdir hello
cd hello

Probably in SS terminology, this should be a component, but it is such a common need in a coding tutorial, that it would be nice to add it to markdown.

I'm not sure what the syntax would be. Maybe something like this:

```dart copy=true
print('Click the Copy button');
```

```bash copy=false
mkdir hello
cd hello
```