Skip to content

Update docs with example on injecting articles#2922

Closed
iUnknwn wants to merge 2 commits intogetpelican:masterfrom
iUnknwn:AddArticleViaAPIToDocs
Closed

Update docs with example on injecting articles#2922
iUnknwn wants to merge 2 commits intogetpelican:masterfrom
iUnknwn:AddArticleViaAPIToDocs

Conversation

@iUnknwn
Copy link
Contributor

@iUnknwn iUnknwn commented Sep 22, 2021

Updated the plugin documentation to add a recipe for adding articles programmatically when pelican is running.

I struggled to understand how to dynamically add content to Pelican (for example, if I wanted to fetch content via an API rather than from Markdown). Once I got it working, I wanted to update the docs so it was a bit easier for the next person. Hopefully this is the preferred way to inject dynamic content (as far as I can tell - this seems like it would be the correct signal).

Pull Request Checklist

N/A - updating documentation only - no code changes.

Updated the plugin documentation to add a recipe for adding articles
programatically when pelican is running.
docs/plugins.rst Outdated
"title": "Injected Article!",
"date": datetime.datetime.now(),
"category": baseReader.process_metadata('category', 'fromAPI'),
"tags": baseReader.process_metadata("tags", 'tagA, tagB')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Random switch between single-quoted and double-quoted strings is triggering me a bit :).

@avaris
Copy link
Member

avaris commented Sep 22, 2021

I like the idea but if go down this route we can end up with countless little recipes here (plugins can do a lot). Maybe it's better to move this to its own document (like Example plugin recipes) instead?

@iUnknwn
Copy link
Contributor Author

iUnknwn commented Sep 24, 2021

I'm happy to pull out the plugin examples into another page, if that would be better. Also happy to normalize the quotes.

I do think that more documentation on the plugins overall is a good thing, though, both in terms of explaining what plugins can do (the docs focus on building new readers and generators, but not interacting with them), and showing how extendable pelican can be (discovering I could use hugo/liquid-style short codes by extending markdown was insanely helpful, but I never would have realized that was possible from the docs alone).

@iUnknwn
Copy link
Contributor Author

iUnknwn commented Sep 30, 2021

Just to follow up, would you like me to separate out the plugin examples and additional docs onto a separate page?

@avaris
Copy link
Member

avaris commented Sep 30, 2021

I think it's still manageable as is, so let's keep it in same page. If you can normalize the quotes, I'll approve.

Also made a small change to the section title to make it a bit more
clear.
@iUnknwn
Copy link
Contributor Author

iUnknwn commented Oct 5, 2021

Sounds good. I normalized the quotes, and adjusted the section title to be a bit more simple/direct.

Copy link
Member

@avaris avaris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@justinmayer
Copy link
Member

Merged manually via 9ec1750. Many thanks to @iUnknwn for the documentation addition and to @avaris for reviewing. 🏅

@justinmayer justinmayer added manual merge Pull request was merged manually and removed awaiting review labels Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual merge Pull request was merged manually

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants