Examples with hidden lines should be editable

Abierto
#2,811 5 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 17 días

@LukeMathWalker ya está trabajando en esto.

Desde el 7/7/2025.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

deep_dives/idiomatic

Problem

For this issue, there are two types of code blocks:

  • Read-only ones, defined via ```rust
  • Editable ones, defined via ```rust,editable

Read-only code blocks support the usage of # to hide code from the view that's rendered in the browser:

Image

You can click on the "Eye" toggle to show the hidden lines:

Image

This makes it convenient to break an example across multiple code blocks without repeating content from the previous block (e.g., the definition of UserId in the example above).

Instructors often need to be able to edit code directly on the slide, but we lose the hiding feature if we mark the block as editable:

Image

The UserId definition is shown, even if it was prefixed with # in the source.

Solution

Modify the theme to introduce a new button, next to the "Copy" one, which allows instructors to switch from "Preview" to "Edit" mode.
In "Preview" mode, code is rendered as if the editable attribute had not been included.
In "Edit" mode, all hidden code is shown and the instructor is free to edit.

We won't support going back from "Edit" to "Preview" mode.

Lenguaje dominante
Rust
Estrellas
33.5k
Forks
2.1k
Merge medio
16 d 20 h
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de google/comprehensive-rust

Todos los issues de google/comprehensive-rust

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.