diff options
author | Matias Linares <matiaslina@gmail.com> | 2019-06-05 00:46:00 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@gmail.com> | 2019-06-05 00:46:00 -0300 |
commit | bc6c791c72f9fe460fdb9559522ae154124e8e97 (patch) | |
tree | a6be2f25368a6c8dc6df95a9db4fc4da16ac1c77 /scripts | |
parent | 2d54d1357deacf23c53bde9b521d464fc2fcb15e (diff) | |
parent | 4c007e0df300e7fb281fcadbcf707b71ed7e2483 (diff) | |
download | perl6-matrix-client-bc6c791c72f9fe460fdb9559522ae154124e8e97.tar.gz |
Merge branch 'master' into documentation
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/load-docs.p6 | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/scripts/load-docs.p6 b/scripts/load-docs.p6 index d3a1f81..b20dd86 100755 --- a/scripts/load-docs.p6 +++ b/scripts/load-docs.p6 @@ -1,7 +1,9 @@ #!/usr/bin/env perl6 use v6; +use lib <lib>; use HTTP::UserAgent; use JSON::Fast; +use Matrix::Client; sub get-api-docs { my $url = "https://matrix.org/docs/api/client-server/json/api-docs.json"; @@ -32,19 +34,33 @@ sub get-api-docs { sub MAIN(:$spec?) { my %tags = get-api-docs; + my $implemented-methods = (Matrix::Client, Matrix::Client::Room).map(*.^methods) + .flat.map( + { + quietly try { .WHY.Str } or "" + }).grep(/_matrix/).SetHash; + say q:to/EOF/; + # List of implemented endpoints + + This list was generated by the `load-docs.p6` script that gets the data + from the [api-docs.json](https://matrix.org/docs/api/client-server/json/api-docs.json) + from matrix.org. This will give you an overview about what's implemented in the library. + EOF + for %tags.sort -> $pair { my $tag = $pair.key; my $methods = $pair.value; say qq:to/EOF/; - # $tag + ## $tag EOF - for $methods.Seq -> $m { - my Str $method = $m; + for $methods.Seq.sort -> $m { + my Str $method = $m.trim; + my $checked = $implemented-methods{$m} ?? "X" !! " "; if $spec { $method = $m.subst(/unstable/, $spec) } - say "- [ ] " ~ $method; + say "- [$checked] " ~ $method; } say ""; } |