Skip to content

Flowbite tailwind example output does not compile without post-processing #34

@houseofmercy-github

Description

@houseofmercy-github

Trying out https://mbylstra.github.io/html-to-elm with flowbite examples
generates Elm that requires imports and post-processing. Problem mainly
lies in need for qualified Svg imports.

For reference here is a script that works with sed on osx that corrects the output
for the samples on this page https://flowbite.com/docs/components/sidebar

#!/bin/bash

# Fixes output from https://mbylstra.github.io/html-to-elm
# Assumes imports:
#
#  import Html exposing (..)
#  import Html.Attributes exposing (..)
#  import Svg
#  import Svg.Attributes

sed -i .bak \
    -e 's/ d "/ Svg.Attributes.d "/g' \
    -e 's/ svg \[ class "/ Svg.svg [ Svg.Attributes.class "/g' \
    -e 's/ path / Svg.path /g' \
    -e 's/ viewBox "/ Svg.Attributes.viewBox "/g' \
    -e 's/ fill "/ Svg.Attributes.fill "/g' \
    Main.elm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions