1
0
Fork 0
mirror of https://github.com/Findus23/pyLanguagetool.git synced 2024-09-09 04:13:46 +02:00

update docs

This commit is contained in:
Lukas Winkler 2024-07-20 23:38:56 +02:00
parent 7ca4fe2455
commit c2695bf94b
Signed by: lukas
GPG key ID: 54DE4D798D244853
7 changed files with 104 additions and 109 deletions

View file

@ -1,6 +1,13 @@
Changelog
=========
`0.10.1` (2024-07-20)
---------------------
* add shell completion config files
* don't use deprecated pkg_resources
* only read from stdin if no input file has been specified
`0.10.0` (2023-09-27)
---------------------

View file

@ -1,7 +1,7 @@
==============
pyLanguagetool
==============
|gitlab-ci| |license| |latestrelease| |pypi_versions|
|license| |latestrelease| |pypi_versions|
A python library and CLI for the LanguageTool_ `JSON API`_.
@ -57,63 +57,67 @@ environment variables or a configuration file
(``~/.config/pyLanguagetool.conf``) For more information about the
configuration file syntax, read the `ConfigArgParse documentation`_.
Privacy
-------
By default, pyLanguagetool sends all text via HTTPS to the `LanguageTool`_
server (see their `privacy policy`_). You can also `set up your own server`_ and
use it by changing the ``--api-url`` attribute.
Parameters
----------
.. code::
$ pylanguagetool --help
usage: pylanguagetool [-h] [-v] [-a API_URL] [--no-color] [-c] [-s]
[-t {txt,html,md,rst,ipynb}] [-l LANG]
[-m MOTHER_TONGUE] [-p PREFERRED_VARIANTS]
[-e ENABLED_RULES] [-d DISABLED_RULES]
usage: pylanguagetool [-h] [-V] [-v] [-a API_URL] [--no-color] [-c] [-s]
[-t {txt,html,md,markdown,rst,ipynb,json,xliff}] [-u] [-r]
[--rule-categories] [-l LANG] [-m MOTHER_TONGUE]
[-p PREFERRED_VARIANTS] [-e ENABLED_RULES]
[-d DISABLED_RULES]
[--enabled-categories ENABLED_CATEGORIES]
[--disabled-categories DISABLED_CATEGORIES]
[--enabled-only] [--pwl PWL]
[--enabled-only] [--picky] [--pwl PWL]
[input file]
Args that start with '--' (eg. -v) can also be set in a config file
(~/.config/pyLanguagetool.conf). Config file syntax allows: key=value,
flag=true, stuff=[a,b,c] (for details, see syntax at
https://pypi.org/project/ConfigArgParse/). If an arg is specified in more than
one place, then commandline values override environment variables which
override config file values which override defaults.
positional arguments:
input file input file
optional arguments:
options:
-h, --help show this help message and exit
-v, --verbose [env var: VERBOSE]
-V, --version print version and exit
-v, --verbose verbose output [env var: VERBOSE]
-a API_URL, --api-url API_URL
the URL of the v2 languagetool API, should end with
'/v2/' [env var: API_URL]
--no-color don't color output [env var: NO_COLOR]
-c, --clipboard get text from system clipboard [env var: CLIPBOARD]
-s, --single-line check every line on its own [env var: SINGLE_LINE]
-t {txt,html,md,rst,ipynb}, --input-type {txt,html,md,rst,ipynb}
if not plaintext [env var: CLIPBOARD]
-t {txt,html,md,markdown,rst,ipynb,json,xliff}, --input-type {txt,html,md,markdown,rst,ipynb,json,xliff}
if not plaintext [env var: INPUT_TYPE]
-u, --explain-rule print URLs with more information about rules [env var:
EXPLAIN_RULE]
-r, --rules show the matching rules [env var: RULES]
--rule-categories show the the categories of the matching rules [env
var: RULE_CATEGORIES]
--rule-categories show the the categories of the matching rules [env var:
RULE_CATEGORIES]
-l LANG, --lang LANG A language code like en or en-US, or auto to guess the
language automatically (see preferredVariants below).
For languages with variants (English, German,
Portuguese) spell checking will only be activated when
you specify the variant, e.g. en-GB instead of just
en. [env var: TEXTLANG]
you specify the variant, e.g. en-GB instead of just en.
[env var: TEXTLANG]
-m MOTHER_TONGUE, --mother-tongue MOTHER_TONGUE
A language code of the user's native language,
enabling false friends checks for some language pairs.
[env var: MOTHER__TONGUE]
A language code of the user's native language, enabling
false friends checks for some language pairs. [env var:
MOTHER__TONGUE]
-p PREFERRED_VARIANTS, --preferred-variants PREFERRED_VARIANTS
Comma-separated list of preferred language variants.
The language detector used with language=auto can
detect e.g. English, but it cannot decide whether
British English or American English is used. Thus this
parameter can be used to specify the preferred
variants like en-GB and de-AT. Only available with
language=auto. [env var: PREFERRED_VARIANTS]
Comma-separated list of preferred language variants. The
language detector used with language=auto can detect
e.g. English, but it cannot decide whether British
English or American English is used. Thus this parameter
can be used to specify the preferred variants like en-GB
and de-AT. Only available with language=auto. [env var:
PREFERRED_VARIANTS]
-e ENABLED_RULES, --enabled-rules ENABLED_RULES
IDs of rules to be enabled, comma-separated [env var:
ENABLED_RULES]
@ -128,13 +132,18 @@ Parameters
var: DISABLED_CATEGORIES]
--enabled-only enable only the rules and categories whose IDs are
specified with --enabled-rules or --enabled-categories
--picky if enabled, additional rules will be activated
--pwl PWL, --personal-word-list PWL
File name of personal dictionary. A private dictionary
can be used to add special words that would otherwise
be marked as spelling errors. [env var:
PERSONAL_WORD_LIST]
can be used to add special words that would otherwise be
marked as spelling errors. [env var: PERSONAL_WORD_LIST]
Args that start with '--' can also be set in a config file
(~/.config/pyLanguagetool.conf). Config file syntax allows: key=value,
flag=true, stuff=[a,b,c] (for details, see syntax at
https://pypi.org/project/ConfigArgParse/). In general, command-line values
override environment variables which override config file values which override
defaults.
.. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg
@ -142,18 +151,9 @@ Parameters
.. |latestrelease| image:: https://img.shields.io/pypi/v/pyLanguagetool.svg
:target: https://pypi.python.org/pypi/pyLanguagetool
:alt: Latest Version
.. |gitlab-ci| image:: https://git.lw1.at/open-source/pylanguagetool/badges/master/pipeline.svg
:target: https://git.lw1.at/open-source/pylanguagetool/-/commits/master
.. |pypi_versions| image:: https://img.shields.io/pypi/pyversions/pylanguagetool.svg
:target: https://pypi.python.org/pypi/pyLanguagetool
Privacy
-------
By default, pyLanguagetool sends all text via HTTPS to the `LanguageTool`_
server (see their `privacy policy`_). You can also `set up your own server`_ and
use it by changing the ``--api-url`` attribute.
.. _LanguageTool: https://languagetool.org/
.. _JSON API: https://languagetool.org/http-api/swagger-ui/#/default

25
docs/_templates/base.html vendored Normal file
View file

@ -0,0 +1,25 @@
{% extends "!base.html" %}
{% block extrahead %}
{{ super() }}
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['disableCookies']);
_paq.push(['setRequestMethod', 'POST']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u = "https://matomo.lw1.at/";
_paq.push(['setTrackerUrl', u + 'statistics.php']);
_paq.push(['setSiteId', '24']);
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
g.type = 'text/javascript';
g.async = true;
g.defer = true;
g.src = u + 'statistics.js';
s.parentNode.insertBefore(g, s);
})();
</script>
<!-- End Matomo Code -->
{% endblock %}

View file

@ -1,57 +0,0 @@
{% extends "!layout.html" %}
{% block extrahead %}
{{ super() }}
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['disableCookies']);
_paq.push(['setRequestMethod', 'POST']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u = "https://matomo.lw1.at/";
_paq.push(['setTrackerUrl', u + 'statistics.php']);
_paq.push(['setSiteId', '24']);
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
g.type = 'text/javascript';
g.async = true;
g.defer = true;
g.src = u + 'statistics.js';
s.parentNode.insertBefore(g, s);
})();
</script>
<!-- End Matomo Code -->
<style>
dl.field-list > dt {
min-width: 120px;
}
</style>
{% endblock %}
{%- block footer %}
<div class="footer">
{% if show_copyright %}&copy;{{ copyright }}.{% endif %}
{% if theme_show_powered_by|lower == 'true' %}
{% if show_copyright %}|{% endif %}
Powered by <a href="http://sphinx-doc.org/">Sphinx {{ sphinx_version }}</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster {{ alabaster_version }}</a>
{% endif %}
{%- if show_source and has_source and sourcename %}
{% if show_copyright or theme_show_powered_by %}|{% endif %}
<a href="{{ pathto('_sources/' + sourcename, true)|e }}"
rel="nofollow">{{ _('Page source') }}</a>
{%- endif %}
| <a href="https://lw1.at/i">Imprint and Privacy Policy</a>
</div>
<a href="https://github.com/Findus23/pyLanguagetool/" class="github-corner" aria-label="View source on GitHub">
<svg width="80" height="80" viewBox="0 0 250 250"
style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
fill="currentColor" style="transform-origin: 130px 106px;"></path>
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
fill="currentColor"></path>
</svg>
</a>
{%- endblock %}

View file

@ -1,11 +1,10 @@
"""Sphinx configuration file."""
import sys
from pkg_resources import get_distribution
from importlib.metadata import version
project = "pyLanguagetool"
copyright = "2023, Lukas Winkler"
release = get_distribution('pylanguagetool').version
release = version('pylanguagetool')
version = '.'.join(release.split('.')[:2])
master_doc = 'index'
@ -18,11 +17,32 @@ extensions = [
'sphinx.ext.linkcode'
]
html_theme = 'alabaster'
html_theme = 'furo'
html_theme_options = {
'description': 'A python library and CLI for the LanguageTool JSON API.',
"footer_icons": [
{
"name": "GitHub",
"url": "https://github.com/Findus23/pyLanguagetool",
"html": """
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path>
</svg>
""",
"class": "",
},
{
"name": "Imprint and Privacy Policy",
"url": "https://lw1.at/i",
"html": """
Imprint and Privacy Policy
""",
"class": "",
},
],
"source_repository": "https://github.com/Findus23/pyLanguagetool/",
"source_branch": "master",
"source_directory": "docs/",
}
templates_path = ['_templates']
latex_engine = 'xelatex'

View file

@ -1,7 +1,7 @@
==============
pyLanguagetool
==============
|gitlab-ci| |license| |latestrelease| |pypi_versions|
|license| |latestrelease| |pypi_versions|
A python library and CLI for the LanguageTool_ `JSON API`_.

View file

@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "pyLanguagetool"
version = "0.10.0"
version = "0.10.1"
authors = [
{ name = "Lukas Winkler", email = "python@lw1.at" }
]