Skip to content

Commit

Permalink
Add sphinx-panels and fontawesome icons; fix html_favicon and logo
Browse files Browse the repository at this point in the history
  • Loading branch information
JWCook committed Jul 14, 2021
1 parent 56fb754 commit 7dfc0f2
Show file tree
Hide file tree
Showing 18 changed files with 87 additions and 52 deletions.
6 changes: 6 additions & 0 deletions docs/_static/colors.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* Main theme colors */
.md-primary {color: var(--color-brand-primary)}
.md-secondary {color: var(--color-brand-content)}

/* Color for Font Awesome icons */
span.fa {color: var(--color-brand-primary)}
File renamed without changes.
Binary file added docs/_static/pyinaturalist_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 10 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
# General information about the project.
copyright = '2021, Nicolas Noé, Jordan Cook'
exclude_patterns = ['_build', f'{MODULE_DOCS_DIR}/pyinaturalist.rst']
html_static_path = ['_static']
master_doc = 'index'
needs_sphinx = '4.0'
project = 'pyinaturalist'
Expand All @@ -68,6 +67,7 @@
'sphinx_automodapi.smart_resolver',
'sphinx_copybutton',
'sphinx_inline_tabs',
'sphinx_panels',
'sphinxcontrib.apidoc',
'myst_parser',
'nbsphinx',
Expand Down Expand Up @@ -134,11 +134,16 @@
numpydoc_show_class_members = False

# HTML general settings
html_logo = join('images', 'pyinaturalist_logo.png')
# html_logo = join('images', 'python-logo-green.png')
html_favicon = join('images', 'favicon.ico')
html_static_path = ['_static']
html_favicon = join('_static', 'favicon.ico')
html_logo = join('_static', 'pyinaturalist_logo.png')
html_js_files = ['collapsible_container.js']
html_css_files = ['collapsible_container.css', 'table.css']
html_css_files = [
'collapsible_container.css',
'colors.sass',
'table.css',
'https://use.fontawesome.com/releases/v5.15.3/css/all.css',
]
html_show_sphinx = False
pygments_style = 'friendly'
pygments_dark_style = 'material'
Expand Down
64 changes: 43 additions & 21 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyinaturalist/models/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

@define_model
class Comment(BaseModel):
"""📝 An observation comment, based on the schema of comments
""":fa:`comment` An observation comment, based on the schema of comments
from `GET /observations <https://api.inaturalist.org/v1/docs/#!/Observations/get_observations>`_.
"""

Expand Down
6 changes: 3 additions & 3 deletions pyinaturalist/models/controlled_term.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

@define_model
class Annotation(BaseModel):
"""📝 An annotation, meaning a **controlled term value** applied by a **user** to an **observation**.
""":fa:`tag` An annotation, meaning a **controlled term value** applied by a **user** to an **observation**.
Based on the schema of annotations from
`GET /observations <https://api.inaturalist.org/v1/docs/#!/Observations/get_observations>`_.
"""
Expand Down Expand Up @@ -45,7 +45,7 @@ def __str__(self) -> str:

@define_model
class ControlledTermValue(BaseModel):
"""📋 A controlled term **value**, based on the schema of
""":fa:`tag` A controlled term **value**, based on the schema of
`GET /controlled_terms <https://api.inaturalist.org/v1/docs/#!/Controlled_Terms/get_controlled_terms>`_.
"""

Expand All @@ -62,7 +62,7 @@ def __str__(self):

@define_model
class ControlledTerm(BaseModel):
"""📋 A controlled term, based on the schema of
""":fa:`tag` A controlled term, based on the schema of
`GET /controlled_terms <https://api.inaturalist.org/v1/docs/#!/Controlled_Terms/get_controlled_terms>`_.
"""

Expand Down
2 changes: 1 addition & 1 deletion pyinaturalist/models/identification.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@define_model
class Identification(BaseModel):
"""🔎 An observation identification, based on the schema of
""":fa:`fingerprint` An observation identification, based on the schema of
`GET /identifications <https://api.inaturalist.org/v1/docs/#!/Identifications/get_identifications>`_.
"""

Expand Down
4 changes: 2 additions & 2 deletions pyinaturalist/models/life_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@define_model
class LifeListTaxon(TaxonCount):
"""🐦 A single :py:class:`.Taxon` in a user's :py:class:`.LifeList`"""
""":fa:`dove` :fa:`list` A single :py:class:`.Taxon` in a user's :py:class:`.LifeList`"""

descendant_obs_count: int = field(default=0, doc='Number of observations of taxon children')
direct_obs_count: int = field(
Expand Down Expand Up @@ -42,7 +42,7 @@ def __str__(self) -> str:

@define_model_collection
class LifeList(TaxonCounts):
"""🐦✅📓 A user's life list, based on the schema of ``GET /observations/taxonomy``"""
""":fa:`dove` :fa:`list` A user's life list, based on the schema of ``GET /observations/taxonomy``"""

count_without_taxon: int = field(default=0)
data: List[LifeListTaxon] = field(factory=list, converter=LifeListTaxon.from_json_list) # type: ignore
Expand Down
4 changes: 2 additions & 2 deletions pyinaturalist/models/observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

@define(auto_attribs=False, init=False, field_transformer=add_lazy_attrs)
class Observation(BaseModel):
"""👤🔎🐦 An observation, based the schema of
""":fa:`binoculars` An observation, based the schema of
`GET /observations <https://api.inaturalist.org/v1/docs/#!/Observations/get_observations>`_.
"""

Expand Down Expand Up @@ -232,7 +232,7 @@ def __str__(self) -> str:

@define_model_collection
class Observations(BaseModelCollection):
"""👥🔍🐦 A collection of observations"""
""":fa:`binoculars` A collection of observations"""

data: List[Observation] = field(factory=list, converter=Observation.from_json_list)

Expand Down
4 changes: 2 additions & 2 deletions pyinaturalist/models/observation_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

@define_model
class ObservationField(BaseModel):
"""📋 An observation field **definition**, based on the schema of
""":fa:`tag` An observation field **definition**, based on the schema of
`GET /observation_fields <https://www.inaturalist.org/pages/api+reference#get-observation_fields>`_.
"""

Expand Down Expand Up @@ -59,7 +59,7 @@ def __str__(self) -> str:

@define_model
class ObservationFieldValue(BaseModel):
"""📝 An observation field **value**, based on the schema of ``Observation.ofvs``
""":fa:`tag` An observation field **value**, based on the schema of ``Observation.ofvs``
from `GET /observations <https://api.inaturalist.org/v1/docs/#!/Observations/get_observations>`_.
"""

Expand Down
2 changes: 1 addition & 1 deletion pyinaturalist/models/photo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@define_model
class Photo(BaseModel):
"""📷 An observation photo, based on the schema of photos from:
""":fa:`camera` An observation photo, based on the schema of photos from:
* `GET /observations <https://api.inaturalist.org/v1/docs/#!/Observations/get_observations>`_
* `GET /taxa <https://api.inaturalist.org/v1/docs/#!/Taxa/get_taxa>`
Expand Down
2 changes: 1 addition & 1 deletion pyinaturalist/models/place.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def convert_optional_lat_long(obj: Union[Dict, List, None, str]):

@define_model
class Place(BaseModel):
"""📍 A curated or community-contributed place. Handles data from the following endpoints:
""":fa:`map-marker-alt` A curated or community-contributed place. Handles data from the following endpoints:
* `GET /places/{id} <https://api.inaturalist.org/v1/docs/#!/Places/get_places_id>`_
* `GET /places/nearby <https://api.inaturalist.org/v1/docs/#!/Places/get_places_nearby>`_
Expand Down
8 changes: 4 additions & 4 deletions pyinaturalist/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

@define_model
class ProjectObservation(BaseModel):
"""👤🔎🐦 Metadata about an observation that has been added to a project"""
""":fa:`binoculars` Metadata about an observation that has been added to a project"""

preferences: Dict = field(factory=dict) # Example: {'allows_curator_coordinate_access': True}
project: Dict = field(factory=dict) # Example: {'id': 24237}
Expand All @@ -37,7 +37,7 @@ class ProjectObservation(BaseModel):

@define_model
class ProjectObservationField(ObservationField):
"""📋 An :py:class:`.ObservationField` with additional project-specific information"""
""":fa:`tag` An :py:class:`.ObservationField` with additional project-specific information"""

project_observation_field_id: int = field(default=None)
position: int = field(default=None)
Expand All @@ -55,7 +55,7 @@ def from_json(cls, value: JsonResponse, **kwargs) -> 'ProjectObservationField':

@define_model
class ProjectUser(User):
"""👤 A :py:class:`.User` with additional project-specific information"""
""":fa:`user` A :py:class:`.User` with additional project-specific information"""

project_id: int = field(default=None)
project_user_id: int = field(default=None)
Expand All @@ -73,7 +73,7 @@ def from_json(cls, value: JsonResponse, **kwargs) -> 'ProjectUser':

@define_model
class Project(BaseModel):
"""👥 An iNaturalist project, based on the schema of
""":fa:`users` An iNaturalist project, based on the schema of
`GET /projects <https://api.inaturalist.org/v1/docs/#!/Projects/get_projects>`_.
"""

Expand Down
2 changes: 1 addition & 1 deletion pyinaturalist/models/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@define_model
class SearchResult(BaseModel):
"""🔍 A search result of any type, based on the schema of
""":fa:`search` A search result of any type, based on the schema of
`GET /search <https://api.inaturalist.org/v1/docs/#!/Search/get_search>`_.
"""

Expand Down
Loading

0 comments on commit 7dfc0f2

Please sign in to comment.