Skip to content

Commit ae9ae8f

Browse files
authored
Doc: typo & tips (#179)
- Fix typo. - Update the `.vscode/settings.json` example in `CONTRIBUTING.md`. [Venv][venv-doc] uses `bin` on POSIX, but `Scripts` on Windows. - Some tests won't pass without `requirements/documentation.txt`. See also: [4b1cfd](4b1cfdc) adds `documentation.txt` into GitHub Actions. For example, `test_simple_build` in `tests/test_build.py` builds `mkdocs.yml`, and its theme (mkdocs-bootswatch/united) is not covered in `requirements/development.txt`. ```yaml theme: name: united ``` [venv-doc]: https://docs.python.org/3.11/library/venv.html#how-venvs-work
2 parents 118d292 + e38ab72 commit ae9ae8f

File tree

5 files changed

+66
-13
lines changed

5 files changed

+66
-13
lines changed

CHANGELOG.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6262

6363
### Changed
6464

65-
* Minor improvments: clean unused imports, lines length and use fstrings in logging by @Guts in <https://github.com/Guts/mkdocs-rss-plugin/pull/143>
66-
* Improvment: more granular fallback to build timestamp by @Guts in <https://github.com/Guts/mkdocs-rss-plugin/pull/144>
65+
* Minor improvements: clean unused imports, lines length and use fstrings in logging by @Guts in <https://github.com/Guts/mkdocs-rss-plugin/pull/143>
66+
* Improvement: more granular fallback to build timestamp by @Guts in <https://github.com/Guts/mkdocs-rss-plugin/pull/144>
6767

6868
## 1.3.0 - 2022-10-07
6969

@@ -100,7 +100,7 @@ So, no feature in this release, just focusing on quality and code cleanliness.
100100
### Fixed
101101

102102
* Minor bugs fixes
103-
* Minor documentation improvments
103+
* Minor documentation improvements
104104

105105
----
106106

@@ -157,7 +157,7 @@ So, no feature in this release, just focusing on quality and code cleanliness.
157157

158158
### Added
159159

160-
* option to get the full page content into thed. Contributed by [liang2kl](https://github.com/liang2kl) with [PR 88](https://github.com/Guts/mkdocs-rss-plugin/pull/88). See the [related documentation section](https://guts.github.io/mkdocs-rss-plugin/configuration/#item-description-length).
160+
* option to get the full page content into thread. Contributed by [liang2kl](https://github.com/liang2kl) with [PR 88](https://github.com/Guts/mkdocs-rss-plugin/pull/88). See the [related documentation section](https://guts.github.io/mkdocs-rss-plugin/configuration/#item-description-length).
161161

162162
### Changed
163163

@@ -333,7 +333,7 @@ So, no feature in this release, just focusing on quality and code cleanliness.
333333

334334
### Changed
335335

336-
* docs: minor improvments
336+
* docs: minor improvements
337337

338338
----
339339

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Make sure your code *roughly* follows [PEP-8](https://www.python.org/dev/peps/pe
1717
- docstrings: [sphinx-style](https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html#the-sphinx-docstring-format) is used to write technical documentation.
1818
- formatting: [black](https://black.readthedocs.io/) is used to automatically format the code without debate.
1919
- sorted imports: [isort](https://pycqa.github.io/isort/) is used to sort imports
20-
- static analisis: [flake8](https://flake8.pycqa.org/en/latest/) is used to catch some dizziness and keep the source code healthy.
20+
- static analysis: [flake8](https://flake8.pycqa.org/en/latest/) is used to catch some dizziness and keep the source code healthy.
2121

2222
----
2323

@@ -30,6 +30,8 @@ Feel free to use the IDE you love. Here come configurations for some popular IDE
3030
```jsonc
3131
{
3232
"python.defaultInterpreterPath": ".venv/bin/python",
33+
// 👆 For Windows, change it to "./.venv/Scripts/python.exe".
34+
// Or you can manually select one when VS Code asks for it.
3335
// Editor
3436
"editor.bracketPairColorization.enabled": true,
3537
"editor.guides.bracketPairs":"active",

docs/configuration.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ To produce a valid RSS feed, the plugin uses:
2727
| [`site_name`](https://www.mkdocs.org/user-guide/configuration/#site_name) | **required** | [`title`](https://www.w3schools.com/xml/rss_tag_title_link_description_channel.asp) and also as [`source` URL label](https://www.w3schools.com/xml/rss_tag_source.asp) for each feed item |
2828
| [`site_url`](https://www.mkdocs.org/user-guide/configuration/#site_url) | **required** | [`link`](https://www.w3schools.com/xml/rss_tag_title_link_description_channel.asp) |
2929
| ---- | ---- | ---- |
30-
| [`repo_url`](https://www.mkdocs.org/user-guide/configuration/#repo_url) | **recomended** | [`docs`](https://www.w3schools.com/xml/rss_tag_docs.asp) |
31-
| [`site_author`](https://www.mkdocs.org/user-guide/configuration/#site_author) | **recomended** | [`managingEditor`](https://www.w3schools.com/xml/rss_tag_managingeditor.asp) |
30+
| [`repo_url`](https://www.mkdocs.org/user-guide/configuration/#repo_url) | **recommended** | [`docs`](https://www.w3schools.com/xml/rss_tag_docs.asp) |
31+
| [`site_author`](https://www.mkdocs.org/user-guide/configuration/#site_author) | **recommended** | [`managingEditor`](https://www.w3schools.com/xml/rss_tag_managingeditor.asp) |
3232
| ---- | ---- | ---- |
3333
| [`copyright`](https://www.mkdocs.org/user-guide/configuration/#copyright) | *optional* | [`copyright`](https://www.w3schools.com/xml/rss_tag_copyright.asp) |
3434
| [`locale` or `theme/locale` or `theme/language`](https://github.com/squidfunk/mkdocs-material/issues/1350#issuecomment-559095892) | *optional* | [`language`](https://www.w3schools.com/xml/rss_tag_language.asp) |
@@ -51,7 +51,7 @@ Basically, each page is an item element in the RSS feed.
5151
| [`page.canonical_url`](https://github.com/mkdocs/mkdocs/blob/master/mkdocs/structure/pages.py#L97-L105) | **required** and *optional* | mandatory item element [`link`](https://www.w3schools.com/xml/rss_tag_title_link_description_item.asp) and also used as [`guid`](https://www.w3schools.com/xml/rss_tag_guid.asp) |
5252
| [`page.meta.title`](https://www.mkdocs.org/user-guide/writing-your-docs/#yaml-style-meta-data) | **required** | [`title`](https://www.w3schools.com/xml/rss_tag_title_link_description_item.asp) |
5353
| [`page.meta.description`](https://www.mkdocs.org/user-guide/writing-your-docs/#yaml-style-meta-data) if present, else extract headlines from the content. See below the [item_description_length option](/configuration/#item-description-length). | **required** | [`description`](https://www.w3schools.com/xml/rss_tag_title_link_description_item.asp) |
54-
| creation or last update datetime according git log. Can be overridden by dates in page.meta. If not, then it uses [MkDcos build date](https://github.com/mkdocs/mkdocs/blob/master/mkdocs/utils/__init__.py#L111-L118) | **recomended** | [`pubDate`](https://www.w3schools.com/xml/rss_tag_pubdate_item.asp) |
54+
| creation or last update datetime according git log. Can be overridden by dates in page.meta. If not, then it uses [MkDocs build date](https://github.com/mkdocs/mkdocs/blob/master/mkdocs/utils/__init__.py#L111-L118) | **recommended** | [`pubDate`](https://www.w3schools.com/xml/rss_tag_pubdate_item.asp) |
5555
| [`page.meta.image`](https://www.mkdocs.org/user-guide/writing-your-docs/#yaml-style-meta-data) | *optional* | item element [`enclosure`](https://www.w3schools.com/xml/rss_tag_enclosure.asp). Some HTTP requests can be performed to retrieve remote images length. |
5656
| [`page.meta.authors`](https://www.mkdocs.org/user-guide/writing-your-docs/#yaml-style-meta-data) or `page.meta.author`. Accepted value types: `str` `list`, `tuple`. <br />To comply with the standard, the page writer is responsible to fill this field following this syntax: `[email protected] (John Doe)` ([read this SO](https://stackoverflow.com/a/6079731/2556577)). | *optional* | [`author`](https://www.w3schools.com/XML/rss_tag_author.asp) |
5757
| [`page.meta.tags`](https://www.mkdocs.org/user-guide/writing-your-docs/#yaml-style-meta-data) or any tags value (for example `page.meta.categories`...). Accepted value types: `str` `list`. | *optional* | [`category`](https://www.w3schools.com/xml/rss_tag_category_item.asp) |
@@ -219,7 +219,7 @@ To fill each [item description element](https://www.w3schools.com/xml/rss_tag_ti
219219

220220
- If this value is set to `-1`, then the articles' full HTML content will be filled into the description element.
221221
- Otherwise, the plugin first tries to retrieve the value of the keyword `description` from the [page metadata].
222-
- If the value is non-negative and no `description` meta is found, then the plugin retrieves the first number of characters of the page content defined by this setting. Retrieved content is the raw markdown converted rougthly into HTML.
222+
- If the value is non-negative and no `description` meta is found, then the plugin retrieves the first number of characters of the page content defined by this setting. Retrieved content is the raw markdown converted roughly into HTML.
223223

224224
`abstract_chars_count`: number of characters to use as item description.
225225

@@ -299,7 +299,7 @@ So, it's possible to use the dates manually specified into the [page metadata] t
299299
- `as_update`: meta tag name to use as update date. Default to `False`.
300300
- `datetime_format`: datetime format. Default to `"%Y-%m-%d %H:%M"`.
301301
- `default_timezone`: timezone to use by default to make aware datetimes. Default to `UTC`. Introduced in version 1.3.0 with [PR 142](https://github.com/Guts/mkdocs-rss-plugin/pull/142).
302-
- `default_time`: time to use if page contains only a date. Useful to avoid the 'midnight syndrom' or have to specify hour in every single page. Default to `None`. 24h-clock format is expected: `%H:%M`. Example: `"14:20"`. Introduced in version 1.4.0 with [PR 145](https://github.com/Guts/mkdocs-rss-plugin/pull/145).
302+
- `default_time`: time to use if page contains only a date. Useful to avoid the 'midnight syndrome' or have to specify hour in every single page. Default to `None`. 24h-clock format is expected: `%H:%M`. Example: `"14:20"`. Introduced in version 1.4.0 with [PR 145](https://github.com/Guts/mkdocs-rss-plugin/pull/145).
303303

304304
#### Example
305305

@@ -417,7 +417,7 @@ Default: `None`.
417417

418418
### Reference RSS feeds in HTML meta-tags
419419

420-
To facilitate the discovery of RSS feeds, it's recomended to add relevant meta-tags into the pages `<head>`, through template customization in `main.html` :
420+
To facilitate the discovery of RSS feeds, it's recommended to add relevant meta-tags into the pages `<head>`, through template customization in `main.html` :
421421

422422
```html
423423
{% extends "base.html" %}

tests/fixtures/mkdocs_simple.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Project information
2+
site_name: MkDocs RSS Plugin
3+
site_description: Documentation about the MkDocs RSS Plugin
4+
site_author: [email protected] (Julien M.)
5+
site_url: https://guts.github.io/mkdocs-rss-plugin/
6+
copyright: "Guts - In Geo Veritas"
7+
8+
# Repository
9+
repo_name: "guts/mkdocs-rss-plugin"
10+
repo_url: "https://github.com/guts/mkdocs-rss-plugin/"
11+
edit_uri: "blob/main/docs/"
12+
13+
docs_dir: "docs/"
14+
use_directory_urls: true
15+
16+
plugins:
17+
- rss:
18+
date_from_meta:
19+
as_creation: "date"
20+
as_update: false
21+
datetime_format: "%Y-%m-%d %H:%M"
22+
default_timezone: "Europe/Paris"
23+
default_time: "22:00"
24+
abstract_chars_count: 160
25+
abstract_delimiter: <!-- more -->
26+
image: https://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Feed-icon.svg/128px-Feed-icon.svg.png
27+
match_path: ".*"
28+
pretty_print: false
29+
url_parameters:
30+
utm_source: "documentation"
31+
utm_medium: "RSS"
32+
utm_campaign: "feed-syndication"
33+
- search
34+
35+
theme:
36+
name: mkdocs
37+
language: en
38+
39+
# Extensions to enhance markdown
40+
markdown_extensions:
41+
- admonition
42+
- attr_list
43+
- codehilite
44+
- meta
45+
- toc:
46+
permalink: "#"
47+
48+
nav:
49+
- "Home": "index.md"
50+
- "Settings": "configuration.md"
51+
- "Changelog": "changelog.md"

tests/test_build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_simple_build(self):
7171
with tempfile.TemporaryDirectory() as tmpdirname:
7272
cli_result = self.build_docs_setup(
7373
testproject_path="docs",
74-
mkdocs_yml_filepath=Path("mkdocs.yml"),
74+
mkdocs_yml_filepath=Path("tests/fixtures/mkdocs_simple.yml"),
7575
output_path=tmpdirname,
7676
strict=False,
7777
)

0 commit comments

Comments
 (0)