Giter Club home page Giter Club logo

vasil-sh's Introduction

vasil.sh : Validation Script for Internal Link in html

Note: I have started this project primarily to validate the html generated by asciidoctor, but noticed that asciidoctor v1.5.6 and later implements the -v switch to provide build-time validation. See official documentation

This simple script provides function to validate internal link in html.

usage

  1. Download this script

  2. Import

  3. Just use.
    Here's a example usage.

    $ git clone https://github.com/kkimurak/vasil-sh.git
    
    $ cd vasil-sh
    
    $ tree
    .
    ├── README.md
    ├── test
    |   └── sample.html
    └── vasil.sh
    1 directory, 3 files
    
    $ vasil.sh test/sample.html
    
    $ echo $?
    5

    Note that offset is added to returning value if at least one invalid link found, to avoid conflict with other error message (e.g. 2 means "no such file").
    Please refer variable vasil_return_offset.

    You can set VASIL_DEBUG=true to see debug message

    $ VASIL_DEBUG=true sh vasil.sh test/sample.html
    link "invalid_link" is invalid
    link "link containing white space" is invalid
    2 invalid link found

    If you want to import function using source, set VASIL_USE_AS_FUNCTION to true and then do that.
    source is not specified in POSIX, so I'm not sure if it works for you.
    It works on my Fedora, but not works on Travis.

    $ VASIL_USE_AS_FUNCTION=true
    
    $ source vasil.sh && vasil_main test/sample.html
    
    $ echo $?
    5

author

k.kimura (@kkimurak)

vasil-sh's People

Contributors

kkimurak avatar

Watchers

 avatar

vasil-sh's Issues

Link string containing white space

Example html

<a href="this is unexpected generated link">This is unexpected generated link.</a>

expected output

$ ./html-link-validator.sh hoge.html
link "this is unexpected generated link" is invalid.
1 invalid link found.

what reported

$ ./html-link-validator.sh hoge.html
link this is invalid.
link is is invalid.
link unexpected is invalid.
link generated is invalid.
link link is invalid.
6 invalid link found.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.