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

Added option to stop inclusion of page content at a certain point. #210

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

lpaulsen93
Copy link
Member

This can be done by using the syntax tag {{includestop}} or by using the flag length.
E.g. if length=1000 is set, then only 1000 signs of a page will be included, counted is only cdata content.

Some more points to mention:

  • if both {{includestop}} and flag length are used on the page then the earlier one wins
  • this feature can be used to close a feature request in the blog plugin, see Please implement excerpts and a "read more..." macro plugin-blog#13.
  • if a list is interrupted by the length flag or {{includestop}} then the current list content item and list is properly closed but no more list items are created
  • if a table is interrupted by the length flag or {{includestop}} then the current table cell row and table is properly closed but no more table rows are created
  • if the length flag or {{includestop}} are used then the read more link will be created if the flag readmore is set

lpaulsen93 and others added 4 commits June 5, 2017 18:59
This can be done by using the syntax tag '{{includestop}}' or by using the flag 'length'.
E.g. if 'length=1000' is set, then only 1000 signs of a page will be included, counted is only cdata content.
Copy link
Member

@michitux michitux left a comment

Choose a reason for hiding this comment

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

In general I like the idea but I fear to get this to work properly there is more work needed. I have added a simple example to test case that does not work yet. Further, I think the current code doesn't close nested lists properly. Plugin support is also totally missing.

I have a different suggestion: what about disallowing the {{includestop}} syntax in nested environments, i.e., making this a syntax that only works in the top level or maybe in top level paragraphs. That should make the whole "close everything" code much simpler.

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.

2 participants