{% extends "base.html" %}
{% block body %}
<div class="jumbotron">
    <div class="container">
        <br />
        <h1>What is this?</h1>
        <p>
            This takes a url that is very long and gives a shortened version that when hit will redirect to the long version.
            For example, if you have a url that is https://www.example.com/path/to/some/stuff?with&lots&of&stuff&after&it, you
            can create a shortened URL that is just {{ url_base }}/+0 that you can easily communicate, or link to where you don't
            want to jumble up the view with a very long URL.
        </p>
        <h2>Ok cool, how do I add a shortened URL</h2>
        <h3>Create a shortened URL with a random destination</h3>
        <p>
            Add a destination in the first box.  This should be in the format of https://www.example.com/stuff
            <br />
            <img alt="URL submit form" src="{{ url_for('static', filename='enter_url.png') }}">

        </p>
        <p>
            <div class="alert alert-dark" role="alert">
                Note that the URL validator is expecting there to be a path included.  So if you just type www.example.com
            you will get an error, because there is no path present.  You must end the URL with a / if you are going to
        a base URL.  So http://www.example.com will give an error, but http://www.example.com/ will work.
    </div>
        <p>Once you hit the Submit button, you will see the results page which will show your new shortened URL</p>
        <h3>Expected URL format?</h3>
        <p>
            You may specify the URL with or without the scheme (the http:// part at the beginning of the URL).
            Note that this service only deals with WEB redirects, so you may not use anything other than http or https
        </p>
        <p>
            As noted above, your URL must have a path included in it.  So if you are going to a base domain you
            <em>must</em> end the URL with a /.  If you have a url like http://www.example.com/something, then the
            /something is the path part.
        </p>
        <p>If you do not specify a scheme, it will default to http://, which will typically just work (though you may
        get an additional https redirect from the destination webserver).</p>
        <h2>Create a custom keyword-based URL</h2>
        <p>
            You may optionally add a /keyword URL type by specifying that keyword in addition to the destination URL
           <br/>
            <img alt="URL submit form" src="{{ url_for('static', filename='keyword.png') }}">
        </p>
        <p>
            If you specify something in the keyword field, you will get a
            random short URL AND your custom string.  Both URLS target the same redirect, so as far as hit count stats,
            they will be the same regardless of hitting the /keyword or /+0 &quot;random&quot; version.
        </p>
        <p>
        <h3> What's a Namespace?</h3>
        <p>Namespaces are a way to isolate keywords so that you ultimately increase the number of keywords people may use
            as the same keywords in different namespaces do not overlap.</p>
        <p>There are two default namespaces: global, and user.  Global are keywords directly at the root of the domain
            so a path like {{ url_base }}/shortcut.  The user namespace matches your own username and is prefixed with a tilde (~).
            Those urls would look something like {{ url_base }}/~username/shortcut</p>
        <p>When you expand the namespace dropdown (which defaults to user), you will see all namespaces to which you have permission:
            <img alt="Namespace selection" src="{{ url_for('static', filename='ns_expanded.png') }}">
        <h2>Editing a destination URL</h2>
            <p>
                You are able to edit the destination URL for any link which you have added from the <a href="{{ url_for('my_links') }}"> My Shortcuts</a> Page.
                From that page, click on the edit icon in the "Actions" column and enter the new URL you wish the shortlink/keyword to target.
            </p>
    <h3>What are the URL formats?</h3>
    <p> There are 5 types of URLs that work for {{ url_base }}
    <ol>
        <li>{{ url_base }}/+# : The shortlink format where # is a base36 encoded string</li>
        <li>{{ url_base }}/keyword :Global keyword </li>
        <li>{{ url_base }}/~username/keyword : User's custom namespace-based keywords </li>
        <li>{{ url_base }}/_something : Internal application paths</li>
    </ol>
    <h3>Can I change a shortlink ID or keyword?</h3>
        <p>No, you may only change the destination URL.  The shortlinks are always assumed to go to a valid endpoint once the are created, so you are able to change the endpoint, but not the source</p>
    <h3>Can I delete a link?</h3>
        <p>Well even though I just said "shortlinks are always assumed to go to a valid endpoint once they are created", there is planned functionality to delete shortcuts.</p>
    </div>
</div>
    {% endblock %}
