Skip to content

Commit 71b9906

Browse files
committed
docs
1 parent 20d5987 commit 71b9906

File tree

12 files changed

+124
-316
lines changed

12 files changed

+124
-316
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
]
2020
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|docs/conf.py)$"
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: "v0.5.0"
22+
rev: "v0.6.4"
2323
hooks:
2424
- id: ruff
2525
args: ["--fix", "--unsafe-fixes"]
@@ -48,7 +48,7 @@ repos:
4848
hooks:
4949
- id: prettier
5050
- repo: https://github.com/Riverside-Healthcare/djLint
51-
rev: v1.34.1
51+
rev: v1.35.2
5252
hooks:
5353
- id: djlint-jinja
5454
types_or: ["html"]

docs/conf.py

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import re
1+
import datetime
22
from pathlib import Path
33

44
from packaging.version import parse as _parse
5-
from sphinx import addnodes
65

76
import ablog
87

@@ -16,6 +15,7 @@
1615
"sphinx.ext.ifconfig",
1716
"sphinx.ext.extlinks",
1817
"sphinx_automodapi.automodapi",
18+
"sphinx_toolbox",
1919
"ablog",
2020
"alabaster",
2121
"nbsphinx",
@@ -24,7 +24,8 @@
2424

2525
version = str(_parse(ablog.__version__))
2626
project = "ABlog"
27-
copyright = "2014-2022, ABlog Team"
27+
current_year = datetime.datetime.now().year
28+
copyright = f"2014-{current_year}, ABlog Team" # NOQA: A001
2829
master_doc = "index"
2930
source_suffix = {
3031
".rst": "restructuredtext",
@@ -90,6 +91,8 @@
9091
"description": "ABlog for blogging with Sphinx",
9192
"logo": "ablog.png",
9293
}
94+
github_username = "sunpy"
95+
github_repository = "ablog"
9396
intersphinx_mapping = {
9497
"python": ("https://docs.python.org/", None),
9598
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
@@ -117,34 +120,3 @@
117120
dtype, target = line.split(None, 1)
118121
target = target.strip()
119122
nitpick_ignore.append((dtype, target))
120-
121-
122-
def parse_event(env, sig, signode):
123-
event_sig_re = re.compile(r"([a-zA-Z-]+)\s*\((.*)\)")
124-
m = event_sig_re.match(sig)
125-
if not m:
126-
signode += addnodes.desc_name(sig, sig)
127-
return sig
128-
name, args = m.groups()
129-
signode += addnodes.desc_name(name, name)
130-
plist = addnodes.desc_parameterlist()
131-
for arg in args.split(","):
132-
arg = arg.strip()
133-
plist += addnodes.desc_parameter(arg, arg)
134-
signode += plist
135-
return name
136-
137-
138-
def setup(app):
139-
from sphinx.ext.autodoc import cut_lines
140-
from sphinx.util.docfields import GroupedField
141-
142-
app.connect("autodoc-process-docstring", cut_lines(4, what=["module"]))
143-
app.add_object_type(
144-
"confval",
145-
"confval",
146-
objname="configuration value",
147-
indextemplate="pair: %s; configuration value",
148-
)
149-
fdesc = GroupedField("parameter", label="Parameters", names=["param"], can_collapse=True)
150-
app.add_object_type("event", "event", "pair: %s; event", parse_event, doc_field_types=[fdesc])

docs/index.rst

Lines changed: 8 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
ABlog for Sphinx
2-
================
1+
.. _ablog-index:
2+
3+
****************************
4+
ABlog - Blogging with Sphinx
5+
****************************
36

47
ABlog is a Sphinx extension that converts any documentation or personal website project into a full-fledged blog with:
58

@@ -10,95 +13,9 @@ ABlog is a Sphinx extension that converts any documentation or personal website
1013
* :ref:`Font-Awesome integration <font-awesome>`
1114
* :doc:`manual/markdown`
1215

13-
Ablog is part of the `SunPy Project <https://www.sunpy.org>`__.
14-
15-
.. _installation:
16-
17-
Installation
18-
------------
19-
20-
You can install ABlog using `pip <https://pip.pypa.io/en/stable/>`__::
21-
22-
pip install -U ablog
23-
24-
or `miniforge <https://github.com/conda-forge/miniforge>`__::
25-
26-
conda install ablog
27-
28-
This will also install `Sphinx <http://sphinx-doc.org/>`__, `feedgen <https://github.com/lkiesow/python-feedgen>`__, and `Invoke <https://www.pyinvoke.org/>`__ respectively required for building your website, making it look good, generating feeds, and running deploy commands.
29-
30-
Getting Started
31-
---------------
32-
33-
If you are starting a new project, see the :ref:`quick-start` guide.
34-
If you already have a project, enable blogging by making following changes in ``conf.py``:
35-
36-
.. code-block:: python
37-
38-
# 1. Add 'ablog' and 'sphinx.ext.intersphinx' to the list of extensions
39-
extensions = [
40-
'...',
41-
'ablog',
42-
'sphinx.ext.intersphinx',
43-
]
44-
45-
How it works
46-
------------
47-
48-
If you are new to Sphinx_ and reStructuredText markup language, you might find `reStructuredText Primer`_ useful.
49-
Once you have content (in ``.rst`` files), you can post *any page* using the :rst:dir:`post` directive as follows:
50-
51-
.. _reStructuredText Primer: https://www.sphinx-doc.org/en/master/
52-
53-
.. code-block:: rst
54-
55-
.. post:: Apr 15, 2014
56-
:tags: earth, love, peace
57-
:category: python
58-
:author: me
59-
:location: SF
60-
:language: en
61-
62-
An alternative method is:
63-
64-
.. code-block:: rst
65-
66-
:blogpost: true
67-
:date: Oct 10, 2020
68-
:author: Nabil Freij
69-
:location: World
70-
:category: Manual
71-
:language: English
72-
73-
at the top of the file.
74-
75-
ABlog will index all files posted as above and list them in archives and feeds specified in ``:tag:``, ``:category:``, etc. options.
76-
77-
You can also include a list of posts using :rst:dir:`postlist` directive:
78-
79-
.. code-block:: rst
80-
81-
.. postlist::
82-
:list-style: circle
83-
:category: Manual
84-
:format: {title}
85-
:sort:
86-
87-
For ABlog documentation, this converts to the following where you can find more about configuring and using ABlog:
88-
89-
.. postlist::
90-
:category: Manual
91-
:list-style: circle
92-
:format: {title}
93-
:sort:
94-
95-
.. only:: html
96-
97-
.. image:: https://readthedocs.org/projects/ablog/badge/?version=latest
98-
:target: https://ablog.readthedocs.io
16+
Ablog is currently maintained by the `The SunPy Project <https://www.sunpy.org>`__.
9917

10018
.. toctree::
101-
:hidden:
102-
:glob:
10319

104-
*/*
20+
release/index
21+
manual/index

docs/manual/ablog-commands.rst

Lines changed: 0 additions & 178 deletions
This file was deleted.

docs/manual/api.rst

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
.. api:
1+
.. _ablog_manual_api:
22

3-
ABlog API
4-
=========
5-
6-
.. post:: Feb 17, 2018
7-
:tags: api
8-
:author: Nabil Freij
9-
:category: Manual
10-
:location: World
3+
***
4+
API
5+
***
116

127
.. automodapi:: ablog
138

0 commit comments

Comments
 (0)