Releases: dtwrks/elm-book
1.4.1
Route Prefix and Fixes
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.
Nested Elm Architecture improvements and chapter init triggers
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
chore: update dillonkearns/elm-markdown to 7.x (#11) * chore: update elm-markdown version * chore: bump elm version
1.2.1
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
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
fix: remove nsfw links added by mistake
1.0.1
chore: update package description
1.0.0
chore: bump npm version