tarides / olinkcheck Goto Github PK
View Code? Open in Web Editor NEWLicense: ISC License
License: ISC License
Some files have nested formats, eg: markdown in yaml, html in xml, etc. Nested parsers should allow us to handle these, given a function which identifies the text in the "inner" format.
You probably didn't even noticed opam installed an obsolete version of omd. The re's not Omd_representation module in the new version.
Document all the functionality and command line options in the README.
Most md
files in ocaml.org have a YAML header followed by either markdown or HTML. A chained parser should allow us to handle two different formats in the same file given a regex to separate them.
Making all the requests in sequence is way too slow. This needs to be parallelized.
This will allow us to serve all possible HTTP status codes. That would be helpful for testing.
Such as:
Add an option to skip reporting Ok status
Currently, there is a method annotate_in_str
for all the formats which takes in a string and parses it to extract the links. However, when we want to replace the broken links annotated with their status back in the source (for eg: [link](http://www.google.com/does-not-exist)
to [link](http://www.google.com/does-not-exist - [404 Not Found])
, it is done directly in the source string using regular expression matching.
Ideally, it could be done by replacing it in the AST, and transforming the AST back to a string, but this poses some challenges:
# Heading 1
# Heading 2
is the same as
# Heading 1
# Heading 2
for most practical purposes. But one of the use cases for us it to create a PR with the broken links annotated, and the parser discarding characters will generate a noisy diff
with whitespace changes.
Ideally, every parser we use should give us some location information so that we could write a to_string
preserving the original structure, but this is currently not the case.
Several output formats should be considered.
Here is how it could look like:
let broken_links, f = Olinkcheck.parse_and_seach data in
let fixed_links = List.map (fun link -> ... ) in
snd (List.fold_left f (0, data) fixed_links)
The invariant of such an API would be
snd (List.fold_left f (0, data) broken_links) = data
val check_md : md -> (http_status * url) list * (int -> url -> md)
Add a --with-yaml-header
flag to be used only with the md
format.
Some websites like amazon.com do not want to be queried with User-Agent curl
. Amazon.com links give a 503 in this case.
make omd, plaintext and sexp be instances of a functor
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.