1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 04:35:12 +01:00
MadelineProto/build_docs.php
2017-01-02 18:52:29 +00:00

56 lines
2.4 KiB
PHP
Executable File

#!/usr/bin/env php
<?php
/*
Copyright 2016 Daniil Gentili
(https://daniil.it)
This file is part of MadelineProto.
MadelineProto is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
MadelineProto is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.
You should have received a copy of the GNU General Public License along with MadelineProto.
If not, see <http://www.gnu.org/licenses/>.
*/
require 'vendor/autoload.php';
$param = 1;
\danog\MadelineProto\Logger::constructor($param);
\danog\MadelineProto\Logger::log('Copying readme...');
file_put_contents('docs/index.md', '---
title: MadelineProto documentation
description: PHP implementation of telegram\'s MTProto protocol
---
'.file_get_contents('README.md'));
$docs = [
[
'tl_schema' => ['mtproto' => __DIR__.'/src/danog/MadelineProto/TL_mtproto_v1.json'],
'title' => 'MadelineProto API documentation (mtproto)',
'description' => 'MadelineProto API documentation (mtproto)',
'output_dir' => __DIR__.'/docs/MTProto_docs',
],
[
'tl_schema' => ['telegram' => __DIR__.'/src/danog/MadelineProto/TL_telegram_v57.json'],
'title' => 'MadelineProto API documentation (layer 57)',
'description' => 'MadelineProto API documentation (layer 57)',
'output_dir' => __DIR__.'/docs/API_docs',
],
[
'tl_schema' => ['telegram' => __DIR__.'/src/danog/MadelineProto/TL_telegram_v55.json'],
'title' => 'MadelineProto API documentation (layer 55)',
'description' => 'MadelineProto API documentation (layer 55)',
'output_dir' => __DIR__.'/docs/API_docs_55',
],
[
'tl_schema' => ['telegram' => __DIR__.'/src/danog/MadelineProto/TL_telegram_v46.tl'],
'title' => 'MadelineProto API documentation (layer 46)',
'description' => 'MadelineProto API documentation (layer 46)',
'output_dir' => __DIR__.'/docs/API_docs_46',
],
];
foreach ($docs as $settings) {
$doc = new \danog\MadelineProto\DocsBuilder($settings);
$doc->mk_docs();
}