Closed jyasskin closed 2 months ago
REST turns out to be less helpful than I expected: the endpoints are all GET, so there's no obvious way to send the file
parameter, and no examples in https://github.com/w3c/specberus/blob/main/README.md#5-rest-api.
The JS API kinda works, but I had to figure out that I needed to import the right profile instead of just writing "WD", and the EventEmitter interface for getting results is awkward.
@jyasskin thanks for the suggestion. We actually got similar requests in the past and one of the reasons we didn't support this is that pubrules relies on external services like the markup validator. That said, we can probably come up with a different approach to support file uploads but I will need to review the different use cases. I expect I'll be able to work on this in 2 or 3 weeks.
I am currently struggling with this exact problem at the moment and I would like to +1 the need for file upload as an input option. In my particular use case, I'm not the most proficient with REST or JS APIs so I am limited to the web interface.
I'm trying to prepare a file for publication, I don't really want to have to throw this temp file into my GH repo just to test this, it would be a lot more helpful to be able to upload it to Pubrules directly.
@jyasskin @wareid, sorry it took so long to implement but it is now possible to upload an HTML file to pubrules. It can be done from the web interface or from the API.
@deniak This is amazing! Thank you so much for taking care of this.
I'd like to iterate on pubrules errors in a local file, but https://www.w3.org/pubrules/ expects me to have a public URL available. I can use the JS or REST API, but it'd be more convenient if there were an
<input type=file>
control on that page.