Browse Source

Initial, alpha commit

I've decided to move all of these disparate repositories together. It
was getting difficult to maintain all of them, especially when finding a
bug in the parser while writing the manual.
master
Alex Feldman-Crough 2 years ago
commit
047e158272
  1. 46
      .brittany.yaml
  2. 2
      .envrc
  3. 211
      .ghc.environment.x86_64-linux-8.6.5
  4. 1
      .gitattributes
  5. 7
      .gitignore
  6. 373
      LICENSE
  7. 4
      README.pro
  8. 2
      bin/build
  9. 64
      bin/format
  10. 3
      bin/prosidy-manual
  11. 4
      bin/typecheck
  12. 8
      cabal.project
  13. 0
      cabal.project.local
  14. 13
      doc/overview.pro
  15. 139
      src/chronicle/System/Log/Chronicle.hs
  16. 23
      src/chronicle/chronicle.cabal
  17. 24
      src/hakyll-contrib-prosidy/Hakyll/Contrib/Prosidy.hs
  18. 1
      src/hakyll-contrib-prosidy/LICENSE
  19. 21
      src/hakyll-contrib-prosidy/hakyll-contrib-prosidy.cabal
  20. 1
      src/propp/LICENSE
  21. 22
      src/propp/Main.hs
  22. 20
      src/propp/propp.cabal
  23. 42
      src/prosidy-manual/Main.hs
  24. 183
      src/prosidy-manual/Prosidy/Manual.lhs
  25. 117
      src/prosidy-manual/Prosidy/Manual/Monad.hs
  26. 44
      src/prosidy-manual/prosidy-manual.cabal
  27. 230
      src/prosidy-markup/Main.hs
  28. 25
      src/prosidy-markup/prosidy-markup.cabal
  29. 225
      src/prosidy-markup/syntax-guide.pro
  30. 1
      src/prosidy/LICENSE
  31. 7
      src/prosidy/Prosidy.hs
  32. 114
      src/prosidy/Prosidy/Internal/JSON.hs
  33. 88
      src/prosidy/Prosidy/Internal/Optics.hs
  34. 379
      src/prosidy/Prosidy/Parse.hs
  35. 412
      src/prosidy/Prosidy/Types.hs
  36. 61
      src/prosidy/prosidy.cabal
  37. 164
      src/prosidy/test-data/golden/input/gamut.pro
  38. 18
      src/prosidy/test-data/golden/input/literal.pro
  39. 1
      src/prosidy/test-data/golden/output/gamut.golden
  40. 1
      src/prosidy/test-data/golden/output/literal.golden
  41. 16
      src/prosidy/test/Prosidy/Test.hs
  42. 75
      src/prosidy/test/Prosidy/Test/Gen.hs
  43. 40
      src/prosidy/test/Prosidy/Test/Golden.hs
  44. 69
      src/prosidy/test/Prosidy/Test/Optics.hs
  45. 36
      src/prosidy/test/Prosidy/Test/Serde.hs
  46. 1
      src/prosidyc/LICENSE
  47. 280
      src/prosidyc/Prosidy/Compile.hs
  48. 216
      src/prosidyc/Prosidy/Compile/Internal/Error.hs
  49. 115
      src/prosidyc/Prosidy/Compile/Internal/Eval.hs
  50. 110
      src/prosidyc/Prosidy/Compile/Internal/Spec.hs
  51. 66
      src/prosidyc/Prosidy/Compile/Internal/Util.hs
  52. 30
      src/prosidyc/prosidyc.cabal
  53. 6
      vim/runtime/README.md
  54. 1
      vim/runtime/ftdetect/prosidy.vim
  55. 13
      vim/runtime/ftplugin/prosidy.vim
  56. 153
      vim/runtime/syntax/prosidy.vim

46
.brittany.yaml

@ -0,0 +1,46 @@
conf_debug:
dconf_roundtrip_exactprint_only: false
dconf_dump_bridoc_simpl_par: false
dconf_dump_ast_unknown: false
dconf_dump_bridoc_simpl_floating: false
dconf_dump_config: false
dconf_dump_bridoc_raw: false
dconf_dump_bridoc_final: false
dconf_dump_bridoc_simpl_alt: false
dconf_dump_bridoc_simpl_indent: false
dconf_dump_annotations: false
dconf_dump_bridoc_simpl_columns: false
dconf_dump_ast_full: false
conf_forward:
options_ghc: []
conf_errorHandling:
econf_ExactPrintFallback: ExactPrintFallbackModeInline
econf_Werror: true
econf_omit_output_valid_check: false
econf_produceOutputOnErrors: false
conf_preprocessor:
ppconf_CPPMode: CPPModeAbort
ppconf_hackAroundIncludes: false
conf_obfuscate: false
conf_roundtrip_exactprint_only: false
conf_version: 1
conf_layout:
lconfig_reformatModulePreamble: true
lconfig_altChooser:
tag: AltChooserBoundedSearch
contents: 3
lconfig_allowSingleLineExportList: false
lconfig_importColumn: 50
lconfig_hangingTypeSignature: false
lconfig_importAsColumn: 50
lconfig_alignmentLimit: 30
lconfig_allowHangingQuasiQuotes: true
lconfig_indentListSpecial: true
lconfig_indentAmount: 4
lconfig_alignmentBreakOnMultiline: true
lconfig_cols: 80
lconfig_indentPolicy: IndentPolicyFree
lconfig_indentWhereSpecial: true
lconfig_columnAlignMode:
tag: ColumnAlignModeMajority
contents: 0.7

2
.envrc

@ -0,0 +1,2 @@
PATH_add bin
PATH_add bin/cabal

211
.ghc.environment.x86_64-linux-8.6.5

@ -0,0 +1,211 @@
-- This is a GHC environment file written by cabal. This means you can
-- run ghc or ghci and get the environment of the project as a whole.
-- But you still need to use cabal repl $target to get the environment
-- of specific components (libs, exes, tests etc) because each one can
-- have its own source dirs, cpp flags etc.
--
clear-package-db
global-package-db
package-db /home/alex/.cabal/store/ghc-8.6.5/package.db
package-db dist-newstyle/packagedb/ghc-8.6.5
package-id chronicle-0.1.0.0-inplace
package-id ansi-terminal-0.10.2-2dc0f2e43ea327068915d6a979c22f0864572a00911d7c8231eebe006e40d638
package-id base-4.12.0.0
package-id ghc-prim-0.5.3
package-id rts
package-id integer-gmp-1.0.2.0
package-id colour-2.3.5-53776e4fee39fa728d7c4e1d1c1a4d54210c3b31d5231c8b47a4d2dac66d4989
package-id ansi-wl-pprint-0.6.9-dbea1004a1359534184431eb85935e37c2b2ad58262801a29af65960f370399d
package-id fast-logger-3.0.0-8c714680508f5da0888ec93bade69f26c20093e5c47ca5660b58a5d359237294
package-id array-0.5.3.0
package-id auto-update-0.1.6-cc73461ce30c11f2e57a0d9118e737f59a19e35ce50d089a5151e0ae71712293
package-id bytestring-0.10.8.2
package-id deepseq-1.4.4.0
package-id directory-1.3.3.0
package-id filepath-1.4.2.1
package-id time-1.8.0.2
package-id unix-2.7.2.2
package-id easy-file-0.2.2-c35470a0131847077c1b64c9e0b8677fe02738f648838690932c9528af59b3df
package-id text-1.2.4.0-c2ae72f9658b8874afabd7ea4a24877e638e7a9eb22d306d9dded16ed2a3a31d
package-id binary-0.8.6.0
package-id containers-0.6.0.1
package-id template-haskell-2.14.0.0
package-id ghc-boot-th-8.6.5
package-id pretty-1.1.3.6
package-id unix-compat-0.5.2-bb5c52439947b0c45487d82e35cd18bbf9a84cab4665295e263e169eff1a7697
package-id unix-time-0.4.7-d680486b3e3df3c8d9190e172a4ec6e23b8ffa621a8bfad29a71fdedc748fb1c
package-id old-time-1.1.0.3-c27f007fa38d888712c4f43d2dbaac88d6836b146dde5287404031dae8298514
package-id old-locale-1.0.0.7-80f887dddfdcd29567061cb9d0e00f47017b48730cfd37807885e745b0be8dda
package-id hakyll-contrib-prosidy-0.0.1.0-inplace
package-id hakyll-4.13.0.1-51ba21c3a448d044116712eca721431f3e1898a36be0b23cdf205b44d6a1e00f
package-id blaze-html-0.9.1.2-029dcea7deedd2497f1b5b7ce48b21967bf1bcb090cd3b70e50d9cd04eb9f4ca
package-id blaze-builder-0.4.1.0-48d15548c92f936fcee51e89c786d128a0d40da5936dd8e9c7c9cbbd305d6509
package-id blaze-markup-0.8.2.3-c6258f69f8e27bbb11049bb25b68dfc6355abfa32b4f046dced98a00aece0df3
package-id cryptohash-0.11.9-e5f0cc5d7262104cf59e05c69f244faed8915436b1a6214e716ff09366858e1c
package-id byteable-0.1.1-3d5bfb82d8764d5b710caf10b5829d9fce40b35535d5ea64d6366af56be299b0
package-id cryptonite-0.26-459ba3060d2b7ae4dadcf78efc751ebd96ecb43c01c871bc11b35a65be48ddcf
package-id basement-0.0.11-c93aa5ce46a8be61160cd4cffde61c36d7141f3bee8b863b4c7fd534fdc33aac
package-id memory-0.15.0-265032d929ebed3af5c8b2c81e3fde1e9ffb17ffc9b89805198a4442d8398140
package-id data-default-0.7.1.1-6ae050978f694ed934ffef3e48332033ad7ca4ae36ef580bb361e949da5ab09c
package-id data-default-class-0.1.2.0-c618a2dab0c77b06bff2d7b386c10865a20c0625cfe1e55aef21d258c580db9f
package-id data-default-instances-containers-0.0.1-30039a5c1e8aed0ae03845e8046c68462dbcc559a851bc008b76b98ec09f9a32
package-id data-default-instances-dlist-0.0.1-cacac25c1f9191eddd45b7411bd2ab2d88976143a87f80832032683b2980e26c
package-id dlist-0.8.0.7-87e95dfa61349b600389c36cf652355dd35f09e7c9197aa3b6d9a16d95cdc6a5
package-id data-default-instances-old-locale-0.0.1-aa5bb51f79f36cc79f923eba3de7e876efaf69512cda663de8c818ee0f198cd5
package-id file-embed-0.0.11.1-93d9b66ce7a5a68533760a0effd050833f2c1366ea934846417e4bc5616b833e
package-id fsnotify-0.3.0.1-d1214d7c459a6dab6f226e71db92a1001951123bf542ec6ed2a3851b89ca18d6
package-id async-2.2.2-f117595b0248a9635549f29a47d9866b0e710108024e778e5ccaffeda75ea504
package-id hashable-1.2.7.0-c20152eaa799e82858f7b9db2ee593f57785404628a46eda584adaaf277ec1fc
package-id stm-2.5.0.0-aa481e63498aa14c60744d0e2a70fcdedfb04ad7db8323b91b8bd4f2042eaca1
package-id hinotify-0.4-77e286626c0be4a4eff0fb1abcfd1750a1a3f85c067083f4313229d1449398c5
package-id shelly-1.9.0-badb2d84cc60dd870b7179bd92700fb3f95ce1ff24c8b6fce383595a6b55340c
package-id enclosed-exceptions-1.0.3-aca12fad3612eeb782e1e1752869f2a625aa1420cb027740f729626dffbddbe6
package-id lifted-base-0.2.3.12-c5eec9f8a5609565ad57d3af28f55670b59a550153794613529d0069237b8913
package-id monad-control-1.0.2.3-788b44d27d7e5e3c2a913fda3d6acdbea7dd2cc427ff5aa856a51d7757e8e61a
package-id transformers-0.5.6.2
package-id transformers-base-0.4.5.2-6cb1d30c6bd880b7df63fb82e2eff9476765898f571009a1a301ec36963d2033
package-id base-orphans-0.8.1-b7d9c0aa2d11bf7d30fb3363c9d5830bb0efb7ab2778ae7fea2f276fea1b585b
package-id transformers-compat-0.6.5-ad082516100fea2a07b4d10b032dcdea07dec2a1580b8069eeabcfcb5dcd6059
package-id exceptions-0.10.4-a25f0ac6af85bd262493de16c1743cf01e323bd0fd2861756e66de853786b62e
package-id mtl-2.2.2-e66e24691de619909dbe1204b9d470038c60f1595d3bbd1895488778c7930ceb
package-id lifted-async-0.10.0.4-94fe9adde09eda1bb2bef2cc26f6e2af88d9a2035000ff5045e6a46cb2a8b8ff
package-id constraints-0.11.2-ee8ed544816922f1386029e2ec791f8626503c28779a27c512297b02d704cfe5
package-id semigroups-0.19.1-587d7c85481bbb19606f3f4e028e747346d745c88567cf723a7937d96356cb46
package-id type-equality-1-1167d5a826f5562883cc857b7c1c12db70de62726f6e1080a218e0615603e4c0
package-id process-1.6.5.0
package-id http-conduit-2.3.7.3-6866fd2b0037f225fb8ce133beb544cf05aabcca4214e5f8507112f2709c784a
package-id aeson-1.4.6.0-23451cbee2672c27a4191ba5a0dbe0eac53474cb6cef566e8288023f76157193
package-id attoparsec-0.13.2.3-c239263d07906c57f31751857a8708126151fb40d87a6328a72d3b25a344f858
package-id scientific-0.3.6.2-e87195642c051f0e1c0ec3340b9e0ed3797160af07837fed20f3700fe9a0f430
package-id integer-logarithms-1.0.3-8760a784241e76cefb032afbbca4e5532e21247e657f7e520b4fbfccd7c46bd3
package-id primitive-0.7.0.0-2ff2822117ed46d82de853d692e905be66dcca7f21cb37e4701f4793da404cf2
package-id base-compat-0.11.0-0b7ffcf467ea32ca9441d66d233af48c6bf1a1c721d354b367b7c738676031aa
package-id tagged-0.8.6-8e056b71367655353ca5b31af065862b0cba5cecc3365360968be8d76a4ad7e4
package-id th-abstraction-0.3.1.0-25a524d927746bf59106e8f5680a7ef5cdcc4d7ad0158e2cc0d1960b807da309
package-id time-compat-1.9.2.2-48aa7a80169364da986cb6658f9c638f4b1dd7418b6272cd1164f9058bfa923d
package-id unordered-containers-0.2.10.0-34a1a33ed7371d393a31290955f4f4f8b1f9f11f5ae57583232019406989dae5
package-id uuid-types-1.0.3-4baf991d63beb201de7dd2bd47026a16165d80d275bb2dfc6f648e272eeaa58a
package-id random-1.1-7b66fa297bfcbd595493a6c644955fd593a367c517e9baf40a8112df6e857f69
package-id vector-0.12.0.3-ca0bf573201884ea2717d33a7e5eb16610c4dbe187c57b9f3fa3b428f010bfae
package-id conduit-1.3.1.2-d0b1d0cbeb826104d0a23bc1200fd33ead2d7ab0c12e3a0dbb2fb819a0a144ae
package-id mono-traversable-1.0.15.1-64add9a262ab1d47e439d44e179eea40be21d7c37e4d5df0f97866e765d80e63
package-id split-0.2.3.3-97c0caa2fe4f27f5ea0447fd8ef5093bf0c1eed193adfdc9aaa37b13f6c9ef2c
package-id vector-algorithms-0.8.0.3-a4e73bda4743f740afe9f28ceb55d3a3282fe263cf666d704f00b9dc904cc621
package-id resourcet-1.2.2-90729c605357d6ef0fa13874aeef5fa67464488a2c2a4d7701a980bab528b4e9
package-id unliftio-core-0.1.2.0-60b2a353562ed84dac3093ea00201b71701235b68fb5c3dc392f73b56a39283d
package-id conduit-extra-1.3.4-c53f3791f6f502bccdd55eb203179ecd85bf383ad138bd00399e1bf32620de57
package-id network-3.1.1.1-a10d2fa97e2dc3b84d2ec36ca3fdf9de50fed0b50bacdf6b42c59374bf519d38
package-id streaming-commons-0.2.1.1-ade5cd6e27668cb9bb0f3d48d2f0b6b81f5fda1d32e4da606c4790dcf1108201
package-id zlib-0.6.2.1-a9122a53bc05d5618be8daef36d6995441f74dfe447916d57a83585cb5ddac6c
package-id typed-process-0.2.6.0-ddf9c9d0850a82e9c817a009f68a95b7bfd4c2beb6a741899ac08d84cc30d2d4
package-id http-client-0.6.4-d645633c971fa90769e5722c72da62100aae032fe6116ce30f4b37f74fe92292
package-id case-insensitive-1.2.1.0-06306978be118a4b23b3b6f82a742ef7488df115aea7016facdac3d358e048a1
package-id cookie-0.4.5-1884d1b8dc2b3857cac86ee558c68c5806ac4b53d25771ffe884efb51cb7b3c2
package-id http-types-0.12.3-6b9bb4b26d26af03849d3a6e7bb6f5255ba09746fccdd6678d410d22ebc0f865
package-id mime-types-0.1.0.9-62a60d838408b4d7ae2f2ebcf380f80b066cd70f5cd2f2c2226aab5c8dce09a1
package-id network-uri-2.6.1.0-210e91819f07ab99b5ab7f68486974359567080b4e50178728b3dadfb0c9b43b
package-id parsec-3.1.14.0-436d442f1cf6b724b95a8b5cc95ba5d2d1fcc3be8fcb80a705737daeec142b94
package-id http-client-tls-0.3.5.3-91151fdb679697c56075098bda0aad9abc02d4a845e3b15dd45d27f62a949e9e
package-id connection-0.3.1-9bb94bbb5c44e66933c7553342e9af924c9aaeefa4d58def06b0ac9be8c12c75
package-id socks-0.6.1-084244795e91e028a9637adb0cfc5396a0c85fdb3c02d09b4f5bec4e26c3a4f2
package-id cereal-0.5.8.1-5c26e6a9f2afc9119d6b555c377064a7af28e38f0feac0a6a885f4354841a2eb
package-id tls-1.5.2-563ef19c6d40fd6e5b1d41bff0507df8ff0b74d9a33dc0b6fdd13113618d3f4e
package-id asn1-encoding-0.9.6-80366a64ab0cf61eee543d3085ea62e5c0a78758bbc5ec577c795288d6433a6d
package-id asn1-types-0.3.3-37238c65adaa3f68ce9150ea9f51001cc4071e223a00bf5866bd42c7f9f712a9
package-id hourglass-0.2.12-4b7addf2d42e07db47ea81be6d3c094b23dd3afc12c06890c047ffc2775c4dc2
package-id x509-1.7.5-8563fe0deb989bf0dfd50108e39039dcf750964223a4a72b313512a23a0a0b06
package-id asn1-parse-0.9.5-52d8adba50e3ab1b9112c3bb51ed8db02d18d2149bb2314a5472829fb4662b7b
package-id pem-0.2.4-16116a8757fdca6332d94cb164ded55943752fc67353f07b64f30b0ccc3dd1d1
package-id x509-store-1.6.7-62e43449a9f3830b70257a1e3909f1ae78bcd798a3545dc2b8a099290d5b07c0
package-id x509-validation-1.6.11-8029463ccfa3a79af06b155b584b9cdab55547f4db3f563aabd732c9bddc17ac
package-id x509-system-1.6.6-260fc710aff1a47628cc462d4e26f1e0a604315ab511c3b6fe89232d630b71a4
package-id lrucache-1.2.0.1-4c144cf514aa1c442b52e4592a20328db39b84c001624b659bfb6dc82e51b21d
package-id contravariant-1.5.2-a82bf270197d1ba9e479e28198e1bb256d87c8bfa6e6927a18af9e27c31827b1
package-id StateVar-1.2-099a8543251b4537d06c4021fe3bff1b4611e4c27cdadcf9ac4bd60cb8c065ec
package-id optparse-applicative-0.14.3.0-546df155f11e0fea250d7612aa9a6170463872f560067812eacac19fe4ce3b22
package-id pandoc-2.7.3-5f3fb74ab1bb1f8fa479f1a02ddc37d864394a41e0b53b09e78ce18d4055eb0a
package-id Glob-0.10.0-a9488112fecab3b6567b4907656e4b0e31c310c58c03a2d31a277197ab419fd5
package-id HTTP-4000.3.14-5278a967ab54f38f2a5dab560be1f2e0e96adc4906bb460bcf86b7efc3c96a88
package-id HsYAML-0.1.2.0-322229df41ee002981e03f74452e60164bd9e88a021c1d9d2b6b09a97413d5ee
package-id JuicyPixels-3.3.4-1b795504daf969b0774c6df7a6de162ace4caecd42928e9150d9f5f445c24805
package-id SHA-1.6.4.4-ca913b097efaf2eac13d5dfd83564ac0f88d4c9fd2bdd77c029e4d6f7b7aeab3
package-id aeson-pretty-0.8.8-9645a0aa2f8cdb15354521f9d9c4ff01c95f0ac08049b8625366c4f960297b38
package-id base64-bytestring-1.0.0.2-39b1434dcb1fe069353d0fe32edf5bd0366c4bd1fe9cbdc4bc11b5f81e88873c
package-id cmark-gfm-0.2.1-cdd84f5fba2b98aa39474b26c449922b5697cb7f95ca58d5c3e00dc5ea1183c1
package-id doctemplates-0.2.2.1-0091f9dfbd42281f0b217997b7e7da645a7e4def6e7b36fe19d2981f45ddee7c
package-id haddock-library-1.7.0-71c2ae719a6bce1c6a7e7245f79bae1902e01bda3a32c266c3c2fbb0452d8fb4
package-id hslua-1.0.3.2-113dec388be46d19e49af97b714ed68ebc0978593904adc42cc0d45f7962294f
package-id fail-4.9.0.0-76a3f2491cb9884e452c2dbda80fc86e03105735e20578ac7bd339e8ed7e6b98
package-id hslua-module-system-0.2.1-e6d1c66a2dab2b31afcbe290f4528c73fd47f82e8bf12d71d5b4c1456e2faa98
package-id temporary-1.3-db1f911d34d81330dd15e966aa3dbb8c751f2f6042bdcf3f7d282a9b45bf0dd1
package-id hslua-module-text-0.2.1-153acbf37e418010839732ed210b9f6ec0855452dcf52132bc412a8f7755e69c
package-id ipynb-0.1-2dd459a4134a799424179a1f09af089ec0f304697a2bef4d5d3d51ca63a79b82
package-id pandoc-types-1.17.6.1-67c749aa7cc038ceaa05ba79e771939b36fac3086c2f3cd480ddc883f4737d52
package-id QuickCheck-2.13.2-6892514883ea925cbada79f45c7367660140f96d3f5148e22fb8d87046b0a2f4
package-id splitmix-0.0.3-c93b56a8d33021fad4c5d26869aebcbc6436a39260d13958ac135dcb8d534c29
package-id syb-0.7.1-bac5f137bab7f119c112c8356bf2a9057a84680b8be81df52b7071594d5a6267
package-id safe-0.3.18-2aaead6220f580f273343474cf44bcfd65451ab082a240f57e425e935fea292c
package-id skylighting-0.8.3-1ded9694c1985a36287813d3e6e86358ff091417fe726db07646fb9090701872
package-id skylighting-core-0.8.3-3d87935daaf2a188cbd8f988a4a37cd837304cce78fa0d2764223138d97de37e
package-id hxt-9.3.1.18-f3b2f72a2c2fd9b15a538d784387a71e34120cb3d323719a14edb33ab01c5e57
package-id hxt-charproperties-9.4.0.0-94069e5e53f12541d033b35136d46583dcc81e48d19a42350f683a8581229d4e
package-id hxt-regex-xmlschema-9.2.0.3-7217085f7222490834adaf155f758be1ff727019264cbbbcd2dd0d07eb51cf43
package-id hxt-unicode-9.0.2.4-8a906ece8961db2ec2702d544ff704afddde6550e78ca27dde43d130ec0cfca0
package-id regex-pcre-builtin-0.95.0.8.8.35-73137ef95e49df476637b58132b6589f24ed7b7e6a65bc4cae287c04c4bba061
package-id regex-base-0.93.2-e4e20670eba07de737dc5601f21a59af12813b36e0d19ec2ccec6649f354361b
package-id utf8-string-1.0.1.1-16f7cd82e5474c27b86813441fe0f804d48d48f7b7a3167c11a6cabd18b528f0
package-id tagsoup-0.14.8-aeec797b415ccc265f89689f67118f0d3e357f97bec4c95613ead8663d4b7f15
package-id texmath-0.11.3-5076cce34dfc625cc171efffcbe7d6aa8215774d709d03a516daf419407e72ee
package-id xml-1.3.14-35539c805765698b7cb99f7a066659d00fbc6818cee2e670af697680bc7c6e10
package-id unicode-transforms-0.3.6-a984ca749b8b6efe6907cf8f9defcbad7a8ad80cd2ba235f8b9838723e319497
package-id bitarray-0.0.1.1-9ba03f9002e09fd28fee5c2822331dd58db6cc2cec0c6b5fb40c28879dd532ce
package-id zip-archive-0.4.1-f2b68e4c37b5f1d1dc935affcf042854c8595f7357f5a8b1715c17efd5edabfe
package-id digest-0.0.1.2-117522a4022a59cc58da4a71929baf7fcf27a4ac68dc5eb6e36642d81bcf57d6
package-id pandoc-citeproc-0.16.2-b2ded21c06268617d98c00cfbfc4f7cad7fce844d9d50d1ced223873c206fa63
package-id hs-bibutils-6.8.0.0-7b2e6b6721ac8d8c7c9164e421f77286da1e194c9d53d12aae9357f2d22db348
package-id rfc5051-0.1.0.4-327e6009564a6a58f358a6552902271ba6d9439d35b30aac036d636eaaf27a4b
package-id setenv-0.1.1.3-c4a81c423343ef63df1a5a078b73b05079db3eb9d5030d2b58075b267eb2dcab
package-id xml-conduit-1.8.0.1-4759d6ddedab7941d8fcc84e39fb7a76c775de9b56a3d13da96a10cc55aed065
package-id xml-types-0.3.6-619b2597bbc5110bd20535debf5f468c3e11ac4ed52813599a8fac989301ace5
package-id yaml-0.11.2.0-cb04cca5ec96ee1fd7d0ece232cc993ce374ee716f9bc3cce39b2365748cdaee
package-id libyaml-0.1.1.1-a41776766bd8fa1efab88bb5f77ca454e063e239440ad430720ff3502c2a9089
package-id regex-tdfa-1.2.3.2-041f151daf0d81e0be9d437775e0c40426cfc0862616d56b70a571b77ab03b53
package-id time-locale-compat-0.1.1.5-7b0f184a3f41d5bbbb284080b6473897b9d2f85105729cc15bec1c1abbbdd8d2
package-id wai-3.2.2.1-8aa0eaed3a1761b275152954c72b18ae195c0ad666445efe204c65e4ade5557f
package-id vault-0.3.1.3-9993b1fc2981e4860de734c62996991080ebb7bec17ca9119672abf937335fbc
package-id wai-app-static-3.1.6.3-1dc2c93db31ffedb85c832368dd71a422e72ec61a12e43d0357bda3062f58aa0
package-id http-date-0.0.8-e5161b82f93cb42874d96f23b03e3e4d7ade83c77476908364ef89a36dcf9ccf
package-id wai-extra-3.0.28-a04bb514d2109f9f755b410fa0738fab5d7ca2dff82421da7f6f04a960d828c4
package-id http2-1.6.5-798f768d1d3a482c9396380d2189d833ee153ef58d556197ab652f5a3c87c012
package-id network-byte-order-0.1.2.0-8b1d343fac3604cfe6c8e14abb19f2dde12e93abecc6ef6257f20c0c85cc3aca
package-id psqueues-0.2.7.2-73eea41e146ec3e90da712298a10891dfc0f954e0e6e9ed02cd76822284d5aac
package-id iproute-1.7.8-c639a354ae083e4be14084e6fbcca83464d2b8967a4384a4acce7d799a59ec93
package-id appar-0.1.8-d2837d97bae942ef0684de8a53847e19ed79f6db57ceb68e26aa2857a95ed34c
package-id byteorder-1.0.4-ad8485c043e6cfc29c886f9970bba17c985fb7c4ebc7a05b629af67a35a3c8c5
package-id void-0.7.3-d04b704a30ddba5da20a732cd6e4dc5e1babf8be8d271a9ba9eb97b613a3ffdb
package-id wai-logger-2.3.6-4f6e1753c2c06a7415d05c43ba4a392b7e3259ff5be893ee7caddf0934284791
package-id word8-0.1.3-cc46026d2b3c47330f9a75731f7c963904ac73c35a3abd261e2aafe76979b9f5
package-id warp-3.2.28-dcb0155990e605f29a70016cbfe1f042a8e14cc4a7e7508f486fd6793a9e742c
package-id bsb-http-chunked-0.0.0.4-6158e1038901606f7b477120b2ceb9e9b165633dc36d59c308d5afe21148d8fb
package-id simple-sendfile-0.2.30-91c1c6a2b4d717ad7351d3f2891d678293a53e8ec0611b98b73a4b98d3c2d470
package-id time-manager-0.0.0-c6b539fee52306fb5280d72997a910d30a970455171420569791b6de78b8fe46
package-id prosidy-1.0.0.0-inplace
package-id megaparsec-8.0.0-d503b2a9001a4196e16aadd3e7ae59530e16bcc74ee37bc1f34b3ef5d66b6e72
package-id parser-combinators-1.2.1-4e18800a8002d07febb9fc8cabb1b82848eddc05509d85511635df821da98c91
package-id prettyprinter-1.5.1-ad4aae585f34d8dce9237b8f3e6b5b44f75305c0f80f3f575a3c216a0eb0bdea
package-id profunctors-5.3-0b30be1b9ad99323c7acb44a29f3e14bb3aba19ed105b01f72178bb638e09e5f
package-id bifunctors-5.5.6-7d692f765d57c8afea5ab00e94ac76a47815a60e923bf89cdca2c8f31d006065
package-id comonad-5.0.6-ff05e2462fd8c09e47d2a1d5fa1e922d52bf9a91e52098ad97ebcdf9f4e93108
package-id distributive-0.6.1-15cb8a79958164ea3f1eabb29be8bff4bed15d9ed9402726b77b12c8adba32ad
package-id lens-4.17.1-878d5531961d3c2f4042cc242d517e1c7d7ae6c8560e09eaaf3e10c90f9bdf81
package-id call-stack-0.2.0-1af5ab25b7e32de4a30b41e2e1b9a92f8bc3e52b11af007e5cca028121292373
package-id free-5.1.3-1aecedbd8ae9190ae402d357c7703d797344df53b8e9be7c3f3875bd324e054e
package-id semigroupoids-5.3.4-baec15c25abbbdd203b8d19f872f686073198a159533bb65f4c3ab20812ed308
package-id kan-extensions-5.2-896c8c4728979e8d7af6158de7772943daef0078c0c3e046dd6f9df1544b7745
package-id adjunctions-4.4-b96906896afb2181bf3265a54aaee354366c537f5147f9da1eb7ddade95316e4
package-id invariant-0.5.3-63a5e9886a8aa72abe306d0a84564853ed56aa7d7381659c1571941af85c936e
package-id parallel-3.2.2.0-e0e276a65e56f3f931e3094d31547a0131ef00fb01982c17aed69953b8773d11
package-id reflection-2.1.5-5758fcc02f8caa64644197676f755b2a441848e286c3eb4608534af5d237eb0e
package-id generic-lens-1.1.0.0-17ace09bc853e499e199c62ff3b8036131f18f074cc705e0981d8d82fc70319b
package-id prosidyc-0.1.0.0-inplace
package-id mmorph-1.1.3-38b8670425a13bbb2cd0b7cdb129945f8ac00cc403d8bda6de825c9c728a8890

1
.gitattributes

@ -0,0 +1 @@
*.golden -text

7
.gitignore

@ -0,0 +1,7 @@
.stack-work/
dist/
dist-newstyle/
/bin/cabal/
/_site
/_cache
*~

373
LICENSE

@ -0,0 +1,373 @@
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.

4
README.pro

@ -0,0 +1,4 @@
title: Prosidy README
---
Prosidy is a small language for writing documents.

2
bin/build

@ -0,0 +1,2 @@
#!/bin/sh
exec cabal v2-build "${@:-all}"

64
bin/format

@ -0,0 +1,64 @@
#!/bin/bash
set -euo pipefail
cd "$(dirname ${BASH_SOURCE})/.."
# File(s) that brittany can't currently handle b/c view patterns
IGNORE_PATTERN='src/prosidy/Prosidy/Types.hs'
msg () { printf -- '\e[1m----> %s\e[m\n' "$*" >&2; }
warn () { printf -- '\e[33;1m----! %s\e[m\n' "$*" >&2; }
err () { printf -- '\e[31;1m----! %s\e[m\n' "$*" >&2; exit 1; }
#
# Make sure that everything is staged to Git, so that bad formats can be
# undone.
#
function ensure_staged
{
local -a unstaged
unstaged=( $(git ls-files --modified '*.hs') )
if [ -n "${unstaged:-}" ]
then
warn 'Formatting will overwrite the contents of files.'
warn 'The following files have been modified but not staged.'
for path in "${unstaged[@]}"
do
echo "$path" >&2
done
err 'Please stage (git add) these files and try again.'
fi
}
ensure_staged
#
# Ensure that brittany is installed; if it isn't, install it via Cabal
#
function install_brittany
{
[ -x bin/cabal/brittany ] || {
warn 'The command `brittany` was not found.'
msg 'Installing `brittany`: this may take a few minutes...'
cabal v2-install --verbose=0 --symlink-bindir="$PWD/bin/cabal" brittany
}
}
install_brittany
#
# Format Haskell files
#
function do_format
{
local -a hsfiles
hsfiles=($(
IFS=$'\0'
git ls-files '*.hs' | grep -v "$IGNORE_PATTERN"
))
[ -n "${hsfiles:-}" ] || {
err 'Didn'\''t find any Haskell sources.'
}
bin/cabal/brittany \
--no-user-config --config-file="$PWD/.brittany.yaml" \
--write-mode inplace \
"${hsfiles[@]}"
}
do_format

3
bin/prosidy-manual

@ -0,0 +1,3 @@
#!/bin/sh
set -e
exec cabal v2-exec -- prosidy-manual -- "$@"

4
bin/typecheck

@ -0,0 +1,4 @@
#!/bin/sh
exec cabal v2-build --disable-optimization --flags '-fno-code' "${@:-all}"

8
cabal.project

@ -0,0 +1,8 @@
packages: src/*/*.cabal
jobs: $ncpus
package *
split-sections: true
optimization: true
executable-stripping: true
executable-static: true

0
cabal.project.local

13
doc/overview.pro

@ -0,0 +1,13 @@
title: An overview of Prosidy
---
Prosidy is a small language for writing,
designed to be extensible and fun.
It's #i{unopinionated}
different types of writing have highly different requirements
so Prosidy is designed to allow users to define their own #i{dialects}.
#-section[ title = 'Prosidy compared to other markup languages'
, slug = 'language-comparison' ]:
#:

139
src/chronicle/System/Log/Chronicle.hs

@ -0,0 +1,139 @@
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE StrictData #-}
module System.Log.Chronicle
( Level(..)
, withLogger
, log
, trace
, debug
, info
, warn
, error
, fatal
)
where
import Prelude hiding ( log
, error
)
import Control.Concurrent ( MVar
, newEmptyMVar
, tryReadMVar
, tryPutMVar
, takeMVar
)
import Control.Monad ( when )
import Data.Char ( toUpper )
import Data.Foldable ( for_ )
import System.IO.Unsafe ( unsafePerformIO )
import Control.Monad.IO.Class ( MonadIO(liftIO) )
import qualified Control.Exception as Exception
import qualified System.Exit as Exit
import qualified System.Log.FastLogger as Log
import qualified System.Log.FastLogger.Date as Log.Date
import qualified Text.PrettyPrint.ANSI.Leijen as PP
import qualified System.Console.ANSI as ANSI
import qualified System.IO as IO
data Level =
Trace
| Debug
| Info
| Warn
| Error
| Fatal
deriving (Show, Eq, Ord, Enum)
data Logger = Logger
{ color :: Bool
, minLevel :: Maybe Level
, loggerSet :: Log.LoggerSet
, getTime :: IO Log.FormattedTime
}
globalLogger :: MVar Logger
globalLogger = unsafePerformIO newEmptyMVar
withLogger :: Maybe Bool -> Maybe Level -> IO a -> IO a
withLogger shouldColor minLevel =
Exception.bracket install (Exception.mask_ . remove) . const . handler
where
handler :: IO x -> IO x
handler = Exception.handle $ \e -> do
case Exception.fromException @Exit.ExitCode e of
Just exit -> do
info @Log.LogStr "ExitCode exception was thrown; exiting"
Exception.throwIO exit
Nothing -> do
error @String "An unhandled exception caused Prosidy to fail"
fatal $ Exception.displayException e
Exit.exitFailure
install :: IO Bool
install = do
color <- maybe (ANSI.hSupportsANSI IO.stderr) pure shouldColor
loggerSet <- Log.newStderrLoggerSet Log.defaultBufSize
getTime <- Log.Date.newTimeCache "%Y-%m-%d %H:%M:%S"
tryPutMVar globalLogger Logger { color, minLevel, loggerSet, getTime }
remove :: Bool -> IO ()
remove installed = when installed $ do
Logger { loggerSet } <- takeMVar globalLogger
Log.rmLoggerSet loggerSet
log :: Log.ToLogStr msg => Level -> msg -> IO ()
log level msg = do
maybeLogger <- tryReadMVar globalLogger
for_ maybeLogger $ \Logger { color, getTime, minLevel, loggerSet } ->
when (maybe False (level >=) minLevel) $ do
-- First, write out the formatted timestamp
now <- getTime
Log.pushLogStr loggerSet . Log.toLogStr $ now
-- Then write out the log level, formatted to all capital letters
let levelStr = fmap toUpper . show $ level
levelPad = replicate (6 - length levelStr) ' '
Log.pushLogStr loggerSet . Log.toLogStr $ levelPad
Log.pushLogStr loggerSet . logColor color level . PP.text $ levelStr
Log.pushLogStr loggerSet " | "
-- Then write the message, followed by a new line
Log.pushLogStrLn loggerSet . Log.toLogStr $ msg
logColor :: Bool -> Level -> PP.Doc -> Log.LogStr
logColor True Fatal = docToLogStr . PP.bold . PP.white . PP.onred
logColor True Error = docToLogStr . PP.bold . PP.red
logColor True Warn = docToLogStr . PP.bold . PP.yellow
logColor True Info = docToLogStr . PP.bold . PP.blue
logColor True Debug = docToLogStr . PP.bold . PP.green
logColor True Trace = docToLogStr . PP.magenta
logColor False _ = docToLogStr
docToLogStr :: PP.Doc -> Log.LogStr
docToLogStr = Log.toLogStr . flip PP.displayS "" . PP.renderPretty 1.0 maxBound
trace, debug, info, warn, error, fatal
:: forall msg m . (MonadIO m, Log.ToLogStr msg) => msg -> m ()
trace = liftIO . log Trace
{-# INLINE trace #-}
{-# SPECIALIZE INLINE trace :: Log.ToLogStr msg => msg -> IO () #-}
debug = liftIO . log Debug
{-# INLINE debug #-}
{-# SPECIALIZE INLINE debug :: Log.ToLogStr msg => msg -> IO () #-}
info = liftIO . log Info
{-# INLINE info #-}
{-# SPECIALIZE INLINE info :: Log.ToLogStr msg => msg -> IO () #-}
warn = liftIO . log Warn
{-# INLINE warn #-}
{-# SPECIALIZE INLINE warn :: Log.ToLogStr msg => msg -> IO () #-}
error = liftIO . log Error
{-# INLINE error #-}
{-# SPECIALIZE INLINE error :: Log.ToLogStr msg => msg -> IO () #-}
fatal = liftIO . log Fatal
{-# INLINE fatal #-}
{-# SPECIALIZE INLINE fatal :: Log.ToLogStr msg => msg -> IO () #-}

23
src/chronicle/chronicle.cabal

@ -0,0 +1,23 @@
name: chronicle
synopsis: A wrapper around fast-logger
author: James Alexander Feldman-Crough
maintainer: alex@fldcr.com
copyright: Copyright 2020 to James Alexander Feldman-Crough
category: System
version: 0.1.0.0
cabal-version: >=1.10
license: MPL-2.0
license-file: LICENSE
build-type: Simple
library
default-language: Haskell2010
hs-source-dirs: .
ghc-options: -Wall
build-depends: base >=4.12 && <4.14
, ansi-wl-pprint >=0.6 && <0.7
, ansi-terminal >=0.9 && <0.11
, fast-logger >=2.4 && <3.1
exposed-modules: System.Log.Chronicle

24
src/hakyll-contrib-prosidy/Hakyll/Contrib/Prosidy.hs

@ -0,0 +1,24 @@
module Hakyll.Contrib.Prosidy
( module Prosidy
, prosidyCompiler
)
where
import Prosidy
import Hakyll
import Data.Text ( Text )
import qualified Data.Text.Lazy as Text.Lazy
import Data.Text.Lazy.Encoding ( decodeUtf8 )
import Control.Monad.Error.Class ( liftEither )
import Data.Bifunctor ( first )
prosidyCompiler :: Compiler (Item Document)
prosidyCompiler = do
filePath <- getResourceFilePath
Item iid src <- getResourceText
doc <- liftEither . first (pure . show) $ parseDocument filePath src
pure $ Item iid doc
getResourceText :: Compiler (Item Text)
getResourceText = fmap (Text.Lazy.toStrict . decodeUtf8) <$> getResourceLBS

1
src/hakyll-contrib-prosidy/LICENSE

@ -0,0 +1 @@
../../LICENSE

21
src/hakyll-contrib-prosidy/hakyll-contrib-prosidy.cabal

@ -0,0 +1,21 @@
cabal-version: >=1.10
name: hakyll-contrib-prosidy
version: 0.0.1.0
synopsis: Hakyll compiler handling Prosidy files
license: MPL-2.0
license-file: LICENSE
author: James Alexander Feldman-Crough
maintainer: alex@fldcr.com
copyright: Copyright 2020 to James Alexander Feldman-Crough
build-type: Simple
library
default-language: Haskell2010
hs-source-dirs: .
exposed-modules: Hakyll.Contrib.Prosidy
build-depends: base >=4.7 && <5
, prosidy
, hakyll >=4.13 && <4.14
, bytestring >=0.10 && <0.11
, mtl >=2.2 && <2.3
, text >=1.2 && <1.3

1
src/propp/LICENSE

@ -0,0 +1 @@
../../LICENSE

22
src/propp/Main.hs

@ -0,0 +1,22 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
module Main where
import Prosidy
import Control.Lens
import System.Environment ( getArgs )
import qualified Data.Text.IO as Text.IO
main :: IO ()
main = do
args <- getArgs
let [_, input, output] = filter ((/= "-") . take 1) args
doc <- readDocument input
doc
^. cosmosOnOf (content . folded) (_BlockTag . content . folded)
. _BlockLiteral
. filtered (has $ tag . only [keyQ|haskell|])
. content
. coerced
. to (<> "\n")
& Text.IO.writeFile output

20
src/propp/propp.cabal

@ -0,0 +1,20 @@
name: propp
version: 0.1.0.0
license: MPL-2.0
license-file: LICENSE
author: James Alexander Feldman-Crough
maintainer: alex@fldcr.com
copyright: Copyright 2020 to James Alexander Feldman-Crough
category: Language
build-type: Simple
cabal-version: >=1.10
synopsis: Prosidy pre-processor for literate source code.
executable propp
hs-source-dirs: .
main-is: Main.hs
default-language: Haskell2010
build-depends: base >= 4.7 && < 5
, prosidy
, lens >=4.17 && <4.18
, text >=1.2 && <1.3

42
src/prosidy-manual/Main.hs

@ -0,0 +1,42 @@
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Prosidy ( readDocument )
import Prosidy.Manual ( compileDocument )
import Hakyll
import Hakyll.Contrib.Prosidy
import Data.Foldable ( foldlM
, for_
)
import System.Exit ( exitFailure )
import System.FilePath ( (</>)
, (-<.>)
)
import Text.Blaze.Html.Renderer.Utf8 ( renderHtml )
import Data.ByteString.Lazy as LBS
import qualified Data.Text.IO as Text.IO
import qualified System.IO as IO
import qualified System.FilePath as Path
import qualified System.Directory as Dir
import Control.Monad.Except (throwError)
main :: IO ()
main = hakyll' $ do
match "*.pro" $ do
route (setExtension "html")
compile $
prosidyCompiler >>=
withItemBody compileDocumentIO
hakyll' :: Rules a -> IO ()
hakyll' = hakyllWith $ defaultConfiguration
{ providerDirectory = "./doc"
}
compileDocumentIO :: Document -> Compiler LBS.ByteString
compileDocumentIO = either (throwError . (:[]) . show) (pure . renderHtml) . compileDocument

183
src/prosidy-manual/Prosidy/Manual.lhs

@ -0,0 +1,183 @@
## vi: ft=prosidy wrap
title: Manual.lhs
created: 2020-01-01T17:22-8000
updated: 2020-01-01T17:22-8000
---
#=haskell:
{-# LANGUAGE ApplicativeDo #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecursiveDo #-}
{-# LANGUAGE TypeApplications #-}
#:
#=haskell[hide]:
module Prosidy.Manual
( compileDocument
, ManualError(..)
) where
#:
#=haskell:
import Prosidy
import Prosidy.Compile
import Prosidy.Manual.Monad
import Data.Bifunctor (Bifunctor(..))
import Data.Text (Text)
import Text.Blaze.Html5 ((!))
import Text.Read (readEither)
import Type.Reflection (Typeable)
import qualified Control.Lens as L
import qualified Data.Text as Text
import qualified Text.Blaze.Html5 as H
import qualified Text.Blaze.Html5.Attributes as A
#:
#=haskell:
type Html input = RuleT input Manual H.Html
#:
Our rules for parsing are all contained inside of the #lit{document} rule. Prosidy requires that a rule must be registered before it can be used to prevent some issues with non-termination.
Because rules are mutually recursive, we have to use #lit{MonadFix} for this to work! #lit{RecursiveDo} is a wonderful extension that provides from syntactic sugar for this.
#=haskell:
document :: Html Document
document = mdo
#:
Let's start with the non-recursive rules.
For text nodes, we should just convert their content directly into HTML. The #lit{self} descriptor returns the focus of a rule directly.
#=haskell:
plainText <- rule @Text @Manual @H.Html "plain text" $
fmap H.text self
#:
Prosidy inserts empty markers called #def{breaks} between lines in a paragraph and before or after an inline tag (if it has a space on that side). Because #i{CJKV} languages don't really care about spacing, we don't assume the user wants a space in these situations.
The Prosidy manual, however, is in English, which #i{does} want spaces in these locations. When we encounter a break, we should render a single space.
#=haskell:
break <- rule "break" $
pure $ H.text " "
#:
#=haskell:
block <- choose "block context"
[ _BlockParagraph @? paragraph
, _BlockTag @? blockTag
]
inline <- choose "inline context"
[ _Break @? break
, _InlineTag @? inlineTag
, _InlineText @? plainText
]
#:
#=haskell:
paragraph <- rule "paragraph" $ do
body <- descend inline $ _Paragraph . L.folded
pure $ H.p body
#:
#=haskell:
blockTag <- choose "block tag"
[ tagged [keyQ|section|] @? section
]
inlineTag <- choose "inline tag"
[ tagged [keyQ|b|] @? bold
, tagged [keyQ|i|] @? italics
]
#:
With that out of the way, lets start defining custom elements for the manual.
#-section[title='Custom Markup']:
#=haskell:
bold <- rule @InlineTag @Manual @H.Html "boldface" $ do
body <- descend inline $ content . L.folded
pure $ H.strong body
italics <- rule @InlineTag @Manual @H.Html "italics" $ do
body <- descend inline $ content . L.folded
pure $ H.em body
#:
#=haskell:
section <- rule @BlockTag @Manual @H.Html "section" $ do
sTitle <- reqText [keyQ|title|]
"The title of the section."
sSlug <- optText [keyQ|slug|]
"The anchor tag associated with the section.\
\ If not provided, one will be generated based on the title.\
\ Generally, providing a slug is better as it allows the section's\
\ name to be changed without breaking permalinks."
hTag <- embed headerTag
body <- descend (contextualize nestSection block) $
content . L.folded
pure $ do
let title = H.text sTitle
H.section $ do
H.h1 title
#:
#:
Finally, we wrap up all of the rules we previously defined into a final rule which processes the whole #lit{Document}:
#=haskell:
rule "manual page" $ do
title <- reqText [keyQ|title|] "The manual page's title."
body <- descend (block :: Item Block Manual H.Html) $
content . L.folded
pure $ do
let htmlTitle = H.text title
H.html $ do
H.head $ do
H.meta ! A.charset "UTF-8"
H.title htmlTitle
H.body $ do
H.header $ do
H.h1 htmlTitle
H.main body
#:
#=haskell:
compileDocument :: Document -> Either ManualError H.Html
compileDocument doc =
runManual (compileM document doc) >>= first CompileError
tagged :: Key -> L.Prism' (Tagged a) (Tagged a)
tagged name = L.prism' id (\t -> if L.has (tag . L.only name) t
then Just t
else Nothing)
reqAuto
:: (Typeable output, Read output, HasMetadata input, Monad context)
=> Key -> Text -> Desc input context output
reqAuto = req $ \inputText ->
let
input = Text.unpack inputText
annotate msg = msg <> "(input: " <> show inputText <> ")"
in
first annotate $ readEither input
reqText :: (HasMetadata input, Monad context) => Key -> Text -> Desc input context Text
reqText = req Right
optText :: (HasMetadata input, Monad context) => Key -> Text -> Desc input context (Maybe Text)
optText = opt Right
#:

117
src/prosidy-manual/Prosidy/Manual/Monad.hs

@ -0,0 +1,117 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE DataKinds #-}
module Prosidy.Manual.Monad
( Manual
, ManualError(..)
, runManual
, nestSection
, recordTerm
, headerTag
)
where
import Control.Applicative ( liftA2 )
import Control.Lens hiding ( setting )
import Control.Monad.Reader ( ReaderT(..)
, runReaderT
, asks
)
import Control.Monad.State.Strict ( StateT(..)
, runStateT
)
import Data.HashSet ( HashSet )
import Data.Text ( Text )
import GHC.Generics ( Generic )
import Data.Generics.Product ( field )
import Numeric.Natural ( Natural )
import Control.Monad.Fix ( MonadFix )
import Data.Functor.Identity ( Identity(..) )
import Prosidy.Compile ( Error )
import qualified Text.Blaze.Html5 as H
import qualified Data.Char as Char
import qualified Data.Text as Text
import qualified Data.HashSet as HashSet
newtype Manual a = Manual (ManualRead -> ManualState -> Either ManualError (a, ManualState))
deriving (Functor, Applicative, Monad, MonadFix)
via (ReaderT ManualRead (StateT ManualState (Either ManualError)))
instance Semigroup a => Semigroup (Manual a) where
(<>) = liftA2 (<>)
instance Monoid a => Monoid (Manual a) where
mempty = pure mempty
data ManualRead = ManualRead
{ sectionDepth :: Natural
}
deriving (Eq, Generic, Show)
data ManualState = ManualState
{ definedTerms :: HashSet Text
, referencedTerms :: HashSet Text
}
deriving (Eq, Generic, Show)
data ManualError =
CompileError Error
| TooDeep
| UndefinedTerms (HashSet Text)
deriving (Eq, Show)
manualM
:: ReaderT ManualRead (StateT ManualState (Either ManualError)) a
-> Manual a
manualM m = Manual $ runStateT . runReaderT m
headerTag :: Manual (H.Html -> H.Html)
headerTag = manualM $ do
depth <- asks sectionDepth
case depth of
0 -> pure H.h2
1 -> pure H.h3
2 -> pure H.h4
3 -> pure H.h5
4 -> pure H.h6
_ -> ReaderT . const $ StateT . const $ Left TooDeep
nestSection :: Manual a -> Manual a
nestSection (Manual m) = Manual $ \r -> m $ over (field @"sectionDepth") succ r
runManual :: Manual a -> Either ManualError a
runManual (Manual m) = do
(output, state) <- m (ManualRead 0) (ManualState mempty mempty)
let undefinedTerms =
referencedTerms state `HashSet.difference` definedTerms state
if null undefinedTerms
then Right output
else Left $ UndefinedTerms undefinedTerms
-- | Record the use of a glossary term. Returns a sanitized identifier.
recordTerm
:: Bool -- ^ Is this term the definition site that should be referenced by other occurances of the term?
-> Text -- ^ This is the term text itself.
-> Manual Text
recordTerm isDef term = manualM $ do
selector . contains identifier .= True
pure identifier
where
identifier = toIdentifier term
selector | isDef = field @"definedTerms"
| otherwise = field @"referencedTerms"
-- | Convert text into an html-friendly identifier by replacing all
-- non-alphanumeric characters with hyphens and lower-casing the string. This
-- is less-permissive than HTML5's spec, but makes things a bit more readable.
toIdentifier :: Text -> Text
toIdentifier =
Text.intercalate "-"
. filter (not . Text.null)
. Text.split (not . Char.isAlphaNum)
. Text.toLower

44
src/prosidy-manual/prosidy-manual.cabal

@ -0,0 +1,44 @@
name: prosidy-manual
synopsis: A Prosidy dialect for Prosidy's own manual
author: James Alexander Feldman-Crough
maintainer: alex@fldcr.com
copyright: Copyright 2020 to James Alexander Feldman-Crough
category: Language
version: 0.1.0.0
cabal-version: >=1.10
license: MPL-2.0
license-file: LICENSE
build-type: Simple
executable prosidy-manual
hs-source-dirs: .
default-language: Haskell2010
ghc-options: -pgmL propp
main-is: Main.hs
other-modules: Prosidy.Manual
, Prosidy.Manual.Monad
build-tool-depends: propp:propp
build-depends: base >= 4.7 && < 5
, prosidy
, prosidyc
, hakyll-contrib-prosidy
, hakyll
, mtl
, text
, lens
, blaze-markup
, blaze-html
, unordered-containers
, containers
, generic-lens
, directory
, filepath
, bytestring

230
src/prosidy-markup/Main.hs

@ -0,0 +1,230 @@
{-# LANGUAGE ApplicativeDo #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecursiveDo #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
module Main (main) where
import Prosidy
import Prosidy.Compile
import Options.Applicative
import Data.Text (Text)
import Control.Exception (throwIO, bracket)
import Text.Blaze.Html.Renderer.Text (renderHtml)
import Data.Text.Lazy (toStrict)
import Text.Blaze.Html5 ((!))
import qualified Text.Blaze.Internal as Blaze
import qualified System.IO as IO
import qualified Data.Text.IO as Text.IO
import qualified Control.Lens as L
import qualified Text.Blaze.Html5 as H
import qualified Text.Blaze.Html5.Attributes as A
main :: IO ()
main = do
opts@Opts{..} <- getOpts
input <- withFile' IO.stdin inputFile IO.ReadMode Text.IO.hGetContents
document <- either throwIO pure $ parseDocument (maybe "<stdin>" id inputFile) input
html <- either (fail . show) (pure . toStrict . renderHtml) $
compile (compiler standalone breakUsing) document
withFile' IO.stdout outputFile IO.WriteMode (`Text.IO.hPutStrLn` html)
withFile' :: IO.Handle -> Maybe FilePath -> IO.IOMode -> (IO.Handle -> IO a) -> IO a
withFile' hdl path mode = bracket
(maybe (pure hdl) (`IO.openFile` mode) path)
IO.hClose
compiler :: Bool -> Text -> Rule Document H.Html
compiler standalone space = mdo
break <- rule "break" $
pure $
H.text space
text <- rule "plain text" $ do
body <- self
pure $ H.text body
literalText <- rule "literal text" $ do
body <- descend text _Literal
pure $ H.code body
block <- choose "block context"
[ _BlockTag @? blockTag
, _BlockLiteral @? codeBlock
, _BlockParagraph @? paragraph
]
inline <- choose "inline context"
[ _Break @? break
, _InlineTag @? inlineTag
, _InlineText @? text
]
blockTag <- choose "block tag"
[ _Tagged [keyQ|h|] @? heading
, _Tagged [keyQ|h+|] @? subheading
, _Tagged [keyQ|h++|] @? subsubheading
, _Tagged [keyQ|list|] @? list
, _Tagged [keyQ|section|] @? section
, _Tagged [keyQ|quote|] @? quote
, _Tagged [keyQ|image|] @? blockImage
]
finalBlock <- choose "final block tag"
[ _BlockParagraph @? paragraph
]
inlineTag <- choose "inline tag"
[ _Tagged [keyQ|b|] @? bold
, _Tagged [keyQ|i|] @? italic
, _Tagged [keyQ|image|] @? image
, _Tagged [keyQ|link|] @? link
, _Tagged [keyQ|lit|] @? lit
]
codeBlock <- rule "codeBlock" $ do
body <- descend literalText content
pure $ H.pre body
paragraph <- rule "paragraph" $ do
body <- descend inline (_Paragraph . L.folded)
pure $ H.p body
heading <- rule "heading" $ do
body <- descend finalBlock (content . L.folded)
pure $ H.h2 body
subheading <- rule "subheading" $ do
body <- descend finalBlock (content . L.folded)
pure $ H.h3 body
subsubheading <- rule "subsubheading" $ do
body <- descend finalBlock (content . L.folded)
pure $ H.h4 body
image <- rule "image" $ do
url <- req Right [keyQ|url|] "The URL of the image to embed."
title <- opt Right [keyQ|title|] "The title/alt-text of the image."
pure $ do
H.img ! A.src (H.toValue url)
! foldMap (A.title . H.toValue) title
blockImage <- rule "blockImage" $ do
url <- req Right [keyQ|url|] "The URL of the image to embed."
title <- opt Right [keyQ|title|] "The title/alt-text of the image."
body <- descend finalBlock $ content . L.folded
pure $ do
H.figure $ do
H.img ! A.src (H.toValue url)
! foldMap (A.title . H.toValue) title
H.figcaption body
bold <- rule "bold" $ do
body <- descend inline (content . L.folded)
pure $ H.strong body
italic <- rule "italic" $ do
body <- descend inline (content . L.folded)
pure $ H.em body
link <- rule "link" $ do
url <- req Right [keyQ|url|] "The URL to link to."
body <- descend inline $ content . L.folded
pure $ H.a body ! A.href (H.toValue url)
lit <- rule "literal" $ do
body <- descend inline $ content . L.folded
pure $ H.code body
listItem <- choose "list item"
[ _BlockTag . _Tagged [keyQ|item|] @? listBody ]
listBody <- rule "list body" $ do
body <- descend block (content . L.folded)
pure $ H.li body
list <- rule "list" $ do
isOrdered <- prop [keyQ|ord|] "If provided, treat the list as a ordered-list."
body <- descend listItem (content . L.folded)
pure $ do
(if isOrdered then H.ol else H.ul) body
quote <- rule "quote" $ do
body <- descend block (content . L.folded)
pure $ H.blockquote body
section <- rule "section" $ do
class_ <- opt Right [keyQ|class|] "Optional classes to be attached."
body <- descend block (content . L.folded)
pure $ H.section body ! foldMap (A.class_ . H.toValue) class_
rule "document" $ do
title <- req Right [keyQ|title|] "The document's title, used as the header."
style <- if standalone
then opt Right [keyQ|style|] "A stylesheet to attach to the document"
else pure Nothing
body <- descend block (content . L.folded)
pure $ do
let titleHtml = H.text title
if standalone
then
H.html $ do
H.head $ do
H.title titleHtml
foldMap (\s -> H.link ! A.rel "stylesheet"
! A.type_ "text/css"
! A.href (H.toValue s)) style
H.body $ do
H.header $ H.h1 titleHtml
H.main body
else do
H.h1 titleHtml
body
data Opts = Opts
{ breakUsing :: Text
, inputFile :: Maybe FilePath
, outputFile :: Maybe FilePath
, standalone :: Bool
}
deriving Show
getOpts = execParser $ info optParse optInfo
where
optParse = do
breakUsing <- strOption $ mconcat
[ help
"Replace newlines and white-space on either side of tags\
\ with this sequence."
, long "break", short 'b'
, metavar "STR"
, value " "
, showDefault
]
inputFile <- optional . strOption $ mconcat
[ help
"Read a Prosidy Markup document from this filepath.\
\ If not provided, standard-input will be used."
, long "in", short 'i'
, metavar "FILEPATH"
]
outputFile <- optional . strOption $ mconcat
[ help
"Write the output HTML to this filepath.\
\ If not provided, standard-output will be used."
, long "out", short 'o'
, metavar "FILEPATH"
]
standalone <- switch $ mconcat
[ help "When provided, generate the full HTML document."
, long "standalone", short 's'
]
pure Opts{..}
optInfo = mconcat
[
]

25
src/prosidy-markup/prosidy-markup.cabal

@ -0,0 +1,25 @@
name: prosidy-markup
synopsis: A minimal Prosidy dialect meant for Markdown-style uses.
author: James Alexander Feldman-Crough
maintainer: alex@fldcr.com
copyright: Copyright 2020 to James Alexander Feldman-Crough
category: Language
cabal-version: >=1.10
license: MPL-2.0
license-file: LICENSE
build-type: Simple
version: 0.1.0.0
executable prosidy-markup
hs-source-dirs: .
default-language: Haskell2010
ghc-options: -pgmL propp
main-is: Main.hs
build-depends: base >= 4.7 && < 5
, prosidy
, prosidyc
, blaze-html
, blaze-markup
, text
, lens
, optparse-applicative

225
src/prosidy-markup/syntax-guide.pro

@ -0,0 +1,225 @@
title: Syntax Guide
style: style.css
---
#-section:endsection
#-h{Headers}
#=prosidy:
#-h{This will be rendered as an h2 tag.}
#-h+{This will be rendered as an h3 tag.}
#-h++{This will be rendered as an h4 tag.}
#:
#-section[class='out']:
#-h{This will be rendered as an h2 tag.}
#-h+{This will be rendered as an h3 tag.}
#-h++{This will be rendered as an h4 tag.}
#:
#:endsection
#-section:endsection
#-h{Emphasis}
#=prosidy:
#i{This text will be italic,} #b{and this text will be bold.}
You #i{#b{can}} combine them if you like.
#: