Skip to content

Syntax highlighting for ASDL #84697

Description

@isidentical
BPO 40517
Nosy @rhettinger, @terryjreedy, @ezio-melotti, @merwok, @zware, @willingc, @JulienPalard, @isidentical
PRs
  • bpo-40517: Implement syntax highlighting support for ASDL #19928
  • Revert "bpo-40517: Implement syntax highlighting support for ASDL" #19950
  • bpo-40517: Implement syntax highlighting support for ASDL #19967
  • Files
  • Screen Shot 2020-05-05 at 10.17.15 PM.png: Screen shot of the AST docs
  • asdl.png
  • asdl2.png
  • python_bold.png
  • asdl_no_style.png
  • bold_dark_blue.png
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-05-07.20:58:17.968>
    created_at = <Date 2020-05-05.13:51:02.634>
    labels = ['type-feature', '3.9', 'docs']
    title = 'Syntax highlighting for ASDL'
    updated_at = <Date 2020-05-07.21:01:28.137>
    user = 'https://github.com/isidentical'

    bugs.python.org fields:

    activity = <Date 2020-05-07.21:01:28.137>
    actor = 'BTaskaya'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2020-05-07.20:58:17.968>
    closer = 'rhettinger'
    components = ['Documentation']
    creation = <Date 2020-05-05.13:51:02.634>
    creator = 'BTaskaya'
    dependencies = []
    files = ['49129', '49133', '49134', '49135', '49136', '49138']
    hgrepos = []
    issue_num = 40517
    keywords = ['patch']
    message_count = 22.0
    messages = ['368148', '368209', '368225', '368226', '368228', '368230', '368266', '368291', '368292', '368294', '368297', '368300', '368303', '368311', '368313', '368324', '368331', '368344', '368352', '368376', '368377', '368378']
    nosy_count = 9.0
    nosy_names = ['rhettinger', 'terry.reedy', 'ezio.melotti', 'eric.araujo', 'docs@python', 'zach.ware', 'willingc', 'mdk', 'BTaskaya']
    pr_nums = ['19928', '19950', '19967']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue40517'
    versions = ['Python 3.9']

    Activity

    1. isidentical commented on May 5, 2020

      @isidentical
      SponsorMemberAuthor

      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.

    2. added
      docsDocumentation in the Doc dir
      type-featureA feature request or enhancement
      on May 5, 2020
    3. added
      docsDocumentation in the Doc dir
      type-featureA feature request or enhancement
      on May 5, 2020
    4. rhettinger commented on May 5, 2020

      @rhettinger
      Contributor

      +1

    5. rhettinger commented on May 6, 2020

      @rhettinger
      Contributor

      New changeset d60040b by Batuhan Taskaya in branch 'master':
      bpo-40517: Implement syntax highlighting support for ASDL (bpo-19928)
      d60040b

    6. rhettinger commented on May 6, 2020

      @rhettinger
      Contributor

      New changeset eff870b by Raymond Hettinger in branch 'master':
      Revert "bpo-40517: Implement syntax highlighting support for ASDL (bpo-19928)" (bpo-19950)
      eff870b

    7. rhettinger commented on May 6, 2020

      @rhettinger
      Contributor

      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.
    8. isidentical commented on May 6, 2020

      @isidentical
      SponsorMemberAuthor

      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.

    9. rhettinger commented on May 6, 2020

      @rhettinger
      Contributor

      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.

    10. isidentical commented on May 6, 2020

      @isidentical
      SponsorMemberAuthor

      Hey Raymond, can you give me your feedback on asdl.png (the screenshot of new theme)?

    11. rhettinger commented on May 6, 2020

      @rhettinger
      Contributor

      The new screenshot looks nice. The colors are much better. Can you post another run with the class names in bold.

    12. 3 remaining items

    13. isidentical commented on May 6, 2020

      @isidentical
      SponsorMemberAuthor

      Attaching 2 different styles python_bold.png (module <Python> is bold) and asdl_no_style.png (module <Python> has no style)

    14. terryjreedy commented on May 6, 2020

      @terryjreedy
      Member

      I tried both a laptop and desktop and slightly prefer unbolded. How about a darker blue?

    15. isidentical commented on May 6, 2020

      @isidentical
      SponsorMemberAuthor

      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.

    16. rhettinger commented on May 7, 2020

      @rhettinger
      Contributor

      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.

    17. isidentical commented on May 7, 2020

      @isidentical
      SponsorMemberAuthor

      I've found a bold dark blue, which I guess suits both your and @terry.reedy recommendations. How does bold_dark_blue.png looks?

    18. zware commented on May 7, 2020

      @zware
      Member

      I say merge it :)

    19. isidentical commented on May 7, 2020

      @isidentical
      SponsorMemberAuthor

      I've updated the PR with bold_dark_blue.png changes.

    20. rhettinger commented on May 7, 2020

      @rhettinger
      Contributor

      New changeset b7a78ca by Batuhan Taskaya in branch 'master':
      bpo-40517: Implement syntax highlighting support for ASDL (GH-19967)
      b7a78ca

    21. rhettinger commented on May 7, 2020

      @rhettinger
      Contributor

      Thanks for the contribution. It looks much nicer than what we had before.

    22. isidentical commented on May 7, 2020

      @isidentical
      SponsorMemberAuthor

      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.

    23. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.9 (EOL)end of lifedocsDocumentation in the Doc dirtype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions