Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[static_comments] Support more metadata formats via metadata extractors #241

Merged
merged 7 commits into from Jul 24, 2017

Conversation

felixfontein
Copy link
Contributor

@felixfontein felixfontein commented Jul 23, 2017

Fixes #232

It uses the metadata extractors introduced in getnikola/nikola#2861, which will be available in Nikola v8.

@felixfontein
Copy link
Contributor Author

felixfontein commented Jul 23, 2017

The main code change is in b2b1e2f, the other commits are copying the plugin from v7/ to v8/ (d7b12b3), preparation (0cbe195) and documentation and version bumping (36310dd).

Copy link
Member

@Kwpolska Kwpolska left a comment

LGTM

found_in_priority = False
for extractor in self.site.metadata_extractors_by['priority'].get(priority, []):
# We need to do a first check ourselves since metadata_extractors.check_conditions
# expects a post object (to check the compiler, if MetaCondition.compiler is used).
Copy link
Member

@Kwpolska Kwpolska Jul 23, 2017

Choose a reason for hiding this comment

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

This could be fixed upstream (in check_conditions) — care to make a PR?

Copy link
Contributor Author

@felixfontein felixfontein Jul 24, 2017

Choose a reason for hiding this comment

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

"""Add static comments to posts."""

# Used to parse comment headers
_header_regex = re.compile('^\.\. (.*?): (.*)')
Copy link
Member

@Kwpolska Kwpolska Jul 23, 2017

Choose a reason for hiding this comment

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

This is unused.

Copy link
Contributor Author

@felixfontein felixfontein Jul 24, 2017

Choose a reason for hiding this comment

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

Ah yes, I forgot to remove that.

@felixfontein felixfontein merged commit d2f769d into master Jul 24, 2017
@felixfontein
Copy link
Contributor Author

felixfontein commented Jul 24, 2017

Thanks for reviewing!

@felixfontein felixfontein deleted the static-comments-more-metadata-formats branch Jul 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants