Skip to content

Commit a2d5134

Browse files
committed
📚 fixing doc
1 parent 8f4fa21 commit a2d5134

File tree

6 files changed

+96
-119
lines changed

6 files changed

+96
-119
lines changed

docs/sphinx/conf.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,10 @@
6161
html_theme = 'sphinx_rtd_theme'
6262

6363
html_theme_options = {
64-
#'canonical_url': 'https://brazil-data-cube.github.io/',
65-
'analytics_id': 'XXXXXXXXXX',
6664
'logo_only': False,
6765
'display_version': True,
6866
'prev_next_buttons_location': 'both',
6967
'style_external_links': True,
70-
#'vcs_pageview_mode': 'edit',
71-
#'github_url': 'https://github.com/brazil-data-cube/lccs.py',
7268
'style_nav_header_background': '#2980B9',
7369
'collapse_navigation': True,
7470
'sticky_navigation': False,
@@ -79,9 +75,6 @@
7975

8076
html_baseurl = 'https://brazil-data-cube.github.io/'
8177

82-
#html_theme_path = ''
83-
84-
#html_style = ''
8578

8679
html_title = 'LCCS'
8780

@@ -99,8 +92,6 @@
9992

10093
html_favicon = './img/favicon.ico'
10194

102-
#html_static_path = ['_static']
103-
10495
html_css_files = [ ]
10596

10697
html_last_updated_fmt = '%b %d, %Y'
@@ -126,6 +117,4 @@
126117
LCCS_EXAMPLE_URL = os.getenv('LCCS_EXAMPLE_URL', None)
127118
'''
128119

129-
#todo_include_todos = True
130-
#todo_emit_warnings = True
131120
master_doc = 'index'

lccs/lccs.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -370,15 +370,4 @@ def __str__(self):
370370

371371
def _repr_html_(self):
372372
"""HTML repr."""
373-
classification_systems = str()
374-
for classification_sys in self.classification_systems:
375-
classification_systems += f"<li>{classification_sys}</li>"
376-
return f"""<p>LCCS-WS</p>
377-
<ul>
378-
<li><b>URL:</b> {self._url}</li>
379-
<li><b>Classification Systems:</b></li>
380-
<ul>
381-
{classification_systems}
382-
</ul>
383-
</ul>
384-
"""
373+
return Utils.render_html('classification_systems.html', classification_systems=self.classification_systems)
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<style>
2+
.collapsible {
3+
background-color: #eee;
4+
color: #444;
5+
cursor: pointer;
6+
padding: 18px;
7+
width: 100%;
8+
border: none;
9+
text-align: left;
10+
outline: none;
11+
font-size: 15px;
12+
}
13+
14+
.active, .collapsible:hover {
15+
background-color: #ccc;
16+
}
17+
18+
.content {
19+
padding: 0 18px;
20+
display: none;
21+
overflow: hidden;
22+
background-color: #ffffff;
23+
}
24+
25+
.collapsible:after {
26+
content: '+'; /* Unicode character for "plus" sign (+) */
27+
font-size: 18px;
28+
color: black;
29+
float: right;
30+
margin-left: 5px;
31+
}
32+
33+
.active:after {
34+
content: "-"; /* Unicode character for "minus" sign (-) */
35+
}
36+
37+
table {
38+
width: 100%;
39+
border-collapse: collapse;
40+
margin-top: 10px;
41+
}
42+
43+
table, th, td {
44+
border: 1px solid #ddd;
45+
}
46+
47+
th, td {
48+
padding: 10px;
49+
text-align: left;
50+
}
51+
52+
th {
53+
background-color: #f4f4f4;
54+
}
55+
56+
tr:nth-child(even) {
57+
background-color: #f9f9f9;
58+
}
59+
</style>
60+
61+
<h1>Classification Systems</h1>
62+
63+
{% for system in classification_systems %}
64+
<button type="button" class="collapsible">
65+
<b>{{ system.title }} (Version {{ system.version }})</b>
66+
</button>
67+
<div class="content">
68+
<table>
69+
<tr>
70+
<th>Identifier</th>
71+
<th>Title</th>
72+
<th>Version</th>
73+
</tr>
74+
<tr>
75+
<td>{{ system.identifier }}</td>
76+
<td>{{ system.title }}</td>
77+
<td>{{ system.version }}</td>
78+
</tr>
79+
</table>
80+
</div>
81+
{% endfor %}
82+
83+
<script>
84+
document.querySelectorAll(".collapsible").forEach(button => {
85+
button.addEventListener("click", function() {
86+
this.classList.toggle("active");
87+
let content = this.nextElementSibling;
88+
content.style.display = content.style.display === "block" ? "none" : "block";
89+
});
90+
});
91+
</script>

lccs/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
This file is imported by ``lccs.__init__``,
2222
and parsed by ``setup.py``.
2323
"""
24+
from importlib.metadata import version
2425

25-
26-
__version__ = '0.9.0'
26+
__version__ = version(__package__)

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ classifiers = [
2121
"Programming Language :: Python :: 3.12",
2222
"Topic :: Software Development :: Libraries :: Python Modules",
2323
]
24-
version="0.9.1"
24+
version="1.0.0"
2525
dependencies = [
2626
"Click>=7.0",
2727
"jsonschema>=3.2",
@@ -31,6 +31,7 @@ dependencies = [
3131
"lxml>=4.9.1",
3232
"python-sld==1.0.10",
3333
"rich>=10.0.0",
34+
"httpx>=0.19.0",
3435
]
3536

3637
# Extras Dependencies

setup.py

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -21,96 +21,3 @@
2121
from setuptools import setup
2222

2323
setup()
24-
25-
# import os
26-
#
27-
# from setuptools import find_packages, setup
28-
#
29-
# readme = open('README.rst').read()
30-
#
31-
# history = open('CHANGES.rst').read()
32-
#
33-
# docs_require = [
34-
# 'Sphinx>=2.2',
35-
# 'sphinx_rtd_theme',
36-
# 'sphinx-copybutton',
37-
# ]
38-
#
39-
# tests_require = [
40-
# 'coverage>=4.5',
41-
# 'pytest>=5.2',
42-
# 'pytest-cov>=2.8',
43-
# 'pytest-pep8>=1.0',
44-
# 'pydocstyle>=4.0',
45-
# 'isort>4.3',
46-
# 'check-manifest>=0.40',
47-
# 'requests-mock>=1.7.0',
48-
# ]
49-
#
50-
# extras_require = {
51-
# 'docs': docs_require,
52-
# 'oauth': ['requests_oauthlib>=1.3'],
53-
# 'tests': tests_require,
54-
# }
55-
#
56-
# extras_require['all'] = [ req for exts, reqs in extras_require.items() for req in reqs ]
57-
#
58-
# setup_requires = [
59-
# 'pytest-runner>=5.2',
60-
# ]
61-
#
62-
# install_requires = [
63-
# 'Click>=7.0',
64-
# 'jsonschema>=3.2',
65-
# 'cachetools>=4.2.4',
66-
# 'requests>=2.20',
67-
# 'Jinja2>=2.11.1',
68-
# 'lxml>=4.9.1',
69-
# 'python-sld==1.0.10',
70-
# ]
71-
#
72-
# packages = find_packages()
73-
#
74-
# with open(os.path.join('lccs', 'version.py'), 'rt') as fp:
75-
# g = {}
76-
# exec(fp.read(), g)
77-
# version = g['__version__']
78-
#
79-
# setup(
80-
# name='lccs',
81-
# version=version,
82-
# description=__doc__,
83-
# long_description=readme + '\n\n' + history,
84-
# keywords=['Land Use and Land Cover', 'GIS'],
85-
# license='GPLv3',
86-
# author='INPE',
87-
# author_email='[email protected]',
88-
# url='https://github.com/brazil-data-cube/lccs.py',
89-
# packages=packages,
90-
# zip_safe=False,
91-
# include_package_data=True,
92-
# platforms='any',
93-
# entry_points={
94-
# 'console_scripts': [
95-
# 'lccs = lccs.cli:cli',
96-
# ],
97-
# },
98-
# extras_require=extras_require,
99-
# install_requires=install_requires,
100-
# setup_requires=setup_requires,
101-
# tests_require=tests_require,
102-
# classifiers=[
103-
# 'Development Status :: 1 - Planning',
104-
# 'Environment :: Web Environment',
105-
# 'Intended Audience :: Education',
106-
# 'Intended Audience :: Science/Research',
107-
# 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
108-
# 'Operating System :: OS Independent',
109-
# 'Programming Language :: Python :: 3.8',
110-
# 'Programming Language :: Python :: 3.9',
111-
# 'Programming Language :: Python :: 3.10',
112-
# 'Programming Language :: Python :: 3.11',
113-
# 'Topic :: Scientific/Engineering :: GIS',
114-
# 'Topic :: Software Development :: Libraries :: Python Modules',
115-
# ],
116-
# )

0 commit comments

Comments
 (0)