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

Test and document list returning behavior for action functions #200

Merged
merged 2 commits into from
Nov 22, 2021

Conversation

jacobwhall
Copy link
Contributor

  • Adds tests/test_walk.py, which tests the behavior I document below
  • Adds the following rule for action functions to docs/source/code.rst:

    If the received element is a block or inline element, they may return a list of elements of the same base class, which will take the place of the received element.

  • Various spelling and capitalization fixes to documentation

We may want to consider allowing lists of MetaValues to be returned, though in my opinion it makes more sense to return a MetaList in those situations.

In #199, @ickc suggested that if action functions return a single element, that element should always be in a list, and that we should only allow standalone elements to be returned for compatibility reasons. Because of the difference between Block/Inline and MetaValue lists I described above, I'm not sure what would be best. I tried to write this documentation change to best reflect the current behavior of Panflute.

As a new contributor to this project (and in general), I welcome any feedback! Thank you for your time.

jacobwhall and others added 2 commits November 13, 2021 16:00
- tests for Element.walk() to understand how it handles lists
  returned by action functions
- documenting ability for action functions to return lists of
  block or inline elements
- various spelling and capitalization fixes
@sergiocorreia sergiocorreia merged commit d00acff into sergiocorreia:master Nov 22, 2021
@jacobwhall
Copy link
Contributor Author

@sergiocorreia It looks like the pytest step failed for the build GitHub Action for this PR. I'd be happy to help look into it.

@jacobwhall jacobwhall deleted the action-lists branch November 22, 2021 21:46
@ickc
Copy link
Collaborator

ickc commented Nov 25, 2021

@jacobwhall, the failure may be related to compatibility issues with newer pandoc versions.

But I wonder why this pull request doesn't has a GitHub Actions build?

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.

3 participants