Skip to content

Commit

Permalink
rewrite documentation in reStructuredText
Browse files Browse the repository at this point in the history
Also added information on the new options in 1.3.
  • Loading branch information
sobjornstad committed Jul 11, 2020
1 parent 1f223be commit e23bf6e
Show file tree
Hide file tree
Showing 16 changed files with 721 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# cache
.mypy_cache/
.pytest_cache/
__pycache__/
venv/

Expand All @@ -14,3 +15,4 @@ build*.zip
*.html
.coverage
htmlcov/
docs/_build
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.PHONY: all forms zip clean
.PHONY: all docs forms zip clean

all: forms zip
all: docs forms zip
docs:
$(MAKE) -C docs html
forms: src/import_dialog.py
zip: build.zip

Expand All @@ -14,6 +16,7 @@ build.zip: src/*
( cd src/; zip -r ../$@ * )

clean:
make -C docs clean
rm -f *.pyc
rm -f src/*.pyc
rm -f src/__pycache__
Expand Down
19 changes: 19 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Empty file added docs/_static/.gitkeep
Empty file.
93 changes: 93 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
=========
Changelog
=========

LPCG 1.3.0
==========

* Added options *Lines to Recite* and *Lines in Groups of*.
* Add a *Prompt* field to the note type.
This was added to support showing the user
how many lines they're being asked to recite,
but could be used for other things in the future.
Backwards compatibility with existing notes is maintained
by displaying ``[...]`` if the field is empty.
* The *Line* field now wraps each (or the only) line in ``<p>`` tags,
to support multiple-line recitation with correct indentation.
Existing LPCG notes without ``<p>`` tags will still display fine as well.
* Invert color of cloze deletions in night mode,
as the default color is unnecessarily difficult to read on many screens.
* Added some automated regression testing.
* Under-the-hood refactorings and updates to newer features offered by Anki.


LPCG 1.2.1
==========

* Provide a useful error message when generating notes
and the LPCG note type is missing a required field.


LPCG 1.2.0
==========

* Support for Anki 2.1 (only).
* Fixed several minor bugs in splitting poems into stanzas
that could result in end-of-stanza and end-of-poem markers
appearing on lines by themselves.
* Fixed text flowing off the right side of mobile device screens
(thanks to Jonta).


LPCG 1.1.0
==========

* Added support for changing the number of lines of context you want to see
for a given poem.
The default remains 2.

This is the last version that supports Anki 2.0.


LPCG 1.0.0
==========

LPCG was completely rewritten
and became a proper Anki add-on instead of a stand-alone Python script.
A new note type is also used with this version.


LPCG 0.9.4
==========

* Improve the user experience when the temporary folder is not writable
or the user specifies a nonexistent file.
* Add a message explaining that Anki should have opened to import notes,
in case it doesn't and the user is left sitting there wondering
what's supposed to happen next.


LPCG 0.9.3
==========

* Fix typo in code that caused LPCG not to import successfully at all.


LPCG 0.9.2
==========

* Fix off-by-one error sometimes resulting in incorrect card generation.
* Allow dragging and dropping files onto the terminal window to work correctly
in more situations.


LPCG 0.9.1
==========

* Tags should not be mandatory.


LPCG 0.9.0
==========

* First public release.
103 changes: 103 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- Path setup --------------------------------------------------------------
# Instead of adding things manually to the path, we just ensure we install esc
# in editable mode in our environment.


# -- Project information -----------------------------------------------------

project = 'LPCG'
copyright = '2016--2020, Soren Bjornstad'
author = 'Soren I. Bjornstad'

# The short X.Y version
version = "1.3.0"
# The full version, including alpha/beta/rc tags
release = version


# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
needs_sphinx = '1.8.5'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autosectionlabel',
'sphinx.ext.todo',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string.
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}



# -- Extension configuration -------------------------------------------------

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True

# Prefix section labels with the names of their documents, to avoid ambiguity
# when the same heading appears on several pages.
autosectionlabel_prefix_document = False

0 comments on commit e23bf6e

Please sign in to comment.