Skip to content

Commit 6a0515e

Browse files
committed
deprecated 0.7.1
1 parent 700ef7d commit 6a0515e

3 files changed

Lines changed: 2 additions & 186 deletions

File tree

README.md

Lines changed: 0 additions & 184 deletions
Original file line numberDiff line numberDiff line change
@@ -4,187 +4,3 @@ Web View
44
## DEPRECATED
55

66
This package has been renamed to [atomic-css](http://github.com/seanhess/atomic-css), focusing on css utilities. `View` features like `context` have been moved to [hyperbole](https://github.com/seanhess/hyperbole)
7-
8-
[![Hackage](https://img.shields.io/hackage/v/web-view.svg)][hackage]
9-
10-
11-
Type-safe HTML and CSS with intuitive layout and composable styles. Inspired by Tailwindcss and Elm-UI
12-
13-
### Write Haskell instead of CSS
14-
15-
Type-safe utility functions to generate styled HTML.
16-
17-
```haskell
18-
myPage = col (gap 10) $ do
19-
el (bold . fontSize 32) "My page"
20-
button (border 1) "Click Me"
21-
```
22-
23-
Leverage the full power of Haskell functions for reuse, instead of relying on CSS.
24-
25-
```haskell
26-
header = bold
27-
h1 = header . fontSize 32
28-
h2 = header . fontSize 24
29-
page = gap 10
30-
31-
myPage = col page $ do
32-
el h1 "My Page"
33-
...
34-
```
35-
36-
This approach is inspired by Tailwindcss' [Utility Classes](https://tailwindcss.com/docs/utility-first)
37-
38-
### Intuitive Layouts
39-
40-
Easily create layouts with `row`, `col`, `grow`, and `space`
41-
42-
```haskell
43-
holygrail :: View c ()
44-
holygrail = layout id $ do
45-
row section "Top Bar"
46-
row grow $ do
47-
col section "Left Sidebar"
48-
col (section . grow) "Main Content"
49-
col section "Right Sidebar"
50-
row section "Bottom Bar"
51-
where section = 'border' 1
52-
```
53-
54-
### Embedded CSS
55-
56-
Views track which styles are used in any child node, and automatically embed all CSS when rendered.
57-
58-
>>> renderText $ el bold "Hello"
59-
60-
<style type='text/css'>.bold { font-weight:bold }</style>
61-
<div class='bold'>Hello</div>
62-
63-
64-
### Stateful Styles
65-
66-
We can apply styles when certain states apply. For example, to change the background on hover:
67-
68-
```haskell
69-
button (bg Primary . hover (bg PrimaryLight)) "Hover Me"
70-
```
71-
72-
Media states allow us to create responsive designs
73-
74-
```haskell
75-
el (width 100 . media (MinWidth 800) (width 400))
76-
"Big if window > 800"
77-
```
78-
79-
### Try Example Project with Nix
80-
81-
If you want to get a feel for web-view without cloning the project run `nix run github:seanhess/web-view` to run the example webserver locally
82-
83-
Import Flake
84-
------------
85-
86-
You can import this flake's overlay to add `web-view` to `overriddenHaskellPackages` and which provides a ghc966 and ghc982 package set that satisfy `web-view`'s dependencies.
87-
88-
```nix
89-
{
90-
inputs = {
91-
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
92-
web-view.url = "github:seanhess/web-view"; # or "path:/path/to/cloned/web-view";
93-
flake-utils.url = "github:numtide/flake-utils";
94-
};
95-
96-
outputs = { self, nixpkgs, web-view, flake-utils, ... }:
97-
flake-utils.lib.eachDefaultSystem (
98-
system:
99-
let
100-
pkgs = import nixpkgs {
101-
inherit system;
102-
overlays = [ web-view.overlays.default ];
103-
};
104-
haskellPackagesOverride = pkgs.overriddenHaskellPackages.ghc966.override (old: {
105-
overrides = pkgs.lib.composeExtensions (old.overrides or (_: _: { })) (hfinal: hprev: {
106-
# your overrides here
107-
});
108-
});
109-
in
110-
{
111-
devShells.default = haskellPackagesOverride.shellFor {
112-
packages = p: [ p.web-view ];
113-
};
114-
}
115-
);
116-
}
117-
```
118-
119-
Local Development
120-
-----------------
121-
122-
### Recommended ghcid command
123-
124-
If you want to work on both the web-view library and example code, this `ghcid` command will run and reload the examples server as you change any non-testing code.
125-
126-
```
127-
ghcid --command="cabal repl exe:example lib:web-view" --run=Main.main --warnings --reload=./embed/preflight.css
128-
```
129-
130-
If you want to work on the test suite, this will run the tests each time any library code is changed.
131-
132-
```
133-
ghcid --command="cabal repl test lib:web-view" --run=Main.main --warnings --reload=./embed/preflight.css
134-
```
135-
136-
### Nix
137-
138-
- `nix flake check` will build the library, example executable and devShell with ghc-9.8.2 and ghc-9.6.6
139-
- This is what the CI on GitHub runs
140-
- `nix run` or `nix run .#ghc982-example` to start the example project with GHC 9.8.2
141-
- `nix run .#ghc966-example` to start the example project with GHC 9.6.6
142-
- `nix develop` or `nix develop .#ghc982-shell` to get a shell with all dependencies installed for GHC 9.8.2.
143-
- `nix develop .#ghc966-shell` to get a shell with all dependencies installed for GHC 9.6.6.
144-
- `nix build`, `nix build .#ghc982-web-view` and `nix build .#ghc966-web-view` builds the library with the `overriddenHaskellPackages`
145-
- If you want to import this flake, use the overlay
146-
- `nix flake update nixpkgs` will update the Haskell package sets and development tools
147-
148-
### Common Nix Issues
149-
150-
#### Not Allowed to Refer to GHC
151-
152-
If you get an error like:
153-
154-
```
155-
error: output '/nix/store/64k8iw0ryz76qpijsnl9v87fb26v28z8-my-haskell-package-1.0.0.0' is not allowed to refer to the following paths:
156-
/nix/store/5q5s4a07gaz50h04zpfbda8xjs8wrnhg-ghc-9.6.3
157-
```
158-
159-
Follow these [instructions](https://nixos.org/manual/nixpkgs/unstable/#haskell-packaging-helpers)
160-
161-
#### Dependencies Incorrect
162-
163-
You will need to update the overlay, look for where it says `"${packageName}" = hfinal.callCabal2nix packageName src { };` and add a line like `Diff = hfinal.callHackage "Diff" "0.5" { };` with the package and version you need.
164-
165-
#### Missing Files
166-
167-
Check the `include` inside the `nix-filter.lib` to see if all files needed by cabal are there.
168-
169-
Learn More
170-
----------
171-
172-
View Documentation on [Hackage][hackage]
173-
* https://hackage.haskell.org/package/web-view
174-
175-
View on Github
176-
* https://github.com/seanhess/web-view
177-
178-
View [Examples](https://github.com/seanhess/web-view/blob/latest/example/app/Main.hs)
179-
180-
181-
[hackage]: https://hackage.haskell.org/package/web-view
182-
183-
184-
Contributors
185-
------------
186-
187-
* [Sean Hess](https://github.com/seanhess)
188-
* [Kamil Figiela](https://github.com/kfigiela)
189-
* [Pfalzgraf Martin](https://github.com/Skyfold)
190-

package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: web-view
2-
version: 0.7.0
2+
version: 0.7.1
33
synopsis: Type-safe HTML and CSS with intuitive layouts and composable styles.
44
homepage: https://github.com/seanhess/web-view
55
github: seanhess/web-view

web-view.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cabal-version: 2.2
55
-- see: https://github.com/sol/hpack
66

77
name: web-view
8-
version: 0.7.0
8+
version: 0.7.1
99
synopsis: Type-safe HTML and CSS with intuitive layouts and composable styles.
1010
description: Type-safe HTML and CSS with intuitive layouts and composable styles. Inspired by Tailwindcss and Elm-UI . See documentation for the @Web.View@ module below
1111
category: Web

0 commit comments

Comments
 (0)