Skip to content

Commit

Permalink
Merge branch 'master' into pr/log_filter_regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmayer authored Jul 26, 2023
2 parents 38701d0 + b8bf595 commit ae97fb9
Show file tree
Hide file tree
Showing 45 changed files with 300 additions and 236 deletions.
38 changes: 23 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.config.python }}
- name: Set up Python ${{ matrix.config.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config.python }}
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Setup Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
Expand All @@ -81,7 +81,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Setup Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
Expand All @@ -95,34 +95,42 @@ jobs:

deploy:
name: Deploy
environment: Deployment
needs: [test, lint, docs]
runs-on: ubuntu-latest
if: ${{ github.ref=='refs/heads/master' && github.event_name!='pull_request' }}
if: github.ref=='refs/heads/master' && github.event_name!='pull_request'

permissions:
contents: write
id-token: write

steps:
- uses: actions/checkout@v3
- name: Setup Python
with:
token: ${{ secrets.GH_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Check release
id: check_release
run: |
python -m pip install pip --upgrade
pip install poetry
pip install githubrelease
pip install --pre autopub
python -m pip install --upgrade pip
python -m pip install autopub[github]
autopub check
continue-on-error: true
- name: Publish
if: steps.check_release.outcome=='success'
if: ${{ steps.check_release.outputs.autopub_release=='true' }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
git remote set-url origin https://[email protected]/${{ github.repository }}
autopub prepare
poetry build
autopub commit
autopub build
autopub githubrelease
poetry publish -u __token__ -p $PYPI_PASSWORD
- name: Upload package to PyPI
if: ${{ steps.check_release.outputs.autopub_release=='true' }}
uses: pypa/gh-action-pypi-publish@release/v1
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
# See https://pre-commit.com/hooks.html for info on hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-ast
Expand All @@ -10,6 +11,7 @@ repos:
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: forbid-new-submodules
- id: trailing-whitespace
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
Expand Down
36 changes: 19 additions & 17 deletions docs/content.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ contains a list of reserved metadata keywords:
``url`` URL to use for this article/page
=============== ===============================================================

Readers for additional formats (such as AsciiDoc_) are available via plugins.
Refer to `pelican-plugins`_ repository for those.
Readers for additional formats (such as AsciiDoc_) are available via plugins,
which you can find via the `Pelican Plugins`_ collection as well as the legacy
`pelican-plugins`_ repository.

Pelican can also process HTML files ending in ``.html`` and ``.htm``. Pelican
interprets the HTML in a very straightforward manner, reading metadata from
Expand Down Expand Up @@ -183,7 +184,7 @@ files in it will be used to generate static pages, such as **About** or
You can use the ``DISPLAY_PAGES_ON_MENU`` setting to control whether all those
pages are displayed in the primary navigation menu. (Default is ``True``.)

If you want to exclude any pages from being linked to or listed in the menu
If you want to exclude any pages from being linked to or listed in the menu,
then add a ``status: hidden`` attribute to its metadata. This is useful for
things like making error pages that fit the generated theme of your site.

Expand Down Expand Up @@ -234,7 +235,7 @@ that may be sitting alongside that post (instead of having to determine where
the other content will be placed after site generation).

To link to internal content (files in the ``content`` directory), use the
following syntax for the link target: ``{filename}path/to/file``
following syntax for the link target: ``{filename}path/to/file``.
Note: forward slashes, ``/``,
are the required path separator in the ``{filename}`` directive
on all operating systems, including Windows.
Expand Down Expand Up @@ -306,7 +307,7 @@ Attaching static files
----------------------

Starting with Pelican 3.5, static files can be "attached" to a page or article
using this syntax for the link target: ``{attach}path/to/file`` This works
using this syntax for the link target: ``{attach}path/to/file``. This works
like the ``{static}`` syntax, but also relocates the static file into the
linking document's output directory. If the static file originates from a
subdirectory beneath the linking document's source, that relationship will be
Expand Down Expand Up @@ -538,12 +539,12 @@ The specified identifier (e.g. ``python``, ``ruby``) should be one that
appears on the `list of available lexers <https://pygments.org/docs/lexers/>`_.

When using reStructuredText the following options are available in the
code-block directive:
`code-block` directive:

============= ============ =========================================
Option Valid values Description
============= ============ =========================================
anchorlinenos N/A If present wrap line numbers in <a> tags.
anchorlinenos N/A If present, wrap line numbers in ``<a>`` tags.
classprefix string String to prepend to token class names
hl_lines numbers List of lines to be highlighted, where
line numbers to highlight are separated
Expand All @@ -554,22 +555,22 @@ hl_lines numbers List of lines to be highlighted, where
line numbers.
lineanchors string Wrap each line in an anchor using this
string and -linenumber.
linenos string If present or set to "table" output line
numbers in a table, if set to
"inline" output them inline. "none" means
linenos string If present or set to "table", output line
numbers in a table; if set to
"inline", output them inline. "none" means
do not output the line numbers for this
table.
linenospecial number If set every nth line will be given the
'special' css class.
linenospecial number If set, every nth line will be given the
'special' CSS class.
linenostart number Line number for the first line.
linenostep number Print every nth line number.
lineseparator string String to print between lines of code,
'\n' by default.
linespans string Wrap each line in a span using this and
-linenumber.
nobackground N/A If set do not output background color for
nobackground N/A If set, do not output background color for
the wrapping element
nowrap N/A If set do not wrap the tokens at all.
nowrap N/A If set, do not wrap the tokens at all.
tagsfile string ctags file to use for name definitions.
tagurlformat string format for the ctag links.
============= ============ =========================================
Expand All @@ -595,7 +596,7 @@ Pelican settings file to include options that will be automatically applied to
every code block.

For example, if you want to have line numbers displayed for every code block
and a CSS prefix you would set this variable to::
and a CSS prefix, you would set this variable to::

PYGMENTS_RST_OPTIONS = {'classprefix': 'pgcss', 'linenos': 'table'}

Expand All @@ -611,7 +612,7 @@ its metadata. That article will then be output to the ``drafts`` folder and not
listed on the index page nor on any category or tag page.

If your articles should be automatically published as a draft (to not
accidentally publish an article before it is finished) include the status in
accidentally publish an article before it is finished), include the status in
the ``DEFAULT_METADATA``::

DEFAULT_METADATA = {
Expand All @@ -626,11 +627,12 @@ Hidden Posts

Like pages, posts can also be marked as ``hidden`` with the ``Status: hidden``
attribute. Hidden posts will be output to ``ARTICLE_SAVE_AS`` as expected, but
are not included by default in tag, category, and author indexes, nor in the
are not included by default in tag, category, and author indexes, nor in the
main article feed. This has the effect of creating an "unlisted" post.

.. _W3C ISO 8601: https://www.w3.org/TR/NOTE-datetime
.. _AsciiDoc: https://www.methods.co.nz/asciidoc/
.. _Pelican Plugins: https://github.com/pelican-plugins
.. _pelican-plugins: https://github.com/getpelican/pelican-plugins
.. _Python-Markdown: https://github.com/Python-Markdown/markdown
.. _Markdown Extensions: https://python-markdown.github.io/extensions/
Expand Down
8 changes: 4 additions & 4 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ suggestions or problems you might have via `Pelican Discussions
existing list of discussions and issues (both open and closed) in order to
avoid submitting topics that have already been covered before.

If you want to contribute, please fork `the git repository
If you want to contribute, please fork `the Git repository
<https://github.com/getpelican/pelican/>`_, create a new feature branch, make
your changes, and issue a pull request. Someone will review your changes as
soon as possible. Please refer to the :doc:`How to Contribute <contribute>`
Expand Down Expand Up @@ -68,7 +68,7 @@ I want to use Markdown, but I got an error.
===========================================

If you try to generate Markdown content without first installing the Markdown
library, may see a message that says ``No valid files found in content``.
library, you may see a message that says ``No valid files found in content``.
Markdown is not a hard dependency for Pelican, so if you have content in
Markdown format, you will need to explicitly install the Markdown library. You
can do so by typing the following command, prepending ``sudo`` if permissions
Expand Down Expand Up @@ -128,7 +128,7 @@ to override the generated URL. Here is an example page in reST format::
:save_as: override/url/index.html

With this metadata, the page will be written to ``override/url/index.html``
and Pelican will use url ``override/url/`` to link to this page.
and Pelican will use the URL ``override/url/`` to link to this page.

How can I use a static page as my home page?
============================================
Expand Down Expand Up @@ -229,7 +229,7 @@ This can be achieved by explicitly specifying only the filenames of those
articles in ``ARTICLE_PATHS``. A list of such filenames could be found using a
command similar to ``cd content; find -name '*.md' | head -n 10``.

My tag-cloud is missing/broken since I upgraded Pelican
My tag cloud is missing/broken since I upgraded Pelican
=======================================================

In an ongoing effort to streamline Pelican, tag cloud generation has been
Expand Down
10 changes: 5 additions & 5 deletions docs/pelican-themes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ Optional arguments:
"""""""""""""""""""


-h, --help Show the help an exit
-h, --help Show the help and exit

-l, --list Show the themes already installed

-i theme_path, --install theme_path One or more themes to install

-r theme_name, --remove theme_name One or more themes to remove

-s theme_path, --symlink theme_path Same as "--install", but create a symbolic link instead of copying the theme.
-s theme_path, --symlink theme_path Same as ``--install``, but create a symbolic link instead of copying the theme.
Useful for theme development

-v, --verbose Verbose output
Expand Down Expand Up @@ -62,7 +62,7 @@ or ``--list`` option:
In this example, we can see there are three themes available: ``notmyidea``,
``simple``, and ``two-column``.

``two-column`` is prefixed with an ``@`` because this theme is not copied to
``two-column`` is followed by an ``@`` because this theme is not copied to
the Pelican theme path, but is instead just linked to it (see `Creating
symbolic links`_ for details about creating symbolic links).

Expand All @@ -82,7 +82,7 @@ Installing themes

You can install one or more themes using the ``-i`` or ``--install`` option.
This option takes as argument the path(s) of the theme(s) you want to install,
and can be combined with the verbose option:
and can be combined with the ``--verbose`` option:

.. code-block:: console
Expand Down Expand Up @@ -154,7 +154,7 @@ This is useful for theme development:
Doing several things at once
""""""""""""""""""""""""""""

The ``--install``, ``--remove`` and ``--symlink`` option are not mutually
The ``--install``, ``--remove`` and ``--symlink`` options are not mutually
exclusive, so you can combine them in the same command line to do more than one
operation at time, like this:

Expand Down
2 changes: 1 addition & 1 deletion pelican/paginator.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def _from_settings(self, key):
# changed to lstrip() because that would remove all leading slashes and
# thus make the workaround impossible. See
# test_custom_pagination_pattern() for a verification of this.
if ret[0] == '/':
if ret.startswith('/'):
ret = ret[1:]
return ret

Expand Down
4 changes: 2 additions & 2 deletions pelican/tests/output/basic/categories.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ <h1><a href="/">A Pelican Blog</a></h1>
</ul></nav>
</header><!-- /#banner -->

<section id="content" class="body">
<section id="content" class="body">
<h1>Categories for A Pelican Blog</h1>
<ul>
<li><a href="/category/bar.html">bar</a> (1)</li>
<li><a href="/category/cat1.html">cat1</a> (4)</li>
<li><a href="/category/misc.html">misc</a> (4)</li>
<li><a href="/category/yeah.html">yeah</a> (1)</li>
</ul>
</section>
</section>

<section id="extras" class="body">
<div class="social">
Expand Down
6 changes: 3 additions & 3 deletions pelican/tests/output/basic/category/misc.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ <h1><a href="/unbelievable.html" rel="bookmark"
<a class="reference external" href="/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p>
<div class="section" id="testing-sourcecode-directive">
<h2>Testing sourcecode directive</h2>
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
</pre></div>
</td></tr></table></div>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
</pre></div></td></tr></table></div>
</div>
<div class="section" id="testing-another-case">
<h2>Testing another case</h2>
<p>This will now have a line number in 'custom' since it's the default in
Expand Down
Loading

0 comments on commit ae97fb9

Please sign in to comment.