-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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] Fix highlighting and always use latest packages #11662
Conversation
d72e713
to
e15a86d
Compare
pip3 install -r requirements.txt | ||
pip3 install -r requirements.txt --upgrade --upgrade-strategy eager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the whole point of the PR. Default upgrade strategy is only-if-needed
so if an older package happens to be already installed and fits the requirements but a newer version is also available, pip
keeps the older one.
Looks like we install the outdated python3-sphinx
ourselves in the Ubuntu image. I think we can safely remove it from there.
:: | ||
.. code-block:: none | ||
for { ... } 1 { ... } { | ||
if iszero(c) { break } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to use yul
with :force:
for this but I can't because we try to compile all yul snippets in cmdlineTests.sh
and these obviously won't compile.
…g unable to process the former
76bbd45
to
b513ca1
Compare
e15a86d
to
0f7a185
Compare
Depends on #11660 (I put whitespace changes in a separate PR because they add tons of noise).
The main point of this PR is to make
b_docs
job in CI use latest versions of Python packages, in particularPygments
. Locally I get a lot of errors from the highlighter but they do not appear in CI. Turns out it's because the image we use (solbuildpackpusher/solidity-buildpack-deps:ubuntu2004-6
) has an old version of Sphinx with its dependencies in it andpip
by default does not update a package unless it absolutely has to.To be able to do this I had to fix these highlighting errors though. Looks like the lexer has a lot of problems parsing fairly mundane stuff like
&&
,||
,? :
,1e18
orpragma solidity >x.y.z;
. In case of pragmas I fixed it by switching to>=
but for others I just had to use:force:
to make it continue despite errors. This is the same thing I noticed withassembly
blocks in #11420.pygments-lexer-solidity
does not seem actively maintained so we'll probably have to fix it ourselves eventually.While doing it I also found some
::
style blocks, apparently missed in #11477 so I converted them. Some existing blocks were also labeled with wrong language. Finally, I enabled highlighting for some of our JSON blocks (especially the Standard JSON input/output). They did have some syntax errors I had to fix (missing commas or quotes) and also I highlight them asjavascript
rather thanjson
because comments are technically not valid in JSON and the highliter does not accept them.