Updated docs build to use cog

This commit is contained in:
Rhet Turnbull
2022-04-23 08:16:47 -07:00
parent ee6e4602e4
commit b8b4c15784
60 changed files with 561 additions and 433 deletions

View File

@@ -2,12 +2,17 @@
I'm still trying to learn sphinx and come up with a workflow for building docs. Right now it's pretty kludgy.
- `pip install sphinx`
- `pip install sphinx-rtd-theme`
- `pip install m2r2`
- `python3 -m pip -r dev_requirements.txt`
- Download and install [MacTeX](https://tug.org/mactex/)
- Add `/Library/TeX/texbin` to your `$PATH`
- `cd docs`
- `make html`
- `make latexpdf`
- `cp _build/latex/osxphotos.pdf .`
The `build.sh` script in the main repo directory will build the documents for you and is the preferred way to build the docs.
The following files are generated by `build.sh` and should not be directly edited:
- source/template_help.rst
- source/tutorial.rst

View File

@@ -1,4 +1,4 @@
osxphotos Command Line Interface (CLI)
OSXPhotos Command Line Interface (CLI)
======================================
.. click:: osxphotos.cli:cli_main

View File

@@ -3,7 +3,7 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to osxphotos's documentation!
Welcome to OSXPhotos's documentation!
=====================================
.. toctree::

View File

@@ -1,10 +1,10 @@
osxphotos
OSXPhotos
=========
What is osxphotos?
What is OSXPhotos?
------------------
osxphotos provides both the ability to interact with and query Apple's Photos.app library on macOS directly from your python code
OSXPhotos provides both the ability to interact with and query Apple's Photos.app library on macOS directly from your python code
as well as a very flexible command line interface (CLI) app for exporting photos.
You can query the Photos library database -- for example, file name, file path, and metadata such as keywords/tags, persons/faces, albums, etc.
You can also easily export both the original and edited photos.

View File

@@ -1,5 +1,5 @@
Example uses of the python package
Example uses of the OSXPhotos python package
----------------------------------
.. code-block:: python

View File

@@ -1,4 +1,4 @@
osxphotos python API
OSXPhotos python API
====================
.. automodule:: osxphotos

View File

@@ -1,8 +1,8 @@
osxphotos Template System
OSXPhotos Template System
=========================
The templating system converts one or template statements, written in osxphotos metadata templating language, to one or more rendered values using information from the photo being processed.
The templating system converts one or template statements, written in osxphotos metadata templating language, to one or more rendered values using information from the photo being processed.
In its simplest form, a template statement has the form: ``"{template_field}"``\ , for example ``"{title}"`` which would resolve to the title of the photo.
@@ -26,7 +26,7 @@ e.g. if Photo keywords are ``["foo","bar"]``\ :
* ``"{; +keyword}"`` renders to: ``"foo; bar"``
* ``"{+keyword}"`` renders to ``"foobar"``
``template_field``\ : The template field to resolve. See `Template Substitutions <#template-substitutions>`_ for full list of template fields.
``template_field``\ : The template field to resolve. See `Template Substitutions <#template-substitutions>`_ for full list of template fields.
`:subfield`: Some templates have sub-fields, For example, `{exiftool:IPTC:Make}\ ``; the template_field is``\ exiftool\ ``and the sub-field is``\ IPTC:Make`.
@@ -70,7 +70,7 @@ e.g. If Photo is in ``Album1`` in ``Folder1``\ :
`[find,replace]`: optional text replacement to perform on rendered template value. For example, to replace "/" in an album name, you could use the template `"{album[/,-]}"`. Multiple replacements can be made by appending "|" and adding another find|replace pair. e.g. to replace both "/" and ":" in album name: ``"{album[/,-|:,-]}"``. find/replace pairs are not limited to single characters. The "|" character cannot be used in a find/replace pair.
`conditional`: optional conditional expression that is evaluated as boolean (True/False) for use with the `?bool_value` modifier. Conditional expressions take the form '` not operator value`' where `not` is an optional modifier that negates the `operator`. Note: the space before the conditional expression is required if you use a conditional expression. Valid comparison operators are:
`conditional`: optional conditional expression that is evaluated as boolean (True/False) for use with the `?bool_value` modifier. Conditional expressions take the form '`not operator value`' where `not` is an optional modifier that negates the `operator`. Note: the space before the conditional expression is required if you use a conditional expression. Valid comparison operators are:
* ``contains``\ : template field contains value, similar to python's ``in``
@@ -118,7 +118,7 @@ and if it is not an HDR image,
* ``"{hdr?ISHDR,NOTHDR}"`` renders to ``"NOTHDR"``
``,default``\ : optional default value to use if the template name has no value. This modifier is also used for the value if False for boolean-type fields (see above) as well as to hold a sub-template for values like ``{created.strftime}``. If no default value provided, "_" is used.
``,default``\ : optional default value to use if the template name has no value. This modifier is also used for the value if False for boolean-type fields (see above) as well as to hold a sub-template for values like ``{created.strftime}``. If no default value provided, "_" is used.
e.g., if photo has no title set,
@@ -133,7 +133,7 @@ e.g., if photo date is 4 February 2020, 19:07:38,
* ``"{created.strftime,%Y-%m-%d-%H%M%S}"`` renders to ``"2020-02-04-190738"``
Some template fields such as ``"{media_type}"`` use the default value to allow customization of the output. For example, ``"{media_type}"`` resolves to the special media type of the photo such as ``panorama`` or ``selfie``. You may use the default value to override these in form: ``"{media_type,video=vidéo;time_lapse=vidéo_accélérée}"``. In this example, if photo was a time_lapse photo, ``media_type`` would resolve to ``vidéo_accélérée`` instead of ``time_lapse``.
Some template fields such as ``"{media_type}"`` use the default value to allow customization of the output. For example, ``"{media_type}"`` resolves to the special media type of the photo such as ``panorama`` or ``selfie``. You may use the default value to override these in form: ``"{media_type,video=vidéo;time_lapse=vidéo_accélérée}"``. In this example, if photo was a time_lapse photo, ``media_type`` would resolve to ``vidéo_accélérée`` instead of ``time_lapse``.
Either or both bool_value or default (False value) may be empty which would result in empty string ``""`` when rendered.
@@ -147,7 +147,7 @@ Template Substitutions
.. list-table::
:header-rows: 1
* - Substitution
* - Field
- Description
* - {name}
- Current filename of the photo

View File

@@ -9,7 +9,7 @@
osxphotos Tutorial
OSXPhotos Tutorial
==================
Overview