Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

De-indent comment block #165

Open
nomeata opened this issue Nov 23, 2023 · 3 comments
Open

De-indent comment block #165

nomeata opened this issue Nov 23, 2023 · 3 comments

Comments

@nomeata
Copy link

nomeata commented Nov 23, 2023

Browsing the documentation I was a bit confused why some paragraphs are randomly indendet, e.g. “The bvar constructor…”.

My theory is that it’s because the whole doc string block is indented in the source code:


/--
Lean expressions. This data structure is used in the kernel and
elaborator. However, expressions sent to the kernel should not
contain metavariables.

Remark: we use the `E` suffix (short for `Expr`) to avoid collision with keywords.
We considered using «...», but it is too inconvenient to use.
-/
inductive Expr where
  /--
  The `bvar` constructor represents bound variables, i.e. occurrences
  of a variable in the expression where there is a variable binder
  above it (i.e. introduced by a `lam`, `forallE`, or `letE`).
  …
  -/
  | bvar (deBruijnIndex : Nat)

Looking at this, I doubt that the author wanted to have the markdown interpreted as indented.

If that analysis is correct, maybe the tool should de-indent by all common whitespace?

Probably also for

/--
  This style, which I have seen too.
-/
def foo := …

I might be barking on the wrong hill, though.

@hargoniX
Copy link
Collaborator

With respect to docstring rendering I'm currently hoping that David's new doc tooling will give some clear semantics to docstrings at last that the doc-gen renderer can then just stick to. Hence I'd suggest to hold our breaths for the first release of that.

@nomeata
Copy link
Author

nomeata commented Nov 24, 2023

Fair enough, and the issue isn't servere.

@acmepjz
Copy link
Contributor

acmepjz commented Jun 11, 2024

I think this is a CSS problem...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants