Skip to content

Refactoring of examples in documentation [Sketch]#130

Open
lightmanLP wants to merge 3 commits into
reagento:mainfrom
lightmanLP:sketch/docs/examples-refactor
Open

Refactoring of examples in documentation [Sketch]#130
lightmanLP wants to merge 3 commits into
reagento:mainfrom
lightmanLP:sketch/docs/examples-refactor

Conversation

@lightmanLP

Copy link
Copy Markdown
  • Было бы неплохо иметь плавный переход между табами с примерами, чтобы видеть появление различий. По крайней мере иметь выравнивание при разных вариантах одного и того же большого примера (Quick start).
  • В некоторых местах желательно иметь комментарии к шагам (Quick start).
  • В местах с простыми примерами, демонстрирующими одну фичу, удобнее иметь только один blank line отступа для компактности. Чтобы не путаться, можно просто ввести это везде.
  • Починить бы подсветку тайпхинтов в виде строк, а то читать тот же Source Reference не удобно.
  • В большинстве примеров достаточно оставлять схему и вызов (+ что-то релевантное непосредственно к секции).
  • В некоторых местах (Loading) все табы уезжают вместе, что отвлекает.
  • В Loading секцию с примером и непосредственно ошибкой удобнее читать вместе, а не по разным табам.

@lightmanLP lightmanLP requested a review from Niccolum as a code owner June 8, 2026 10:00
@@ -1 +1 @@
"""Decorator mode — auto-load config on instantiation."""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line, I think, needs to be deleted. It's pointless. This line is already there, or should be in the doc.

@lightmanLP lightmanLP Jun 8, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be moved to a doc of Quick start, because theres no context provided on behavior of auto-load.
Since it is also used in the Introduction, a brief explanation will be required there as well.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may proceed if you find it useful and no equivalent string exists in the documentation.


import dature

# (our externally-provided data for config)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unuseful line, imho

# Step 2: Load it!
config = AppConfig()

# PROFIT!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unuseful line, imho

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might drop those two, I just added them for consistency of section comments, but I'd prefer to keep first one, because the purpose of setting such envs inside of example wasn't obvious from first look. It isn't that clear until we reach load call (part about loading sources). It clarifies the purpose early on, so we don't need to keep it in head or overthink it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to drop the others, they make sense. Just drop "PROFIT"

debug: bool = False


# --8<-- [start:override]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you expand it from line 10 to the end?

import dature


# --8<-- [start:schema]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to explicitly select the schema. In fact, this example seems to need to be split into two files.

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

Successfully merging this pull request may close these issues.

2 participants