Examples with hidden lines should be editable

オープン
#2,811 コメント 5 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 17 日以内に返信

@LukeMathWalker がすでに取り組んでいます。

2025年7月7日 から。

評価

この issue はまだ評価されていません。

説明

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.

主要言語
Rust
スター
33.5k
フォーク
2.1k
平均マージ
16日 20時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

google/comprehensive-rust のほかの issue

google/comprehensive-rust の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。