Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,782 changes: 1,237 additions & 2,545 deletions docs/v1.html

Large diffs are not rendered by default.

10,381 changes: 6,149 additions & 4,232 deletions docs/v2.html

Large diffs are not rendered by default.

10,991 changes: 6,556 additions & 4,435 deletions docs/v3.html

Large diffs are not rendered by default.

13,037 changes: 8,096 additions & 4,941 deletions docs/v4.html

Large diffs are not rendered by default.

13,031 changes: 8,086 additions & 4,945 deletions docs/v5.html

Large diffs are not rendered by default.

13,031 changes: 8,086 additions & 4,945 deletions docs/v6.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions download-openapi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ for v in v1 v2 v3 v4 v5 v6; do \
curl -s http://192.168.58.25/cgi-bin/mt/mt-data-api.cgi/${v}/ \
| jq '.servers[0].url = "https://example.com/mt/mt-data-api.cgi/v1"' \
| jq -S . > src/openapi/${v}.json; \
perl json2yaml.pl src/openapi/${v}.json > src/openapi/${v}.yaml; \
done
21 changes: 21 additions & 0 deletions json2yaml.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/perl

use strict;
use warnings;
use feature qw/say/;
use JSON;
use YAML;
use Data::Dumper; $Data::Dumper::Indent = 1;

my $filename = $ARGV[0];

exit 1 unless $filename;

open my $fh, '<', $filename;
my $file = do { local $/; <$fh> };
close $fh;

my $json = JSON::decode_json($file);
local $YAML::Stringify = 1;
my $yaml = Dump($json);
say $yaml;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
},
"homepage": "https://github.com/movabletype/mt-docs-data-api-reference#readme",
"devDependencies": {
"@redocly/cli": "^1.5.0",
"child_process": "^1.0.2",
"css-loader": "^6.7.1",
"gulp": "^4.0.2",
"gulp-connect": "^5.7.0",
"marked": "^4.1.1",
"redoc-cli": "^0.13.20",
"style-loader": "^3.3.1",
"webpack": "^5.94.0",
"webpack-cli": "^4.10.0"
Expand Down
4 changes: 2 additions & 2 deletions redoc-build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh

for v in v1 v2 v3 v4 v5 v6; do \
npx redoc-cli build src/openapi/${v}.json \
npx @redocly/cli build-docs src/openapi/${v}.yaml \
--template src/openapi/data-api-redoc.hbs \
--disableGoogleFont \
--title "Movable Type Data API ${v}" \
--templateOptions.metaDescription "Movable Type Data API ${v}" \
--options.sortTagsAlphabetically=true \
--config redoc.config.yaml \
--output docs/${v}.html; \
done
3 changes: 3 additions & 0 deletions redoc.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
theme:
openapi:
sortTagsAlphabetically: true
Loading