在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:svenkreiss/html5validator开源软件地址:https://github.com/svenkreiss/html5validator开源编程语言:Python 50.8%开源软件介绍:HTML5 Validator
InstallThis module requires Python 3.6, 3.7, 3.8, 3.9 or 3.10 and Java 8 ( html5validator --root _build/ to validate all html files in the usage: html5validator [-h] [--root ROOT] [--match MATCH [MATCH ...]] [--blacklist [BLACKLIST ...]] [--show-warnings] [--no-langdetect] [--no-vnu-stdout] [--no-asciiquotes] [--format {gnu,xml,json,text}] [--ignore [IGNORE ...]] [--ignore-re [IGNORE_RE ...]] [--config CONFIG] [-l] [-ll] [-lll] [--log LOG] [--log-file LOG_FILE] [--version] [files ...] [v0.4.2] Command line tool for HTML5 validation. Return code is 0 for valid HTML5. Arguments that are unknown to html5validator are passed as arguments to `vnu.jar`. positional arguments: files specify files to check optional arguments: -h, --help show this help message and exit --root ROOT start directory to search for files to validate --match MATCH [MATCH ...] match file pattern in search (default: "*.html" or "*.html *.css" if --also-check-css is used) --blacklist [BLACKLIST ...] directory names to skip in search --show-warnings show warnings and count them as errors --no-langdetect disable language detection --no-vnu-stdout do not use --stdout with vnu.jar --no-asciiquotes do not use --asciiquotes with vnu.jar --format {gnu,xml,json,text} output format --ignore [IGNORE ...] ignore messages containing the given strings --ignore-re [IGNORE_RE ...] regular expression of messages to ignore --config CONFIG Path to a config file for options -l run on larger files: sets Java stack size to 2048k -ll run on larger files: sets Java stack size to 8192k -lll run on larger files: sets Java stack size to 32768k --log LOG log level: DEBUG, INFO or WARNING (default: WARNING) --log-file LOG_FILE Name for log file. If no name supplied then no log file will be created --version show program's version number and exit This module uses the validator.nu backend which is written in Java. Therefore, a Java Runtime Environment must be available on your system. Since version 0.2, Java 8 is required. Checking CSS/SVGhtml5validator --root _build/ --also-check-css
# checking only CSS
html5validator --root _build/ --skip-non-css Replace Integration with CircleCI 1.0Create a machine:
java:
version: openjdk8
dependencies:
pre:
- sudo pip install html5validator
test:
override:
- html5validator --root _build/ in your repository with static html files and get HTML5 validation on every
Integration with CircleCI 2.0Simplified example version: 2
jobs:
test-3.6:
docker:
- image: python:3.6-stretch
steps:
- run:
name: install Java
command: apt-get update && apt-get install -y openjdk-8-jre
- checkout
- run:
name: install
command: pip install '.[test]'
- run:
name: generate html
working_directory: test/example_site
command: pelican content -s pelicanconf.py
- run:
name: validate html
command: html5validator --root test/example_site/output
workflows:
version: 2
build_and_test:
jobs:
- test-3.6 Integration with TravisCICreate a language: python
python:
- "2.7"
addons:
apt:
packages:
- openjdk-8-jre # install Java8 as required by vnu.jar
branches:
only:
- gh-pages
install:
- pip install html5validator
script: html5validator --root _build/ This is an example for Java project: language: java
jdk:
- oraclejdk8 # vnu.jar requires Java 8
branches:
only:
- gh-pages
install:
- pip install --user html5validator
script: html5validator --root _build/ Fix the You can also use this for user pages (repositories of the form branches:
only:
- gh-pages from Integration with CodeShipAdd this lines to the jdk_switcher use oraclejdk8
pip install html5validator This is an example for Ruby project: rvm use 2.2.0 --install
bundle install
bundle update
export RAILS_ENV=test
jdk_switcher use oraclejdk8
pip install html5validator Integration with GitLab CIThere is a docker image available to be used with GitLab CI or stand alone. Docker image, Docker image repo. Example for html test (Full): html_test:
stage: html_test
image: cyb3rjak3/html5validator:latest
script:
- html5validator --root public/ --also-check-css --format text Integration with GitHub ActionsThere is a Github Action that can be used to check repositories. Marketplace Link. Example action: - name: HTML5 Validator
uses: Cyb3r-Jak3/html5validator-action@master
with:
root: html/ Technical Notes
ChangelogInstall a particular version, for example
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论