Skip to content

Conversation

carltongibson
Copy link
Member

@carltongibson carltongibson commented Feb 9, 2023

Looking to push forward the blacken-docs effort, applied the required code-blocks throughout.

  • Possibly I missed some.
  • Possibly we can tweak languages later.

But I really don't want this to go stale. 😅 — so can we decide quickly please.

Note: we loose the ability to set default for a page say — this was used in template docs, and in the ORM docs, where there are lots of pycon examples back to back often.

I feel a bit sad about this, but I think it's probably worth doing to get the blacken-docs into play. (Eye on the goal 😜)
We'd then just have :: for Python throughout the project.

Moving is a one-time cost, that I've paid here.

Also, use of the override wasn't consistent. I think we're likely in a better world the other side of this change if we go for it.

@adamchainz Can I ask you to review and confirm we're going for this. (On balance I'm probably for it but I'd like you to champion it assuming you're +1, which I think you are.)

//cc @jvzammit @pauloxnet — hopefully this frees #16496 to be easier.

@pauloxnet
Copy link
Member

Great work @carltongibson
LGTM, I'll try to review after work hours.

Copy link
Contributor

@jvzammit jvzammit left a comment

Choose a reason for hiding this comment

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

Thanks for the huge amount of grunt-but-not-so-grunt work in this @carltongibson !!

This indeed will make the commits in PRs to get to "blacken-docs" cleaner. I think you had suggested this but I only understand what you meant now 🤦‍♂️

In any case thanks! I spotted some very, very minor double-colon "typos". And if there's anything I didn't spot I think should be easy-to-fix later on 👍

Thanks again!

@pauloxnet
Copy link
Member

it's an amazing job. I've only added a few comments, most of which are questions rather than corrections.

Copy link
Member

@pauloxnet pauloxnet left a comment

Choose a reason for hiding this comment

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

@carltongibson thanks for all your answers.
For me this PR can be merged.

Copy link
Member

@felixxm felixxm left a comment

Choose a reason for hiding this comment

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

@carltongibson Thanks for you humongous work 🥇 ⛰️

I don't like bulk updates, but, as far as I'm aware, we have no choice 😐 :

Should we also remove (currently unused 🤔 ) highlight directives?:

  • howto/deployment/wsgi/uwsgi.txt: .. highlight:: bash
  • howto/deployment/wsgi/gunicorn.txt: .. highlight:: bash
  • howto/deployment/asgi/daphne.txt: .. highlight:: bash
  • howto/deployment/asgi/hypercorn.txt: .. highlight:: bash
  • howto/deployment/asgi/uvicorn.txt: .. highlight:: bash
  • internals/contributing/writing-code/unit-tests.txt: .. highlight:: python
  • internals/contributing/triaging-tickets.txt: .. highlight:: console
  • internals/howto-release-django.txt: .. highlight:: console
  • ref/contrib/gis/install/index.txt: .. highlight:: console
  • releases/1.0-porting-guide.txt: .. highlight:: python
  • topics/security.txt: .. highlight:: html+django
  • topics/i18n/translation.txt: .. highlight:: python
  • topics/i18n/translation.txt: .. highlight:: javascript
  • topics/i18n/translation.txt: .. highlight:: python
  • topics/i18n/translation.txt: .. highlight:: python
  • topics/templates.txt: .. highlight:: python
  • topics/forms/modelforms.txt: .. highlight:: python
  • topics/cache.txt: .. highlight:: python

@carltongibson carltongibson force-pushed the code-blocks branch 2 times, most recently from 28f95ad to 9de9e35 Compare February 10, 2023 13:13
@carltongibson
Copy link
Member Author

Thanks @felixxm!

I don't like bulk updates, but, as far as I'm aware, we have no choice 😐 :

Yep, me neither. They're recipe for trouble... — but yes, necessary if we're going to proceed here.

I applied all the suggestions and removed the highlight directives, and rebased.

@pauloxnet
Copy link
Member

I don't like bulk updates, but, as far as I'm aware, we have no choice neutral_face

Yep, me neither. They're recipe for trouble... — but yes, necessary if we're going to proceed here.

Regardless of the future PR for blacken-docs, this PR I believe will greatly improve the correctness of all code blocks highlight by greatly increasing the documentation accessibility.

Well done!

@carltongibson
Copy link
Member Author

Thanks @pauloxnet 😊 it's not that I think it's not worth it, but I'm pulled both ways (ambivalent) 😛

@smithdc1
Copy link
Member

Presumably this and future related commits would be good candidates to add to the git-blame-ignore-revs file? 🤔

Thanks to J.V. Zammit, Paolo Melchiorre, and Mariusz Felisiak for
reviews.
@felixxm
Copy link
Member

felixxm commented Feb 10, 2023

Presumably this and future related commits would be good candidates to add to the git-blame-ignore-revs file?

Yes, I'll add it to the .git-blame-ignore-revs.

@felixxm felixxm merged commit 534ac48 into django:main Feb 10, 2023
@adamchainz
Copy link
Member

A little late to the party here, but all LGTM 👍

@carltongibson carltongibson deleted the code-blocks branch February 15, 2023 12:51
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.

6 participants