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

docs(general): consistency around admonitions and snippets #919

Merged
merged 22 commits into from Dec 30, 2021

Conversation

DanyC97
Copy link
Contributor

@DanyC97 DanyC97 commented Dec 20, 2021

Issue #, if available: #917

Description of changes:

Throughout the documentation we had a bit of inconsistency around
admonitions.

As such we added few rules to keep the consistency which will improve
the UX:

  • we should use ???+ instead of !!! so we can have a collapse block
    (default open)
  • for admonitions with default title, we should write the description
    on a new line
  • for admonitions which has a custom title as well as a description, we
    should adhere to the format <admonitions type>: <custom title>.

E.g - for a tip admonitions with a custom title "Did you know?" and
description of "Powertools is a brilliant library"

???+ tip "Tip: Did you know?"
     Powertools is a brilliant library

Checklist

Breaking change checklist

RFC issue #:

  • Migration process documented
  • Implement warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.


View rendered docs/core/event_handler/api_gateway.md
View rendered docs/core/event_handler/appsync.md
View rendered docs/core/logger.md
View rendered docs/core/metrics.md
View rendered docs/core/tracer.md
View rendered docs/index.md
View rendered docs/utilities/batch.md
View rendered docs/utilities/data_classes.md
View rendered docs/utilities/feature_flags.md
View rendered docs/utilities/idempotency.md
View rendered docs/utilities/jmespath_functions.md
View rendered docs/utilities/parameters.md
View rendered docs/utilities/parser.md
View rendered docs/utilities/validation.md

@pull-request-size pull-request-size bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Dec 20, 2021
@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Dec 20, 2021
Throughout the documentation we had a bit of inconsistency around
admonitions.

As such we added few rules to keep the consistency which will improve
the UX:

* we should use `???+` instead of `!!!` so we can have a collapse block
(default open)
* for admonitions with default title, we should write the description
on a new line
* for admonitions which has a custom title as well as a description, we
should adhere to the format `<admonitions type>: <custom title>`.

E.g - for a tip admonitions with a custom title "Did you know?" and
description of "Powertools is a brilliant library"

```
???+ tip "Tip: Did you know?"
     Powertools is a brilliant library
```
@DanyC97 DanyC97 changed the title docs: Consistency around docs admonitions docs: Consistency around admonitions Dec 20, 2021
@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2021

Codecov Report

Merging #919 (a7a7161) into develop (cd15ee9) will increase coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #919      +/-   ##
===========================================
+ Coverage    99.90%   99.96%   +0.05%     
===========================================
  Files          118      118              
  Lines         5246     5273      +27     
  Branches       596      606      +10     
===========================================
+ Hits          5241     5271      +30     
+ Misses           1        0       -1     
+ Partials         4        2       -2     
Impacted Files Coverage Δ
...wertools/utilities/idempotency/persistence/base.py 99.36% <0.00%> (-0.01%) ⬇️
aws_lambda_powertools/tracing/tracer.py 100.00% <0.00%> (ø)
aws_lambda_powertools/shared/functions.py 100.00% <0.00%> (ø)
aws_lambda_powertools/event_handler/api_gateway.py 100.00% <0.00%> (ø)
...ws_lambda_powertools/utilities/idempotency/base.py 100.00% <0.00%> (ø)
...lambda_powertools/utilities/data_classes/common.py 100.00% <0.00%> (ø)
...wertools/utilities/data_classes/active_mq_event.py 100.00% <0.00%> (ø)
...wertools/utilities/data_classes/rabbit_mq_event.py 100.00% <0.00%> (ø)
...s/utilities/data_classes/dynamo_db_stream_event.py 100.00% <0.00%> (ø)
.../utilities/data_classes/code_pipeline_job_event.py 100.00% <0.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd15ee9...a7a7161. Read the comment docs.

docs/utilities/parameters.md Outdated Show resolved Hide resolved
docs/utilities/batch.md Outdated Show resolved Hide resolved
@DanyC97
Copy link
Contributor Author

DanyC97 commented Dec 20, 2021

to reviewer attention:

  • please try to look at the batch.md by running the site local and confirm if the examples are formatted okay (in my local dev s'thing was odd)
  • as i got along, i've added punctuation to all the admonitions, hopefully i haven't missed any (not 100% sure though)

@heitorlessa
Copy link
Contributor

This is awesome @DanyC97 - Once I finish the major work for the next release I'll look into this, specially render the docs locally to see how much width it covers when reading the docs.

Thank you!!!

@DanyC97
Copy link
Contributor Author

DanyC97 commented Dec 22, 2021

specially render the docs locally

in new year will try to see if we can have a preview docs rendered as part of PR to avoid extra work.

@heitorlessa
Copy link
Contributor

I'm merging this today - I'm making some minor fixes to adjust for screen and things like there's no need to use ???+ for those that have one line information.

???+ info "Info: Explicit parameters take precedence over environment variables"

@DanyC97
Copy link
Contributor Author

DanyC97 commented Dec 30, 2021

I'm merging this today - I'm making some minor fixes to adjust for screen and things like there's no need to use ???+ for those that have one line information.

???+ info "Info: Explicit parameters take precedence over environment variables"

sure, feel free to make changes. Note the rational for having ???+ even on single lines were for consistency rather than added value

@heitorlessa
Copy link
Contributor

Yeah I noticed that. I'll do multiple passes to see what reads better from an accessibility perspective and screen real estate.

@heitorlessa
Copy link
Contributor

Time allowing, I'm gonna take this opportunity to use the new title in code snippets - Then we will use tabbed content when we have multiple code blocks to show.

Example - what do you think @DanyC97

image

@heitorlessa
Copy link
Contributor

heitorlessa commented Dec 30, 2021

I've just finished playing with single line admonition vs two-line - I'll revert those changes. Thanks again for chiming in.

Reasoning: It's easier to forget to add Tip: <text> as you add docs over time. Screen real estate and accessibility doesn't change significantly

@pull-request-size pull-request-size bot removed the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Dec 30, 2021
@pull-request-size pull-request-size bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Dec 30, 2021
@heitorlessa
Copy link
Contributor

Finally done :) All single snippet examples are no longer tabbed, except multiple code snippets. Also improved wording here and there part of previous PRs I didn't manage to do copywriting.

Thank you so much @DanyC97 for kicking this off! Merging

@heitorlessa heitorlessa changed the title docs: Consistency around admonitions docs: consistency around admonitions and snippets Dec 30, 2021
@heitorlessa heitorlessa merged commit f985c40 into aws-powertools:develop Dec 30, 2021
@DanyC97
Copy link
Contributor Author

DanyC97 commented Dec 30, 2021

Time allowing, I'm gonna take this opportunity to use the new title in code snippets - Then we will use tabbed content when we have multiple code blocks to show.

Example - what do you think @DanyC97

image

i love it, brilliant work!

heitorlessa added a commit to ran-isenberg/aws-lambda-powertools-python that referenced this pull request Dec 31, 2021
…tools-python into complex

* 'develop' of https://github.com/awslabs/aws-lambda-powertools-python: (24 commits)
  docs: consistency around admonitions and snippets (aws-powertools#919)
  chore(deps-dev): bump mypy from 0.920 to 0.930 (aws-powertools#925)
  fix(event-sources): handle dynamodb null type as none, not bool (aws-powertools#929)
  fix(apigateway): support @app.not_found() syntax & housekeeping (aws-powertools#926)
  docs: Added GraphQL Sample API to Examples section of README.md (aws-powertools#930)
  feat(idempotency): support dataclasses & pydantic models payloads (aws-powertools#908)
  feat(tracer): ignore tracing for certain hostname(s) or url(s) (aws-powertools#910)
  feat(event-sources): cache parsed json in data class (aws-powertools#909)
  fix(warning): future distutils deprecation (aws-powertools#921)
  docs(batch): remove leftover from legacy
  docs(layer): bump Lambda Layer to version 6
  chore: bump to 1.23.0
  docs(apigateway): add new not_found feature (aws-powertools#915)
  docs: external reference to cloudformation custom resource helper (aws-powertools#914)
  feat(logger): allow handler with custom kwargs signature (aws-powertools#913)
  chore: minor housekeeping before release (aws-powertools#912)
  chore(deps-dev): bump mypy from 0.910 to 0.920 (aws-powertools#903)
  feat(batch): new BatchProcessor for SQS, DynamoDB, Kinesis (aws-powertools#886)
  fix(parser): overload parse when using envelope (aws-powertools#885)
  fix(parser): kinesis sequence number is str, not int (aws-powertools#907)
  ...
heitorlessa added a commit to huonw/aws-lambda-powertools-python that referenced this pull request Dec 31, 2021
…tools-python into feature/905-datetime

* 'develop' of https://github.com/awslabs/aws-lambda-powertools-python:
  feat(feature_flags): support beyond boolean values (JSON values) (aws-powertools#804)
  docs: consistency around admonitions and snippets (aws-powertools#919)
  chore(deps-dev): bump mypy from 0.920 to 0.930 (aws-powertools#925)
  fix(event-sources): handle dynamodb null type as none, not bool (aws-powertools#929)
  fix(apigateway): support @app.not_found() syntax & housekeeping (aws-powertools#926)
  docs: Added GraphQL Sample API to Examples section of README.md (aws-powertools#930)
  feat(idempotency): support dataclasses & pydantic models payloads (aws-powertools#908)
  feat(tracer): ignore tracing for certain hostname(s) or url(s) (aws-powertools#910)
  feat(event-sources): cache parsed json in data class (aws-powertools#909)
  fix(warning): future distutils deprecation (aws-powertools#921)
@heitorlessa heitorlessa changed the title docs: consistency around admonitions and snippets docs(general): consistency around admonitions and snippets Dec 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants