Skip to content

Releases: dtwrks/elm-book

1.4.1

11 May 06:47
Compare
Choose a tag to compare

This patch release allows people to call ThemeOptions.globals multiple times. This shouldn't change anything for most use cases but it allows elm-book-interop packages to make use of globals in a transparent way.

Route Prefix and Fixes

28 Jan 00:52
Compare
Choose a tag to compare

ElmBook.ThemeOptions.routePrefix

You can now specify a routePrefix option when setting up your ElmBook! This is useful for when you're hosting it somewhere other than the root of your website (e.g. https://company.com/design-system/).

book "ElmBook's"
        |> withThemeOptions
            [ ElmBook.ThemeOptions.routePrefix "/design-system"
            ]
        |> withChapters [ ... ]

Exposed ChapterBuilder

ChapterBuilder type is now exposed so you can build reusable chapter pipelines and share them across chapters.

Fixes

  • /logAction "magical string" can be used whenever you want to log a link click instead of navigating to some url. There was a problem where using it inside a chapter group broken the behavior. This is now fixed.
  • chapterLink did not work inside chapterGroups. This is now fixed.

Closes #17 , #18 , #24 , #25

Nested Elm Architecture improvements and chapter init triggers

27 Nov 19:03
Compare
Choose a tag to compare

This release is made of two new things:

ElmBook.Chapter.withChapterInit

With this helper you can trigger an action when you first render a chapter on the screen. This will be triggered again whenever you navigate back to the chapter. This can be useful to reset the chapter state or fetch updated information remotely and then save them to your state.

chapter "Input"
    |> withChapterInit (\state -> ({ state | input = "" }, Cmd.none))
    |> renderComponent input

ElmBook.Actions.mapUpdate and ElmBook.Actions.mapUpdateWithCmd

These helpers will make the process of using nested elm architectures a lot less painful. For more information check out the update docs at the bottom of this page: https://elm-book-in-elm-book.netlify.app/guides/stateful-chapters .

Thanks

A special thanks to @NeoVier for opening the issue and a PR that led to some of these changes! 🙇

upgrade elm-markdown dep to 7.x

11 Oct 16:06
731fbef
Compare
Choose a tag to compare
chore: update dillonkearns/elm-markdown to 7.x (#11)

* chore: update elm-markdown version

* chore: bump elm version

1.2.1

06 Sep 18:06
Compare
Choose a tag to compare

elm-hot compatibility

This patch version contains a significant refactor of the underlying code so elm-book is now compatible with elm-hot. All user-facing options are now stored in the init clojure and completely left out of our model, which enables hot module reloading, as per @gampleman 's explanation on #6 .

However, the current built-in elm-live setup is not set up for elm-hot. It should work for custom setup using elm-live, parcel, vite, webpack, etc.

I'll refactor the built-in webserver to both handle elm-hot and stop generating that obnoxious index.html on the root folder on a follow-up release.

1.2.0

31 Jul 16:12
Compare
Choose a tag to compare

Hash Based Navigation

If you're using elm-book on a non-spa server or if you just want to host on a subfolder as a static file, you can now use ThemeOptions.useHashBasedNavigation to make that work! 🎉 Huge thanks to @gampleman for working on this feature.

To enable this just add this setting like this:

book "MyApp"
    |> withThemeOptions [
        ElmBook.ThemeOptions.useHashBasedNavigation
    ]

Dark Mode Components

You can now trigger state changes based on the dark/light mode the user is seeing. You can then use that state to display your own dark or light components based on the global theme.

Take a look at the Dark Components guide for more details.

1.1.0

24 Jul 17:53
Compare
Choose a tag to compare
fix: remove nsfw links added by mistake

1.0.1

22 Jul 13:18
Compare
Choose a tag to compare
chore: update package description

1.0.0

18 Jul 10:17
Compare
Choose a tag to compare
chore: bump npm version