This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Syntax highlighting for ASDL
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: BTaskaya, docs@python, eric.araujo, ezio.melotti, mdk, rhettinger, terry.reedy, willingc, zach.ware
Priority: normal Keywords: patch

Created on 2020-05-05 13:51 by BTaskaya, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Screen Shot 2020-05-05 at 10.17.15 PM.png rhettinger, 2020-05-06 05:39 Screen shot of the AST docs
asdl.png BTaskaya, 2020-05-06 19:06
asdl2.png BTaskaya, 2020-05-06 19:40
python_bold.png BTaskaya, 2020-05-06 22:03
asdl_no_style.png BTaskaya, 2020-05-06 22:03
bold_dark_blue.png BTaskaya, 2020-05-07 10:45
Pull Requests
URL Status Linked Edit
PR 19928 merged BTaskaya, 2020-05-05 13:54
PR 19950 merged rhettinger, 2020-05-06 05:24
PR 19967 merged BTaskaya, 2020-05-06 19:13
Messages (22)
msg368148 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-05-05 13:51
ASDL is around here for a long time, and it was showed as raw text on documentation (under library/ast), IMHO it would be great to highlight it.
msg368209 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2020-05-05 21:38
+1
msg368225 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2020-05-06 05:24
New changeset d60040ba226bd2e3b6f58d074015aa2499dc1cb8 by Batuhan Taskaya in branch 'master':
bpo-40517: Implement syntax highlighting support for ASDL (#19928)
https://github.com/python/cpython/commit/d60040ba226bd2e3b6f58d074015aa2499dc1cb8
msg368226 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2020-05-06 05:34
New changeset eff870b618ca6f6b7a60a271f15af7e54b8a1b97 by Raymond Hettinger in branch 'master':
Revert "bpo-40517: Implement syntax highlighting support for ASDL (#19928)" (#19950)
https://github.com/python/cpython/commit/eff870b618ca6f6b7a60a271f15af7e54b8a1b97
msg368228 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2020-05-06 05:39
I really like this idea but it needs different styling.  Attaching a screen shot will significant readability and beauty issues.

Suggest:
* Boldfacethe class names (Module, Interactive, etc)
* Unboldface the fields names (body, types_ignores, argtypes, etc)
* The tinted grape color does not work well on the green background.
* Perhaps have a graphic designer take a look.
msg368230 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-05-06 07:57
Oh, sorry for that bad look :/ I just want it to look consistent, let me see what I can do further (I'll probably consult a friend of mine who understand this things). By the way, I could've just adjust the values over the existing code if you didn't revert, the core logic would be same we just need to change token types.
msg368266 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2020-05-06 15:25
Sorry about the commit/revert. I fat fingered a comment.  Please do resubmit the PR.  In general, this is a nice idea.  The look just needs to be tweaked a bit.
msg368291 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-05-06 19:06
Hey Raymond, can you give me your feedback on asdl.png (the screenshot of new theme)?
msg368292 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2020-05-06 19:18
The new screenshot looks nice.  The colors are much better.  Can you post another run with the class names in bold.
msg368294 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-05-06 19:40
Unfortunately there aren't many `bold` type tokens I can use, so I had to change color of module <Python>. If you wish I can make both class names and `Python` bold, or keep it in this way.
msg368297 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-05-06 20:21
(by the way, I did not push this change. I'll push it when you think it is ready)
msg368300 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-05-06 21:47
I don't like the red Python in asdl2.  Just black, perhaps bold, would be better.  Also I like the darker blue in asdl.py, bold or not.  Better contrast to me from the greens.  But I agree that grape is too clashy.
msg368303 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-05-06 22:03
Attaching 2 different styles python_bold.png (module <Python> is bold) and asdl_no_style.png (module <Python> has no style)
msg368311 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-05-06 23:16
I tried both a laptop and desktop and slightly prefer unbolded.  How about a darker blue?
msg368313 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-05-06 23:20
> I tried both a laptop and desktop and slightly prefer unbolded.  How about a darker blue?

Sorry but I have no control over styles. They are pre-defined, I only change the token type and pygments handles the rest of it. I dont know if such a color exists.
msg368324 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2020-05-07 07:13
Thanks for producing the comparison panel.  In side-by-side views, python_bold.png looks best to me with asdl2.png as a close second.
msg368331 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-05-07 10:45
I've found a bold dark blue, which I guess suits both your and @terry.reedy recommendations. How does bold_dark_blue.png looks?
msg368344 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2020-05-07 14:35
I say merge it :)
msg368352 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-05-07 15:22
I've updated the PR with bold_dark_blue.png changes.
msg368376 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2020-05-07 20:57
New changeset b7a78ca74ab539943ab11b5c4c9cfab7f5b7ff5a by Batuhan Taskaya in branch 'master':
bpo-40517: Implement syntax highlighting support for ASDL (GH-19967)
https://github.com/python/cpython/commit/b7a78ca74ab539943ab11b5c4c9cfab7f5b7ff5a
msg368377 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2020-05-07 20:58
Thanks for the contribution.  It looks much nicer than what we had before.
msg368378 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-05-07 21:01
Thank you all for your reviews for styling, also I have to thank https://github.com/CyberSaxosTiGER for his external reviews on the color scheme.
History
Date User Action Args
2022-04-11 14:59:30adminsetgithub: 84697
2020-05-07 21:01:28BTaskayasetmessages: + msg368378
2020-05-07 20:58:17rhettingersetstatus: open -> closed
versions: + Python 3.9
messages: + msg368377

resolution: fixed
stage: patch review -> resolved
2020-05-07 20:57:34rhettingersetmessages: + msg368376
2020-05-07 15:22:54BTaskayasetmessages: + msg368352
2020-05-07 14:35:06zach.waresetnosy: + zach.ware
messages: + msg368344
2020-05-07 10:45:17BTaskayasetfiles: + bold_dark_blue.png

messages: + msg368331
2020-05-07 07:13:53rhettingersetmessages: + msg368324
2020-05-06 23:20:32BTaskayasetmessages: + msg368313
2020-05-06 23:16:34terry.reedysetmessages: + msg368311
2020-05-06 22:03:35BTaskayasetfiles: + asdl_no_style.png
2020-05-06 22:03:28BTaskayasetfiles: + python_bold.png

messages: + msg368303
2020-05-06 21:47:14terry.reedysetnosy: + terry.reedy
messages: + msg368300
2020-05-06 20:21:40BTaskayasetmessages: + msg368297
2020-05-06 19:40:38BTaskayasetfiles: + asdl2.png

messages: + msg368294
2020-05-06 19:18:40rhettingersetmessages: + msg368292
2020-05-06 19:13:07BTaskayasetpull_requests: + pull_request19282
2020-05-06 19:06:06BTaskayasetfiles: + asdl.png

messages: + msg368291
2020-05-06 15:25:16rhettingersetmessages: + msg368266
2020-05-06 07:57:44BTaskayasetmessages: + msg368230
2020-05-06 05:39:13rhettingersetfiles: + Screen Shot 2020-05-05 at 10.17.15 PM.png

messages: + msg368228
2020-05-06 05:34:02rhettingersetmessages: + msg368226
2020-05-06 05:24:52rhettingersetpull_requests: + pull_request19265
2020-05-06 05:24:48rhettingersetmessages: + msg368225
2020-05-05 21:38:55rhettingersetnosy: + rhettinger
messages: + msg368209
2020-05-05 13:54:27BTaskayasetkeywords: + patch
stage: patch review
pull_requests: + pull_request19243
2020-05-05 13:51:02BTaskayacreate