Coder Social home page Coder Social logo

code-hike / codehike Goto Github PK

View Code? Open in Web Editor NEW
4.2K 34.0 132.0 24.92 MB

Marvellous code walkthroughs

Home Page: https://codehike.org

License: MIT License

JavaScript 10.14% TypeScript 63.20% CSS 1.68% SCSS 4.03% HTML 0.29% Python 0.01% MDX 20.65%
blog code docs javascript markdown mdx react scrollytelling syntax-highlighting

codehike's People

Contributors

aeonfr avatar brianespinosa avatar dphuang2 avatar ghoshnirmalya avatar johndaly avatar mantish avatar mfranzke avatar pomber avatar yangshun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codehike's Issues

[scrollycoding] Preserve files from previous steps

Instead of repeating the same file for each step:

<Hike>

<StepHead>

```js somefile.js
console.log(1)
console.log(2)
```

</StepHead>

Markdown for step 1

<StepHead focus="1">

```js somefile.js
console.log(1)
console.log(2)
```

</StepHead>

Markdown for step 2

</Hike>

Use the files defined in the previous step and only override the ones defined in the current step.

<Hike>

<StepHead>

```js somefile.js
console.log(1)
console.log(2)
```

</StepHead>

Markdown for step 1

<StepHead focus="1" />

Markdown for step 2

</Hike>

[scrollycoding] Can't specify nested files

const steps = useMdxSteps(
  children,
  {
    preset: {
      customSetup: {
        files: {
          'public/index.html': `...`,
        },
      },
    },
  },
)

Instead of /public/index.html, /publicindex.html is created.

[scrollycoding] MDX syntax to hide tabs

<StepHead>

```js One.js
// code 
```

```js Two.js hidden
// code
```

</StepHead>

Add the hide flag to codeblocks so it doesn't display the Two.js tab on the mini editor.

[scrollycoding] FocusButton warning

Warning: Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks
    at FocusButton (scrollycoding-preview/node_modules/@code-hike/scrollycoding/dist/index.cjs.js:368:23)

[scrollycoding] Preview animation is too frequent

Currently, the preview is animated every time the code changes between two steps, even when the output doesn't change or doesn't matter. We should give the content author more control over this animation.

[scrollycoding] generatePackageJSON is not a function

I am trying to use scrollycoding as described in your example video and repo, but parsing the MDX file creates an error:

Error in function getSandpackStateFromProps in ./node_modules/react-smooshpack/dist/esm/utils/sandpack-utils.js:45
(0 , smooshpack__WEBPACK_IMPORTED_MODULE_0__.generatePackageJSON) is not a function

./node_modules/react-smooshpack/dist/esm/utils/sandpack-utils.js:45

Digging a bit into this I think there is a dependency version issue, because smooshpack exports createPackageJSON not generatePackageJSON.

Since the smooshpack and react-smooshpack packages are deprecated in favor for sandpack I don't know how I can enforce a correct version on this, because the code isn't available anymore.

MiniEditor without steps prop

I think this shouldn't break:

<MiniEditor code={code} file="App.js" />

Right now is throwing:

TypeError: Cannot read property 'file' of undefined

[infra] Fix rollup warnings

Most warnings are:

  • (!) Unresolved dependencies
  • (!) Missing global variable names

Maybe also fix the unmet peer dependency warnings from yarn install.

[highlighter] Should include language dependencies

This doesn't work very well:

const code = await highlight({
    code: mdx,
    lang: "mdx",
    theme,
  });

Because 'mdx' depends on 'md' and 'jsx' and so on.

Two potential fixes:

  • load all the grammars
  • add an optional parameter with dependencies

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.