{"action":"created","issue":{"url":"https://api.github.com/repos/LMFDB/lmfdb/issues/1445","repository_url":"https://api.github.com/repos/LMFDB/lmfdb","labels_url":"https://api.github.com/repos/LMFDB/lmfdb/issues/1445/labels{/name}","comments_url":"https://api.github.com/repos/LMFDB/lmfdb/issues/1445/comments","events_url":"https://api.github.com/repos/LMFDB/lmfdb/issues/1445/events","html_url":"https://github.com/LMFDB/lmfdb/pull/1445","id":156422311,"number":1445,"title":"uniformize \"show commands using\" appearance and implementation","user":{"login":"AndrewVSutherland","id":11425002,"avatar_url":"https://avatars.githubusercontent.com/u/11425002?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewVSutherland","html_url":"https://github.com/AndrewVSutherland","followers_url":"https://api.github.com/users/AndrewVSutherland/followers","following_url":"https://api.github.com/users/AndrewVSutherland/following{/other_user}","gists_url":"https://api.github.com/users/AndrewVSutherland/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewVSutherland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewVSutherland/subscriptions","organizations_url":"https://api.github.com/users/AndrewVSutherland/orgs","repos_url":"https://api.github.com/users/AndrewVSutherland/repos","events_url":"https://api.github.com/users/AndrewVSutherland/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewVSutherland/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-24T05:24:59Z","updated_at":"2016-05-24T09:15:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/LMFDB/lmfdb/pulls/1445","html_url":"https://github.com/LMFDB/lmfdb/pull/1445","diff_url":"https://github.com/LMFDB/lmfdb/pull/1445.diff","patch_url":"https://github.com/LMFDB/lmfdb/pull/1445.patch"},"body":"Addresses the non-uniformity of \"Show commands\" code that was implemented in eight similar but all slightly different ways: see https://github.com/LMFDB/lmfdb/pull/1433#issuecomment-220806447 for a list of six example pages that you can compare side-by-side, and there are two new modular forms pages that use show commands as of PR #1433:\r\n\r\nhttp://127.0.0.1:37777/ModularForm/GL2/Q/holomorphic/3/6/1/\r\nhttp://127.0.0.1:37777/ModularForm/GL2/Q/holomorphic/3/6/1/a/\r\n\r\n(note PR #1433 was never pushed to beta, I wanted to get this PR in first).\r\n\r\nThis was achieved by moving almost all the html code into homepage.html, so that it is implemented in just one place.  The macro place_code defined in homepage.html can then be used to place code snippets where ever they are needed.\r\n\r\nI also fixed a few bugs I noticed along the way (e.g. the display code for Galois orbits of Dirichlet characters was broken), and cleaned up some inconsistent formatting in some of the code snippets.\r\n\r\nAside from improving the appearance (and getting rid of a few hundred lines of duplicated code), there should be no functional changes.  One thing worth noting is that the existing implementation of code snippets in the elliptic_curves and ecnf pages uses a lazy evaluation approach (it doesn't actually create code snippets until they are needed), with this PR this is no longer the case.  This has no impact on performance -- the code snippets are generally not much longer than the lazy macros that server as stand-ins (page sizes changed by less than 1 percent in the cases I measured), and in either case the time to display them is completely negligible compared to the work mathjax is doing to render the rest of the page.\r\n\r\nI ran the full test suite on atkin and (after fixing test_root.py) everything passed except for test_acknowledgements which fails when attempting to connect to hobbes.la.asu.edu (known temporary problem)."},"comment":{"url":"https://api.github.com/repos/LMFDB/lmfdb/issues/comments/221211871","html_url":"https://github.com/LMFDB/lmfdb/pull/1445#issuecomment-221211871","issue_url":"https://api.github.com/repos/LMFDB/lmfdb/issues/1445","id":221211871,"user":{"login":"JohnCremona","id":3100137,"avatar_url":"https://avatars.githubusercontent.com/u/3100137?v=3","gravatar_id":"","url":"https://api.github.com/users/JohnCremona","html_url":"https://github.com/JohnCremona","followers_url":"https://api.github.com/users/JohnCremona/followers","following_url":"https://api.github.com/users/JohnCremona/following{/other_user}","gists_url":"https://api.github.com/users/JohnCremona/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnCremona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnCremona/subscriptions","organizations_url":"https://api.github.com/users/JohnCremona/orgs","repos_url":"https://api.github.com/users/JohnCremona/repos","events_url":"https://api.github.com/users/JohnCremona/events{/privacy}","received_events_url":"https://api.github.com/users/JohnCremona/received_events","type":"User","site_admin":false},"created_at":"2016-05-24T09:15:26Z","updated_at":"2016-05-24T09:15:26Z","body":"Thanks a lot for doing this -- completing what I started (in a much smaller way) when I started using macros to insert code snippets set elsewhere than in the template, though I was doing it piecemeal and you have done it much more systematically.\r\n\r\nSmall point:  the lines \r\n      info['code'] = dict([(k[4:],info[k]) for k in info if k[0:4] == \"code\"])\r\n        info['code']['show'] = { lang:'' for lang in info['codelangs'] } # use default show names\r\nappear several times in  the file characters/main.py.   Since the first is a bit technical is might be safer to make it a macro (i.e. separate python function) defined in one place as a transformation to be done on info.\r\n\r\nStill trying out the various page types..."}}
{"actor":{"display_login":"JohnCremona"}}