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

Make post list shortcode independent of the reSt directive #3044

Merged
merged 8 commits into from Apr 16, 2018

Conversation

ralsina
Copy link
Member

@ralsina ralsina commented Apr 15, 2018

Moved the actual code into a shortcode plugin, made the reSt directive use the handler.

@Kwpolska
Copy link
Member

I think you forgot a file.

@ralsina
Copy link
Member Author

ralsina commented Apr 15, 2018

Or 2

Copy link
Member

@Kwpolska Kwpolska left a comment

Choose a reason for hiding this comment

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

Looks reasonable on first glance. I’m too lazy to test it now, so I’ll assume it works.

return output, template_deps

# Request file name from shortcode (Issue #2412)
Plugin.handler.nikola_shortcode_pass_filename = True
Copy link
Member

Choose a reason for hiding this comment

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

No newline at the end of file? What editor is this, notepad.exe?

# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

"""Post list directive for reStructuredText."""
Copy link
Member

Choose a reason for hiding this comment

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

Not quite.

import uuid

import natsort
from docutils import nodes
Copy link
Member

Choose a reason for hiding this comment

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

Are these docutils imports necessary, and if yes, how can we get rid of them?

@ralsina
Copy link
Member Author

ralsina commented Apr 15, 2018

@Kwpolska I forgot to run falke8 on it, all those should be fixed now.

@getnikola getnikola deleted a comment Apr 15, 2018
@getnikola getnikola deleted a comment Apr 15, 2018
@getnikola getnikola deleted a comment Apr 15, 2018
@getnikola getnikola deleted a comment Apr 15, 2018
@getnikola getnikola deleted a comment Apr 15, 2018
@getnikola getnikola deleted a comment Apr 15, 2018
@getnikola getnikola deleted a comment Apr 15, 2018

name = "post_list"

def handler(self, start=None, stop=None, reverse=False, tags=None, require_all_tags=False, categories=None,
Copy link
Member

Choose a reason for hiding this comment

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

@ralsina, perhaps move the long docstring from rest/post_list.py here?

@getnikola getnikola deleted a comment Apr 15, 2018
@getnikola getnikola deleted a comment Apr 15, 2018
@getnikola getnikola deleted a comment Apr 15, 2018
@getnikola getnikola deleted a comment Apr 15, 2018
@getnikola getnikola deleted a comment Apr 16, 2018
@getnikola getnikola deleted a comment Apr 16, 2018
@getnikola getnikola deleted a comment Apr 16, 2018
@getnikola getnikola deleted a comment Apr 16, 2018
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
@getnikola getnikola deleted a comment Apr 16, 2018
@getnikola getnikola deleted a comment Apr 16, 2018
@getnikola getnikola deleted a comment Apr 16, 2018
@Kwpolska Kwpolska merged commit 9487a25 into master Apr 16, 2018
@Kwpolska Kwpolska deleted the make-post-list-independent branch April 16, 2018 07:48
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