-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add new module * Fix uncheckedHSX quasiquoter * Make sure closing tags are checked * Fix it so it works * remove UncheckedHSX and attept to restore QQ and Parser modules * reset some unecessary whitespace stuff * remove unecessary whitespace * unchecked HSX working, with tests on the parser * Add customHsx + tests * fix comment * fix comment * Update ihp-hsx/IHP/HSX/Parser.hs Co-authored-by: Marc Scholten <[email protected]> * Update ihp-hsx/IHP/HSX/QQ.hs Co-authored-by: Marc Scholten <[email protected]> * remove newtypes and use 'HsxSettings' directly * Fix Github resolve bug * Aesthethic nitpick * use customHsx to call hsx and uncheckedHsx * Move CustomHsxCases to Test.HSX namespace * Fix import * Fix module comment * For now, move CustomHsxCases back so the tests are working again * Add documentation * Minor doc fix * Formulate solution to QuasiQuoter shortcomings * typo fix * Add use-case example * Simplify langauge * Improve examples a bit * Add spread example --------- Co-authored-by: Marc Scholten <[email protected]>
- Loading branch information
1 parent
b68c4dd
commit 61bc6a7
Showing
8 changed files
with
409 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{-| | ||
Module: Test.HSX.CustomHsxCases | ||
Description: Test helpers for HSX tests with custom tags and attributes | ||
-} | ||
module IHP.HSX.CustomHsxCases where | ||
|
||
import Test.Hspec | ||
import Prelude | ||
import IHP.HSX.QQ | ||
import qualified Text.Blaze.Renderer.Text as Blaze | ||
import Data.Text | ||
import Language.Haskell.TH.Quote | ||
import IHP.HSX.Parser | ||
import qualified Data.Set as Set | ||
|
||
myCustomHsx :: QuasiQuoter | ||
myCustomHsx = customHsx | ||
(HsxSettings { checkMarkup = True | ||
, additionalTagNames = Set.fromList ["mycustomtag", "anothercustomtag"] | ||
, additionalAttributeNames = Set.fromList ["my-custom-attr", "anothercustomattr"] | ||
} | ||
) | ||
|
||
myTagsOnlyHsx :: QuasiQuoter | ||
myTagsOnlyHsx = customHsx | ||
(HsxSettings { checkMarkup = True | ||
, additionalTagNames = Set.fromList ["mycustomtag", "anothercustomtag"] | ||
, additionalAttributeNames = Set.fromList [] | ||
} | ||
) | ||
|
||
myAttrsOnlyHsx :: QuasiQuoter | ||
myAttrsOnlyHsx = customHsx | ||
(HsxSettings { checkMarkup = True | ||
, additionalTagNames = Set.fromList [] | ||
, additionalAttributeNames = Set.fromList ["my-custom-attr", "anothercustomattr"] | ||
} | ||
) |
Oops, something went wrong.