[PYTHON] W3C Validators didn't work with Sublime Text3 so I made it work

What are W3C Validators?

[Sublime Text 2] W3C validation check package "W3C Validators" | Bashalog.

dubharmonic/Sublime-W3CValidators

Python for the first time

It was Python that I touched for the first time, but it was a simple source, so I decided to fix it. As a result, it mainly supports Python 2-> 3.

Refer to the official reference. API Reference - Sublime Text 3 Documentation Porting Guide - Sublime Text 3 Documentation

Also, Python 2-> 3 and later guides. Python 3 Porting Guide — Porting to Python 3 v1 documentation

Changes

It seems that the specifications of urllib have been changed and that it has to be encoded / decoded in binary when sending and receiving requests.

reference: Python 3.x: urllib.request error - Stack Overflow

-    encodedParams = urllib.urlencode(params)
-    output = urllib.urlopen(validatorUrl, encodedParams).read()
+    encodedParams = urllib.parse.urlencode(params)
+    binary_data = encodedParams.encode('utf-8')
+    output = urllib.request.urlopen(validatorUrl, binary_data).read().decode("utf-8")
+    

Installation

Please download from the following, install manually, and then restart Sublime Text 3.

ksz/Sublime-W3CValidators

For Mac


git clone https://github.com/ksz/Sublime-W3CValidators
mv Sublime-W3CValidators ~/Library/Application Support/Sublime Text 3/Packages/

Recommended Posts

W3C Validators didn't work with Sublime Text3 so I made it work
I made a segment tree with python, so I will introduce it
I installed PySide2, but pyside2-uic didn't work, so I managed to do it.
I made a package like Weblio pop-up English-Japanese dictionary with Sublime Text3
I tried to use Java with Termux using Termux Arch but it didn't work
When I tried to create a virtual environment with Python, it didn't work
Docker x visualization didn't work and I was addicted to it, so I summarized it!
I like Python's comprehension, so I compared it with map
Pythonbrew with Sublime Text
I made it with processing, "Sakanaction's live Othello guy".
When I try to push with heroku, it doesn't work
[I made it with Python] XML data batch output tool
I made blackjack with python!
I made a python text
I made COVID19_simulator with JupyterLab
I made Word2Vec with Pytorch
I made blackjack with Python.
I made wordcloud with Python.
Life game with Python [I made it] (on the terminal & Tkinter)
I made a chatbot with Tensor2Tensor and this time it worked
GOTO in Python with Sublime Text 3
I made a fortune with Python.
Enable Python raw_input with Sublime Text 3
I got stuck so I reviewed it
I made a daemon with Python
[Electronic work] I made a Suica touch sound detector with Raspberry Pi
I didn't understand the behavior of numpy's argsort, so I will summarize it.
I got an SSL related error with pip install, so I solved it
I tried to make a calculator with Tkinter so I will write it
I tried to install Docker on Windows 10 Home but it didn't work
I made a GAN with Keras, so I made a video of the learning process.
When I made a treemap (area graph) with python, it was subtle, so when I used flourish, it felt pretty good.