<?php

$platforms = $this->getParam('platforms', []);
$markdown = new \Parsedown();
$markdown->setSafeMode(true);

?>

<p>We provide libraries for major programming languages and platforms so you don't have to write code for interacting with our HTTP APIs from scratch.</p>

<p>Our team is always working on improving and extending the current stack of available platforms and SDKs, listed below is a list of official libraries our team is currently maintaining.</p>

<ul class="margin-top margin-bottom-large">
    <?php foreach ($platforms as $platform): ?>
        <?php if(!$platform['enabled']) { continue; } ?>
        <li class="margin-bottom-small">
            <a href="/docs/sdks#<?php echo strtolower($platform['name']); ?>"><i class="icon-angle-circled-right"></i><?php echo $this->escape($platform['name']); ?> SDKs<?php if($platform['beta']): ?> (experimental)<?php endif; ?></a>
        </li>
    <?php endforeach; ?>
</ul>

<?php foreach($platforms as $platform): ?>
    <?php if(!$platform['enabled']) { continue; } ?>
    <h2 href="/docs/sdks#<?php echo strtolower($platform['name']); ?>" id="<?php echo strtolower($platform['name']); ?>"><?php echo $platform['name']; ?> SDKs<?php if($platform['beta']): ?> (experimental)<?php endif; ?></h2>

    <p><?php echo $markdown->text($platform['description']); ?></p>

    <table cellspacing="0" cellpadding="0" border="0" class="full margin-bottom-large text-size-small vertical">
        <thead>
        <tr>
            <th style="width: 100px"></th>
            <th style="width: 160px">Platform</th>
            <th>GitHub Repository</th>
            <th style="width: 140px"></th>
        </tr>
        </thead>
        <tbody>
        <?php foreach($platform['sdks'] as $language): ?>
            <?php if(!$language['enabled']) { continue; } ?>
            <?php if($language['dev']) { continue; } ?>
            <?php if($language['hidden']) { continue; } ?>
        <tr>
            <td>
                <img src="/images-ee/platforms/<?php echo $language['key']; ?>.svg" alt="Logo" height="30" class="force-light sdk-logo margin-start margin-end" />
                <img src="/images-ee/platforms/dark/<?php echo $language['key']; ?>.svg" alt="Logo" height="30" class="force-dark sdk-logo margin-start margin-end" />
            </td>
            <td>
                <?php if($language['package']): ?>
                    <a href="<?php echo $this->escape($language['package']); ?>" target="_blank"><?php echo $language['name']; ?> SDK <i class="icon-link-ext"></i></a>
                <?php else: ?>
                    <?php echo $language['name']; ?> SDK
                <?php endif; ?>
                
                &nbsp;<span class="text-fade text-size-xs"><?php echo $language['version']; ?></span></td>
            <td>
                <?php if(!$language['enabled']): ?>
                    <span>Work in progress</span>
                <?php else: ?>
                    <a href="<?php echo $language['url']; ?>" target="_blank"><?php echo $language['gitUserName']; ?>/<?php echo $language['gitRepoName']; ?> <i class="icon-link-ext"></i></a>
                <?php endif; ?>
            </td>
            <td>
                <?php if($language['enabled']): ?>
                    <span class="tag">official</span>
                    <?php if($language['beta']): ?>
                        <span class="tag red margin-start-small">experimental</span>
                    <?php endif; ?>
                <?php endif; ?>
            </td>
        </tr>
        <?php endforeach; ?>
        </tbody>
    </table>
<?php endforeach; ?>

<!-- All icons from http://konpa.github.io/devicon/ -->

<p>If you would like to help us extend our platforms and SDKs stack, you are more than welcome to <a href="/contact">contact us</a> or check out our Appwrite <a href="https://github.com/appwrite/sdk-generator" target="_blank" rel="noopener">SDK Generator</a> project GitHub repository and read our <a href="https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md" target="_blank" rel="noopener">contribution guide</a>.</p>

<h2><a href="/docs/sdks#noSDK" id="noSDK">Integrate without an SDK</a></h2>

<p>We are always looking to add new SDKs to our platform, but if the SDK you are looking for is still missing or is labeled experimental, you can always integrate with Appwrite directly using any standard HTTP client and the Appwrite REST API. You can learn more about <a href="https://dev.to/eldadfux/learn-how-you-can-take-advantage-of-the-appwrite-api-without-using-any-sdk-a41" rel="noopener" target="_blank">how you can integrate directly with Appwrite HTTP API</a> from our dedicated blog post on the topic.</p>

<h2><a href="/docs/sdks#community" id="community">Community</a></h2>

<p>If you have created your own framework or any other technology specific integration and would like us to list it here please <a href="/contact">contact us</a>.</p>