Giter Club home page Giter Club logo

ablog's Introduction

ABlog for Sphinx

[![CI](https://github.com/sunpy/ablog/actions/workflows/ci.yml/badge.svg)](https://github.com/sunpy/ablog/actions/workflows/ci.yml) [![Upload Python Package](https://github.com/sunpy/ablog/actions/workflows/pythonpublish.yml/badge.svg)](https://github.com/sunpy/ablog/actions/workflows/pythonpublish.yml)

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

Please check our documentation for information on how to get started.

Note

This is the new home of Ahmet Bakan's Ablog Sphinx extension. The original project is no longer maintained and the SunPy Project has taken over maintenance.

Warning

This version is maintained with the aim to keep it working for SunPy Project website and thus new features or bugfixes are highly unlikely unless they directly impact the SunPy Project

We strongly encourage users and interested in parties in submitting patches to ``ablog``

ablog's People

Contributors

ahrbe1 avatar blueyed avatar cadair avatar choldgraf avatar chrisjsewell avatar dalito avatar dgarcia360 avatar dstansby avatar jon-walton avatar lexming avatar lordnapi avatar lsaffre avatar mehmetg avatar mementum avatar nabobalis avatar ninmesara avatar ousttrue avatar pre-commit-ci[bot] avatar quobit avatar rayalan avatar rpatterson avatar silverrainz avatar tg-m avatar tiwo avatar tychoish avatar uralbash avatar usaturn avatar vilardellsalles avatar ykrods avatar ytomino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ablog's Issues

tested against sphinx v4?

Heya, note sphinx v4 will be released very soon and you don't pin your sphinx requirement in setup.cfg (e.g. sphinx>=2,<4), so it might be good to test it against this if you haven't already 😄 (there are sphinx v4 beta releases available on PyPI)

Pagination of posts

Is it possible to paginate the post listing pages (blog main, categories, tags)? I currently have over 300 posts, so it makes for very long pages!

`ablog start` errors out with AttributeError on sphinx.util.texescape

Description

Expected vs Actual behavior

Expected:

Blog files properly created.

Actual:

Please enter the base URL for your project. Blog feeds will be generated
relative to this URL. If you don't have one yet, you can set it in configuration
file later.
> Base URL for your project: 

Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniforge/base/envs/ablog/bin/ablog", line 10, in <module>
    sys.exit(ablog_main())
  File "/opt/homebrew/Caskroom/miniforge/base/envs/ablog/lib/python3.9/site-packages/ablog/commands.py", line 448, in ablog_main
    namespace.func(**namespace.__dict__)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/ablog/lib/python3.9/site-packages/ablog/start.py", line 650, in ablog_start
    generate(d)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/ablog/lib/python3.9/site-packages/ablog/start.py", line 481, in generate
    ).translate(texescape.tex_escape_map)
AttributeError: module 'sphinx.util.texescape' has no attribute 'tex_escape_map'

Steps to Reproduce

conda config --add channels conda-forge
conda config --set channel_priority strict
conda install ablog
ablog start

System Details

  • SunPy Version: N/A
  • Astropy Version: N/A
  • Python Version: 3.9.5
  • OS information: macOS Big Sur 11.4 on Apple M1

gettext is broken when ablog is used

Hi,

When using "sphinx-build -b gettext . _build/locale" I have an error like that:

File "[...]/sphinx/builders/gettext.py", line 303, in finish
    message = message.replace('\\', r'\\'). \
AttributeError: 'NoneType' object has no attribute 'replace'

I added a debug statement in gettext.py, and it seems like the string being None is coming from:
ablog/templates/catalog.html line 16, which is:
{{ post.date.strftime(gettext(ablog.post_date_format)) }}

So it looks like ablog.post_date_format is None, for some reason? I tried specifying it explicitly in the conf.py for my sphinx, the problem didn't go away.

Thanks!

`generate_atom_feeds()` raises StopIteration

Original issue was opened on Sphinx as sphinx-doc/sphinx#6722

The offending line is this:

url = blog.blog_baseurl

Not entirely sure what causes the url to be None, I'll do some more digging to see if it's an issue with my project's configuration or not. My hunch is that it is due to my combination of Python version and OS, the other developers on my team are able to build fine.

Project

https://github.com/purduesigbots/pros-docs

Software Versions

  • Python: 3.7.3
  • OS: Pop!_OS 19.04

Consider using field lists for post metadata

In Sphinx, you can attach document-level metadata at the top of an rST file via a field list (https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html). What do folks think about also allowing field lists to define the mechanism for identifying blog posts (in addition to directives). Using file-wide metadata is the common way that this is done in other blogging engines (e.g. Jekyll front matter) and could be a nice way to separate out metadata about the post from the post content.

I think it should be pretty do-able by adding a transform that runs before the doctree-read event (see here for reference on event timing) and checks the document metadata for something like:

:blog: True

and if it finds that, it adds a PostNode to the page.

Then you could have post-level metadata at the top of the page so it could look something like:

:blog: True
:author: My Name
:date: 2020-09-11
...etc

My Title
========

...

Curious what folks think about that...

Missing reference handler does't handle `blog-feed` reference correctly

ablog/ablog/post.py

Lines 548 to 556 in 211b3b6

def _missing_reference(app, target, refdoc, contnode=None, refexplicit=False):
blog = Blog(app)
if target in blog.references:
docname, dispname = blog.references[target]
if "html" in app.builder.name:
internal = True
uri = app.builder.get_relative_uri(refdoc, docname)

The get_relative_uri method of HTML builder always add a ".html" suffix to URI, so atom.xml becomes atom.xml.html.

Translations for navigation and headlines not working

Description

ABlog provides translations for the navigation, headlines etc. in several languages out of the box, however they are not working. The fallback language English is used all the time.

Expected vs Actual behavior

When setting the language configuration to e.g. de and building the project, I expect all of ABlog's navigation items and titles to be shown in German, however the English texts are used instead.

Steps to Reproduce

  1. Create a new ABlog project: mkdir /tmp/eggsandspam; cd /tmp/eggsandspam; ablog start (queried settings do not matter)
  2. Switch to German project language: sed 's/language = None/language= "de"/' -i conf.py
  3. Build the project: ablog build
  4. Look at the generated HTML pages: xdg-open _website/index.html

The navigation shows "Recent Posts" rather than "Neue Einträge", "Tags" instead of "Schlagworte", etc. Please note, that Sphinx's search box is correctly labeled "Schnellsuche".

System Details

  • ABlog Version: 0.10.11
  • Sphinx Version: 3.2.1
  • Python Version: 3.8.6
  • OS information: Debian GNU/Linux bullseye/sid

Error message shows in html output

If you include a line containing only a period or dash, the build succeeds, even with warnings as errors on, but the following error text incorrectly appears in the html output:

"Possible title underline, too short for the title. Treating it as ordinary text because it’s so short."

A web search of this string will turn up several unlucky ablog users to whom this has happened on their live site.

To reproduce:

.. post:: 17 Feb, 2020
   :tags: ablog, error, test
   :author: mi24datn
   :nocomments: 

This is the title
-----------------

And this is the post.
-

missing reference not shown in post.py

User error in references causes a error in missing_reference() in post.py. There is no indication of which reference is missing or has an error, which can result in a lot of frustration when there are a lot of references. It can be resolved with the addition of the print statement below:

def missing_reference(app, env, node, contnode):
target = node['reftarget']
print('error, missing reference: ',target, contnode)
return _missing_reference(app, target, node['refdoc'],
contnode, node['refexplicit'])

pdf build fails (on ReadTheDocs)

When using the pdf builder, there appears to be a bug. See the log on RTfD.org

Exception occurred:
File "/home/docs/checkouts/readthedocs.org/user_builds/docideas/envs/latest/lib/python3.5/site-packages/ablog/post.py", line 354, in process_posts
stdlabel = env.intersphinx_inventory.setdefault('std:label', {})
AttributeError: 'BuildEnvironment' object has no attribute 'intersphinx_inventory'
-- http://readthedocs.org/projects/docideas/builds/7112291/

The html-builder works fine!
As this project has both normal articles and blog-post, i like to have a "paper" (pdf) build too.

Details: (also see the log-link above)

  • Python-3.5 ( no newer one on RTFD
  • Latest ablog version (0.9.2)

Thanks for ablog & thanks for the fix!

Note: I can't build pdf locally, so can give more details

Postlist by tag -> handle zero items

Hi, and thanks for the work on ablog

Any suggestions on how to handle the zero posts in a postlist situation. I think current behavious is to use all posts, but what I'd like is to be able to show aletrnative content if there are no posts.

Cannot Build on Windows

Windows 10
Python 2.7.14

Ablog 0.9.0, 0.9.1, tried them all and failed.
I even uninstalled Python and installed again, it is a pure environment and still failed.

# Sphinx version: 1.6.7
# Python version: 2.7.14 (CPython)
# Docutils version: 0.14 
# Jinja2 version: 2.3
# Last messages:
#   
#   looking for now-outdated files...
#   none found
#   pickling environment...
#   done
#   checking consistency...
#   done
#   preparing documents...
#   done
#   writing output... [ 33%] about
# Loaded extensions:
#   ablog (0.9.0) from c:\python27\lib\site-packages\ablog\__init__.pyc
#   sphinx.ext.todo (1.6.7) from c:\python27\lib\site-packages\sphinx\ext\todo.pyc
#   sphinx.ext.intersphinx (1.6.7) from c:\python27\lib\site-packages\sphinx\ext\intersphinx.pyc
#   alabaster (0.7.10) from c:\python27\lib\site-packages\alabaster\__init__.pyc
#   sphinx.ext.extlinks (1.6.7) from c:\python27\lib\site-packages\sphinx\ext\extlinks.pyc
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\sphinx\cmdline.py", line 306, in main
    app.build(opts.force_all, filenames)
  File "c:\python27\lib\site-packages\sphinx\application.py", line 339, in build
    self.builder.build_update()
  File "c:\python27\lib\site-packages\sphinx\builders\__init__.py", line 329, in build_update
    'out of date' % len(to_build))
  File "c:\python27\lib\site-packages\sphinx\builders\__init__.py", line 395, in build
    self.write(docnames, list(updated_docnames), method)
  File "c:\python27\lib\site-packages\sphinx\builders\__init__.py", line 432, in write
    self._write_serial(sorted(docnames))
  File "c:\python27\lib\site-packages\sphinx\builders\__init__.py", line 441, in _write_serial
    self.write_doc(docname, doctree)
  File "c:\python27\lib\site-packages\sphinx\builders\html.py", line 602, in write_doc
    self.handle_page(docname, ctx, event_arg=doctree)
  File "c:\python27\lib\site-packages\sphinx\builders\html.py", line 990, in handle_page
    output = self.templates.render(templatename, ctx)
  File "c:\python27\lib\site-packages\sphinx\jinja2glue.py", line 176, in render
    return self.environment.get_template(template).render(context)
  File "c:\python27\lib\site-packages\jinja2\environment.py", line 705, in render
    return self.environment.handle_exception(exc_info, True)
  File "c:\python27\lib\site-packages\ablog\templates\page.html", line 2, in top-level template code
    {% set fa = ablog.fontawesome %}
  File "c:\python27\lib\site-packages\alabaster\layout.html", line 1, in top-level template code
    {%- extends "basic/layout.html" %}
  File "c:\python27\lib\site-packages\sphinx\themes\basic\..\basic/layout.html", line 175, in top-level template code
    {%- block content %}
  File "c:\python27\lib\site-packages\alabaster\layout.html", line 40, in block "content"
    {{ super() }}
  File "c:\python27\lib\site-packages\jinja2\sandbox.py", line 259, in call
    return __context.call(__obj, *args, **kwargs)
  File "c:\python27\lib\site-packages\sphinx\themes\basic\..\basic/layout.html", line 193, in block "content"
    {%- block sidebar2 %}{{ sidebar() }}{% endblock %}
  File "c:\python27\lib\site-packages\sphinx\themes\basic\..\basic/layout.html", line 193, in block "sidebar2"
    {%- block sidebar2 %}{{ sidebar() }}{% endblock %}
  File "c:\python27\lib\site-packages\jinja2\sandbox.py", line 259, in call
    return __context.call(__obj, *args, **kwargs)
  File "c:\python27\lib\site-packages\sphinx\themes\basic\..\basic/layout.html", line 64, in template
    {%- include sidebartemplate %}
  File "c:\python27\lib\site-packages\ablog\templates\recentposts.html", line 6, in top-level template code
    <li><a href="{{ pathto(recent.docname) }}{{ anchor(recent) }}">{{ recent.date.strftime(gettext(ablog.post_date_format_short)) + " - " + recent.title }}</a></li>
  File "c:\python27\lib\site-packages\jinja2\sandbox.py", line 259, in call
    return __context.call(__obj, *args, **kwargs)
ValueError: Invalid format string

Bug in fontawesome_link_cdn handling at install time

When I use ablog start and say I want to have fontawesome then abog generates this line in conf.py: fontawesome_link_cdn = True

This leads to this line in the generated html code: <link href="True" rel="stylesheet">

This is a bug...

Thanks
Philip

WARNING:root:error, missing reference in the build log for readthedocs

Need to track down what is causing this and fix it.

WARNING:root:error, missing reference: collections.abc.Container, <literal classes="xref py py-class">collections.abc.Container</literal>
WARNING:root:error, missing reference: ablog.blog.BlogPageMixin, <literal classes="xref py py-class">ablog.blog.BlogPageMixin</literal>
WARNING:root:error, missing reference: docutils.nodes.Element, <literal classes="xref py py-class">docutils.nodes.Element</literal>
WARNING:root:error, missing reference: docutils.nodes.Node, <literal classes="xref py py-class">docutils.nodes.Node</literal>
WARNING:root:error, missing reference: docutils.nodes.General, <literal classes="xref py py-class">docutils.nodes.General</literal>
WARNING:root:error, missing reference: docutils.nodes.Body, <literal classes="xref py py-class">docutils.nodes.Body</literal>
WARNING:root:error, missing reference: docutils.nodes.admonition, <literal classes="xref py py-class">docutils.nodes.admonition</literal>
WARNING:root:error, missing reference: docutils.nodes.Admonition, <literal classes="xref py py-class">docutils.nodes.Admonition</literal>
WARNING:root:error, missing reference: docutils.parsers.rst.Directive, <literal classes="xref py py-class">docutils.parsers.rst.Directive</literal>
WARNING:root:error, missing reference: docutils.parsers.rst.directives.admonitions.BaseAdmonition, <literal classes="xref py py-class">docutils.parsers.rst.directives.admonitions.BaseAdmonition</literal>
WARNING:root:error, missing reference: sphinx.transforms.SphinxTransform, <literal classes="xref py py-class">sphinx.transforms.SphinxTransform</literal>
WARNING:root:error, missing reference: docutils.transforms.Transform, <literal classes="xref py py-class">docutils.transforms.Transform</literal>

(This is a small subset of the warnings but are all basically the same.)

ablog start command not working

So I've installed ABlog using "pip install -U ablog" with no errors. When I cd into my project folder (empty) and enter "ablog start" to build the initial set of files/folders, I get "Command 'ablog' not found.."

Seems as though my system doesn't recognize the command, even after being installed. I can run "sphinx-quickstart" with no issue, so I know I can run things from my python installed list.

I feel like this is probably just user error on my part, but has anyone else figured this out?

How to add to tag list with custom Sphinx role

Description

I'm using ablog as a lab notebook. I've created a custom Sphinx role, :person:. The argument to the role would be the name of a person. With this role, I want to do two things:

  1. Add the name to the tag list.
  2. Make the text a link to the tag.

It wasn't clear to me how to do this and was hoping someone could advise me on how to do this.

ABlog support for furo theme

Description

Hi,
I would like to use ABlog with furo theme, but I'm encountering an error:

Here simple example with alabaster theme (works with ablog):
https://sphinx-ablog-alabaster.readthedocs.io/en/latest/
https://github.com/damian-krawczyk/sphinx-ablog-alabaster
conf.py : html_theme = 'alabaster'

Here simple example with pydata_sphinx_theme (works with ablog)
https://sphinx-ablog-pydata-sphinx-theme.readthedocs.io/en/latest/
https://github.com/damian-krawczyk/sphinx-ablog-pydata_sphinx_theme
conf.py : html_theme = 'pydata_sphinx_theme'

Here simple example with furo (doesn't work with ablog, see error)
https://sphinx-ablog-furo.readthedocs.io/en/latest/
https://github.com/damian-krawczyk/sphinx-ablog-furo
conf.py : html_theme = 'furo'

The only difference in listed repositories is mentioned config.

I've already raised issue for furo but before I get back to them I would like to get feedback from you to make sure that this is not something to be fixed on your side?

Option for absolute URLs in feed

The atom feed has relative URLs when when there are internal links to other posts or images. Some services, however, need the URLs in a feed to be fully qualified to work correctly. For example, Mailchimp's RSS mailer needs absolute link and image paths. There should be a way to require all paths to be fully qualified in the atom feed especially since there is already the blog_baseurl setting.

I'm not super familiar with sphinx translators but it seems like it should just be a matter of setting one of those up correctly since sphinx is already translating the relative path from the feed back to where the posts/images are. I will see if I can resolve this when I get a chance.

Atom feed ID field is constant

Description

The feed:id field is always set to http://lernfunk.de/media/654321 (

feed.id("http://lernfunk.de/media/654321")
)

I haven't run extensive tests, but according to RFC 4287 (4.2.6) it should be a unique string per feed, so in the current form there could potentially arise problems when multiple ablog based sites are subscribed. (In firefox with the Feedbro extensions I haven't seen any issues though).

Expected vs Actual behavior

I would expect it to be configurable via conf.py. Possible conf name for example blog_feed_id.

I think a sane default value could be the same as the blog_baseurl (which needs to be set for feeds to enable and should be sufficiently unique enough for most cases).

Steps to Reproduce

Enable the feeds by setting a blog_baseurl and check the id field for the feed in the atom.xml

System Details

  • Python: 3.7.3 (Debian Buster)

Python venv with the following packages (shortened pip list)

Package                       Version
----------------------------- ---------
ablog                         0.10.11
docutils                      0.16
feedgen                       0.9.0
invoke                        1.4.1
pip                           20.2.2
Sphinx                        3.2.1

Isso integration

Isso is a free and self-hosted disqus alternatives, just use sphinxnotes-isso that we can let ablog and isso works together. :)

Tasks

No tasks being tracked yet.

functionality search does not work

Hi

I use ablog 0.9 with sphinx 1.7.1 and i have a problem
I generated a blog

ablog start
ablog build

And after on load a search with url http://127.0.0.1/search/index.html?q=first
and when i click on result i have a 404 error ... the url file:///C:/Users/faoustin/Downloads/ablog/_website/search/first-post/?highlight=first does not exist

Can you help me, please

ps: with ablog 0.8 it's ok

"Read more" button on postlist

A list of posts can be displayed on any page using the directive postlist. However, I found out that some users just read the excerpt without noticing they should click on the title to read the full post.

I propose adding an option to the directive (e.g. :expand: "Read more...") to show an optional call to action to continue reading the post.

The link could look like this:

image

KeyError 'refdoc' when missing references

I'm seeing the same issue as noted in abakan-zz/ablog#75

Seems to be related to this:

def missing_reference(app, env, node, contnode):

    target = node['reftarget']
    return _missing_reference(app, target, node['refdoc'],
contnode, node['refexplicit'])

https://github.com/sunpy/ablog/blob/master/ablog/post.py#L458

If I change node['refdoc'] to something like node.source it works - I'm not sure if this is correct behaviour however.

Haven't been able to reproduce a minimal example yet, it's just happening in my main env, any pointers appriciated. Using sphinx 1.7.6, ablog 0.9.2

Tests

We have no real tests other than to make sure than the make test command in the Makefile

make github buttons smaller

Is there anyway to make the github buttons (i.e. watch, follow, etc.) smaller through ablog? They are all on the large settings. I can see on the alabaster theme that you can go in and modify the template for about.html, but I'm not sure how you would go about it with ablog.

Missing github tag?

I see ablog 0.8.4 in pip, but only 0.8.3 exists in the releases for this project.

Implicit stop using StopIteration no longer allowed in Python 3.7

When using ablog build, I get the following stack trace:

Exception occurred:
  File "/home/tom/.local/lib/python3.7/site-packages/sphinx/builders/html.py", line 656, in gen_pages_from_extensions
    for pagename, context, template in pagelist:
RuntimeError: generator raised StopIteration
The full traceback has been saved in /tmp/sphinx-err-qi2efs2d.log, if you want to report the issue to the developers

The issue is the title per PEP 479. Related code is

raise StopIteration

Sphinx-intl

Hi Folks,

Been using ablog over on writethedocs.org to great effect, thanks for that.

I'm looking at translation (writethedocs/www#1155) and I'm not sure if this error is an ablog error or a sphinx-intl error.

make gettext

Exception occurred:
  File "/home/samuel/Repositories/WTD/www/venv/lib/python3.5/site-packages/ablog/post.py", line 355, in process_posts
    stdlabel = env.intersphinx_inventory.setdefault('std:label', {})
AttributeError: 'BuildEnvironment' object has no attribute 'intersphinx_inventory'

Index Out of Range with Atom Feeds

Description

When building with 0.10.14, I receive an index out of bounds error.

Expected vs Actual behavior

Expected to build HTML directory, instead errors after creating doctree.

Exception occurred:
  File "/usr/local/lib/python3.9/site-packages/ablog/post.py", line 744, in generate_atom_feeds
    summary = " ".join(paragraph.astext() for paragraph in post.excerpt[0])
IndexError: list index out of range
The full traceback has been saved in /tmp/sphinx-err-9ltj4i44.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!

Steps to Reproduce

pip install ablog # install latest

Build any sphinx doc...errored on empty doc

System Details

  • SunPy Version:
  • Astropy Version:
  • Python Version: Python 3.9.2 (default, Mar 12 2021, 19:04:51)
  • OS information: Debian Based Docker Image, sphinxdoc/sphinx-latexpdf

Improvements to documentation

Description

The Show source button does not appear even if the 2 python variables html_show_sourcelink and html_copy_source are initialize to the True value.

html_show_sourcelink = True
html_copy_source = True

image

html_show_sourcelink = True

html_copy_source = True

System Details

  • Python Version: Python 3.9.0
  • OS information: Debian 10

Potential dependency conflicts between ablog and alabaster

Hi, as shown in the following full dependency graph of ablog, ablog requires alabaster (the latest version), while the installed version of sphinx(3.0.1) requires alabaster>=0.7,<0.8.

According to Pip's “first found wins” installation strategy, alabaster 0.7.12 is the actually installed version.

Although the first found package version alabaster 0.7.12 just satisfies the later dependency constraint (alabaster>=0.7,<0.8), it will lead to a build failure once developers release a newer version of alabaster.

Dependency tree--------

ablog - 0.10.5
| +- alabaster(install version:0.7.12 version range:*)
| +- invoke(install version:1.4.1 version range:*)
| +- python-dateutil(install version:2.8.1 version range:*)
| +- sphinx(install version:3.0.1 version range:>=1.6)
| | +- alabaster(install version:0.7.12 version range:>=0.7,<0.8)
| | +- babel(install version:2.8.0 version range:>=1.3)
| | | +- pytz(install version:2019.3 version range:>=2015.7)
| | +- docutils(install version:0.16 version range:>=0.12)
| | +- imagesize(install version:1.2.0 version range:*)
| | +- Jinja2(install version:2.11.2 version range:>=2.3)
| | | +- MarkupSafe(install version:2.0.0a1 version range:>=0.23)
| | +- packaging(install version:20.3 version range:*)
| | +- Pygments(install version:2.6.1 version range:>=2.0)
| | +- requests(install version:2.23.0 version range:>=2.5.0)
| | | +- certifi(install version:2020.4.5.1 version range:>=2017.4.17)
| | | +- chardet(install version:3.0.4 version range:>=3.0.2,<4)
| | | +- idna(install version:2.9 version range:>=2.5,<3)
| | | +- urllib3(install version:1.25.9 version range:>=1.21.1,<1.26)
| | +- setuptools(install version:46.1.3 version range:*)
| | +- snowballstemmer(install version:2.0.0 version range:>=1.1)
| | +- sphinxcontrib-applehelp(install version:1.0.2 version range:*)
| | +- sphinxcontrib-devhelp(install version:1.0.2 version range:*)
| | +- sphinxcontrib-htmlhelp(install version:1.0.3 version range:*)
| | +- sphinxcontrib-jsmath(install version:1.0.1 version range:*)
| | +- sphinxcontrib-qthelp(install version:1.0.3 version range:*)
| | +- sphinxcontrib-serializinghtml(install version:1.1.4 version range:*)
| +- sphinx-automodapi(install version:0.12 version range:*)
| +- werkzeug(install version:1.0.1 version range:*)

Thanks for your attention.
Best,
Neolith

Exception occurred: File "C:\Users\simon\Anaconda3\lib\site-packages\sphinx\builders\html.py", line 656, in gen_pages_from_extensions for pagename, context, template in pagelist: RuntimeError: generator raised StopIteration

Added to my conf.py exactly what it says in the getting started instructions. I get the error below when I do the sphinx build. I am on windows python 3.7.

Exception occurred:
File "C:\Users\simon\Anaconda3\lib\site-packages\sphinx\builders\html.py", line 656, in gen_pages_from_extensions
for pagename, context, template in pagelist:
RuntimeError: generator raised StopIteration

Atom feeds fail W3C validation

Atom feeds fail W3C validation

The generated Atom feeds don't pass W3C validation

Expected vs Actual behavior

Expected behavior: Generated Atom feeds pass W3C valdation
Actual behavior: Generated Atom feeds fail W3C valdation

This feed does not validate.

line 9, column 2: Duplicate alternate links with the same type and hreflang [help]

  <entry>
  ^
In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendation.

line 2, column 0: Missing atom:link with rel="self" [help]

<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">

Also, the blog_baseurl value needs to have a trailing slash or the validator produces a 3rd error:

In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendations.

line 3, column 32: Identifier "https://www.rpatterson.net" is not in canonical form (the canonical form would be "https://www.rpatterson.net/") [help]

  <id>https://www.rpatterson.net</id>

I greppd that adding the trailing slash doesn't result in double slashes in the generated site. So the requirement for a trailing slash should be documented or better yet should be added when the site is built/generated.

Steps to Reproduce

  1. Create an Atom blog
  2. Publish where publicly available
  3. Validate an Atom feed

System Details

$ ./.venv/bin/python --version
Python 3.8.6
$ ./.venv/bin/pip freeze
ablog==0.10.13
alabaster==0.7.12
Babel==2.9.0
certifi==2020.12.5
chardet==4.0.0
docutils==0.16
feedgen==0.9.0
idna==2.10
imagesize==1.2.0
invoke==1.5.0
Jinja2==2.11.3
lxml==4.6.2
MarkupSafe==1.1.1
packaging==20.9
Pygments==2.8.1
pygments-solarized==0.0.3
pyparsing==2.4.7
python-dateutil==2.8.1
pytz==2021.1
requests==2.25.1
six==1.15.0
snowballstemmer==2.1.0
Sphinx==3.5.2
sphinx-fasvg==0.1.4
sphinx-nervproject-theme==2.0.3
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
urllib3==1.26.4
watchdog==2.0.2
$ uname -a
Linux rpatterson.rpatterson.net 5.8.0-7642-generic #47~1614007149~20.10~82fb226-Ubuntu SMP Tue Feb 23 02
:59:01 UTC  x86_64 x86_64 x86_64 GNU/Linux                                                             

auto-orphan should be an option (blogs in index)

Currently, ablog marks all pages with a blog-post as an orphan. So, sphinx wil not complain when they are not mentioned in a .. toctree:: directive. That great for a "blog-only site".

For a site that has both normal articles and blog-posts, it is often convenient to have a (near) full
"doc-tree". It works, BUT when I forget an blog-article in the ..toctree:: Sphinx will not complain...
But my navigation is failing.

There is a simple solution, that easy to implement: make auto-orphan an option.

A small excerpt in ablog/post.py should become conditional:

# mark the post as 'orphan' so that
    #   "document isn't included in any toctree" warning is not issued
    app.env.metadata[docname]['orphan'] = True

E.g. like:

if app.config['ablog_auto_orphan']:
   # mark the post as 'orphan' so that
       #   "document isn't included in any toctree" warning is not issued
       app.env.metadata[docname]['orphan'] = True

And some config (&docs) have to be updated.


Note:

Even when ablog_auto_orphan is false, it is possible to make a blog-post "orphan". With the standard rst-option:

:orphan:

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.