GithubHelp home page GithubHelp logo

Comments (5)

John98Zakaria avatar John98Zakaria commented on May 29, 2024 2

I decided to invest some time into the issue
Here are the 2 problems

  1. The documented syntax broke in commit as the regex that detects latex blocks changed in 80be226#diff-345d7ee55c0f3c8202375b28cf816e5fdf5f246d760624b86ed2e6f22c1510f1R192

Now you the should not add a space between the highlighting lines blocks and {at}

```js{all|1|2|all}{at:0}
const thisVarChanged = "Highlight me first!"
const eyo = "then me!"
\```
  1. The reason why slidev doesn't automatically proceed to the next slide automatically when using the {at:} directive is the fact that slidev has a list of elements that are clickable.
    In the case bellow we have 6 clickable elements.
```js{all|1|2|all}
const thisVarChanged = "Highlight me first!"
const eyo = "then me!"
\```

```js{all|1|2|all}{at:0}
const thisVarChanged = "Highlight me first!"
const eyo = "then me!"
\```

By default slidev will proceed to the next slide once the number of clicks > the number of clickable objects.

export const clicksTotal = computed(() => +(currentRoute.value?.meta?.clicks ?? clicksElements.value.length))

By using the {at:X} directive the number of clicks < number of clickable elements.

export function next() {
if (clicksTotal.value <= clicks.value)
nextSlide()
else
clicks.value += 1
}

That's why the click slide setting is currently needed

from slidev.

xaviermignot avatar xaviermignot commented on May 29, 2024 1

For anyone having the same issue, let met share this workaround:

  • Stick to v0.45.0
  • Limit the number of clicks on the slide using the clicks property in the frontmatter (as explained here).

With these two steps I don't have the issue anymore.

from slidev.

asm0dey avatar asm0dey commented on May 29, 2024 1

For me, the workaround works too, but it's ugly. Especially given the fact that in docs, the scenario of two synchronized code blocks is highlighted as a main scenario.

from slidev.

John98Zakaria avatar John98Zakaria commented on May 29, 2024 1

I fixed the docs such that no-one would hang at the issue again for now

slidevjs/docs#159

slidevjs/docs#160

from slidev.

xaviermignot avatar xaviermignot commented on May 29, 2024

Some additional information: I have tried to reproduce the issue using Stackblitz, and got a different behavior:

  • The lines on the first slide were highlighted in the same time (as expected) !
  • 3 more clicks were needed to go to the second slide
  • For the second slide, the behavior was the same as described in the issue description

Then I have noticed the version used by Stackblitz: v0.35.4... After a npm update to bump to v0.46.1, the behavior was the same as described in the issue description for both slides.
So something has probably changed regarding this feature between those versions 🤔

from slidev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.