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

Showmore plugin: Allow negative numbers #77

Open
hagenburger opened this issue Oct 1, 2018 · 0 comments
Open

Showmore plugin: Allow negative numbers #77

hagenburger opened this issue Oct 1, 2018 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers plugin

Comments

@hagenburger
Copy link
Owner

hagenburger commented Oct 1, 2018

Existing functionality

Video preview of Showmore plugin

Detailed documentation: https://github.com/hagenburger/pimd/tree/master/plugins/showmore#readme

New feature

To allow more easy counting, allow negative numbers:

```html +showmore=2..-2
<ul>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
</ul>
```

Should have the same result as:

```html +showmore=2..11
<ul>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
  <li></li>
</ul>
```

And should look like:

<ul>
  ···
</ul>

The counting works like:

 1 -12 <ul>
 2 -11   <li></li>
 3 -10   <li></li>
 4  -9   <li></li>
 5  -8   <li></li>
 6  -7   <li></li>
 7  -6   <li></li>
 8  -5   <li></li>
 9  -4   <li></li>
10  -3   <li></li>
11  -2   <li></li>
12  -1 </ul>

Both numbers of the range can be negative:

```html +showmore=-3..-1
<ul>
  <li></li>
  <li></li>
</ul>
```

Should result in:

<ul>
  ···
@hagenburger hagenburger added enhancement New feature or request good first issue Good for newcomers plugin labels Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers plugin
Projects
None yet
Development

No branches or pull requests

1 participant