kopia lustrzana https://github.com/simonw/datasette
about and about_url metadata options
rodzic
41744d7690
commit
bf6b0f918d
|
@ -267,6 +267,9 @@ class Datasette:
|
||||||
"license": metadata.get("license") or self.metadata("license"),
|
"license": metadata.get("license") or self.metadata("license"),
|
||||||
"license_url": metadata.get("license_url")
|
"license_url": metadata.get("license_url")
|
||||||
or self.metadata("license_url"),
|
or self.metadata("license_url"),
|
||||||
|
"about": metadata.get("about") or self.metadata("about"),
|
||||||
|
"about_url": metadata.get("about_url")
|
||||||
|
or self.metadata("about_url"),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -217,6 +217,8 @@ def plugins(all, plugins_dir):
|
||||||
@click.option("--license_url", help="License URL for metadata")
|
@click.option("--license_url", help="License URL for metadata")
|
||||||
@click.option("--source", help="Source label for metadata")
|
@click.option("--source", help="Source label for metadata")
|
||||||
@click.option("--source_url", help="Source URL for metadata")
|
@click.option("--source_url", help="Source URL for metadata")
|
||||||
|
@click.option("--about", help="About label for metadata")
|
||||||
|
@click.option("--about_url", help="About URL for metadata")
|
||||||
def package(
|
def package(
|
||||||
files,
|
files,
|
||||||
tag,
|
tag,
|
||||||
|
|
|
@ -42,6 +42,8 @@ def add_common_publish_arguments_and_options(subcommand):
|
||||||
click.option("--license_url", help="License URL for metadata"),
|
click.option("--license_url", help="License URL for metadata"),
|
||||||
click.option("--source", help="Source label for metadata"),
|
click.option("--source", help="Source label for metadata"),
|
||||||
click.option("--source_url", help="Source URL for metadata"),
|
click.option("--source_url", help="Source URL for metadata"),
|
||||||
|
click.option("--about", help="About label for metadata"),
|
||||||
|
click.option("--about_url", help="About URL for metadata"),
|
||||||
)):
|
)):
|
||||||
subcommand = decorator(subcommand)
|
subcommand = decorator(subcommand)
|
||||||
return subcommand
|
return subcommand
|
||||||
|
|
|
@ -35,6 +35,8 @@ def publish_subcommand(publish):
|
||||||
license_url,
|
license_url,
|
||||||
source,
|
source,
|
||||||
source_url,
|
source_url,
|
||||||
|
about,
|
||||||
|
about_url,
|
||||||
name,
|
name,
|
||||||
):
|
):
|
||||||
fail_if_publish_binary_not_installed(
|
fail_if_publish_binary_not_installed(
|
||||||
|
@ -72,6 +74,8 @@ def publish_subcommand(publish):
|
||||||
"license_url": license_url,
|
"license_url": license_url,
|
||||||
"source": source,
|
"source": source,
|
||||||
"source_url": source_url,
|
"source_url": source_url,
|
||||||
|
"about": about,
|
||||||
|
"about_url": about_url,
|
||||||
},
|
},
|
||||||
):
|
):
|
||||||
app_name = None
|
app_name = None
|
||||||
|
|
|
@ -39,6 +39,8 @@ def publish_subcommand(publish):
|
||||||
license_url,
|
license_url,
|
||||||
source,
|
source,
|
||||||
source_url,
|
source_url,
|
||||||
|
about,
|
||||||
|
about_url,
|
||||||
name,
|
name,
|
||||||
force,
|
force,
|
||||||
token,
|
token,
|
||||||
|
@ -70,6 +72,8 @@ def publish_subcommand(publish):
|
||||||
"license_url": license_url,
|
"license_url": license_url,
|
||||||
"source": source,
|
"source": source,
|
||||||
"source_url": source_url,
|
"source_url": source_url,
|
||||||
|
"about": about,
|
||||||
|
"about_url": about_url,
|
||||||
},
|
},
|
||||||
):
|
):
|
||||||
now_json = {
|
now_json = {
|
||||||
|
|
|
@ -21,5 +21,10 @@
|
||||||
<a href="{{ metadata.source_url }}">
|
<a href="{{ metadata.source_url }}">
|
||||||
{% endif %}{{ metadata.source or metadata.source_url }}{% if metadata.source_url %}</a>{% endif %}
|
{% endif %}{{ metadata.source or metadata.source_url }}{% if metadata.source_url %}</a>{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if metadata.about or metadata.about_url %}{% if metadata.license or metadata.license_url or metadata.source or metadat.source_url %}·{% endif %}
|
||||||
|
About: {% if metadata.about_url %}
|
||||||
|
<a href="{{ metadata.about_url }}">
|
||||||
|
{% endif %}{{ metadata.about or metadata.about_url }}{% if metadata.about_url %}</a>{% endif %}
|
||||||
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -33,6 +33,11 @@
|
||||||
<a href="{{ metadata.source_url }}">
|
<a href="{{ metadata.source_url }}">
|
||||||
{% endif %}{{ metadata.source or metadata.source_url }}{% if metadata.source_url %}</a>{% endif %}
|
{% endif %}{{ metadata.source or metadata.source_url }}{% if metadata.source_url %}</a>{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if metadata.about or metadata.about_url %}·
|
||||||
|
About: {% if metadata.about_url %}
|
||||||
|
<a href="{{ metadata.about_url }}">
|
||||||
|
{% endif %}{{ metadata.about or metadata.about_url }}{% if metadata.about_url %}</a>{% endif %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -21,4 +21,6 @@ Options:
|
||||||
--license_url TEXT License URL for metadata
|
--license_url TEXT License URL for metadata
|
||||||
--source TEXT Source label for metadata
|
--source TEXT Source label for metadata
|
||||||
--source_url TEXT Source URL for metadata
|
--source_url TEXT Source URL for metadata
|
||||||
|
--about TEXT About label for metadata
|
||||||
|
--about_url TEXT About URL for metadata
|
||||||
--help Show this message and exit.
|
--help Show this message and exit.
|
||||||
|
|
|
@ -16,5 +16,7 @@ Options:
|
||||||
--license_url TEXT License URL for metadata
|
--license_url TEXT License URL for metadata
|
||||||
--source TEXT Source label for metadata
|
--source TEXT Source label for metadata
|
||||||
--source_url TEXT Source URL for metadata
|
--source_url TEXT Source URL for metadata
|
||||||
|
--about TEXT About label for metadata
|
||||||
|
--about_url TEXT About URL for metadata
|
||||||
-n, --name TEXT Application name to use when deploying
|
-n, --name TEXT Application name to use when deploying
|
||||||
--help Show this message and exit.
|
--help Show this message and exit.
|
||||||
|
|
|
@ -16,6 +16,8 @@ Options:
|
||||||
--license_url TEXT License URL for metadata
|
--license_url TEXT License URL for metadata
|
||||||
--source TEXT Source label for metadata
|
--source TEXT Source label for metadata
|
||||||
--source_url TEXT Source URL for metadata
|
--source_url TEXT Source URL for metadata
|
||||||
|
--about TEXT About label for metadata
|
||||||
|
--about_url TEXT About URL for metadata
|
||||||
-n, --name TEXT Application name to use when deploying
|
-n, --name TEXT Application name to use when deploying
|
||||||
--force Pass --force option to now
|
--force Pass --force option to now
|
||||||
--token TEXT Auth token to use for deploy
|
--token TEXT Auth token to use for deploy
|
||||||
|
|
|
@ -133,6 +133,8 @@ METADATA = {
|
||||||
'license_url': 'https://github.com/simonw/datasette/blob/master/LICENSE',
|
'license_url': 'https://github.com/simonw/datasette/blob/master/LICENSE',
|
||||||
'source': 'tests/fixtures.py',
|
'source': 'tests/fixtures.py',
|
||||||
'source_url': 'https://github.com/simonw/datasette/blob/master/tests/fixtures.py',
|
'source_url': 'https://github.com/simonw/datasette/blob/master/tests/fixtures.py',
|
||||||
|
'about': 'About Datasette',
|
||||||
|
'about_url': 'https://github.com/simonw/datasette',
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"name-of-plugin": {
|
"name-of-plugin": {
|
||||||
"depth": "root"
|
"depth": "root"
|
||||||
|
|
|
@ -744,14 +744,16 @@ def assert_querystring_equal(expected, actual):
|
||||||
|
|
||||||
def assert_footer_links(soup):
|
def assert_footer_links(soup):
|
||||||
footer_links = soup.find('div', {'class': 'ft'}).findAll('a')
|
footer_links = soup.find('div', {'class': 'ft'}).findAll('a')
|
||||||
assert 3 == len(footer_links)
|
assert 4 == len(footer_links)
|
||||||
datasette_link, license_link, source_link = footer_links
|
datasette_link, license_link, source_link, about_link = footer_links
|
||||||
assert 'Datasette' == datasette_link.text.strip()
|
assert 'Datasette' == datasette_link.text.strip()
|
||||||
assert 'tests/fixtures.py' == source_link.text.strip()
|
assert 'tests/fixtures.py' == source_link.text.strip()
|
||||||
assert 'Apache License 2.0' == license_link.text.strip()
|
assert 'Apache License 2.0' == license_link.text.strip()
|
||||||
|
assert 'About Datasette' == about_link.text.strip()
|
||||||
assert 'https://github.com/simonw/datasette' == datasette_link['href']
|
assert 'https://github.com/simonw/datasette' == datasette_link['href']
|
||||||
assert 'https://github.com/simonw/datasette/blob/master/tests/fixtures.py' == source_link['href']
|
assert 'https://github.com/simonw/datasette/blob/master/tests/fixtures.py' == source_link['href']
|
||||||
assert 'https://github.com/simonw/datasette/blob/master/LICENSE' == license_link['href']
|
assert 'https://github.com/simonw/datasette/blob/master/LICENSE' == license_link['href']
|
||||||
|
assert 'https://github.com/simonw/datasette' == about_link['href']
|
||||||
|
|
||||||
|
|
||||||
def inner_html(soup):
|
def inner_html(soup):
|
||||||
|
|
Ładowanie…
Reference in New Issue