Code Monkey home page Code Monkey logo

yesod-markdown's Issues

Relax dependency boundaries on yesod-core and yesod-form

Hello there,

I am currently using your library in my project eidolon, but when building it normally, I run into dependency hell. I averted it by removing the upper boundaries of the dependencies for yesod-core and yesod-form. Can you please consider relaxing your upper boundaries?

[Suggestion] markdownToHtmlWithExt

For now, it's time consuming to define custom extensions with markdownToHtml. For instance:

markdownToHtml :: Markdown -> Either PandocError Html
markdownToHtml md = do
  let
    readOp = yesodDefaultReaderOptions { readerExtensions = extensionsFromList yesodDefaultExtensions }
    writeOp = yesodDefaultWriterOptions { writerExtensions = extensionsFromList yesodDefaultExtensions }
  p <- parseMarkdown readOp md
  writePandoc writeOp p

yesodDefaultExtensions :: [Extension]
yesodDefaultExtensions =
    [ Ext_raw_html
    , Ext_auto_identifiers
    , Ext_pipe_tables
    ]

How about creating markdownToHtmlWithExt :: [Extension] -> Markdown -> Either PandocError Html? With this function, we can choose which extensions to use and render markdown with them. The original markdownToHtml can be re-written as follows:

markdownToHtml :: Markdown -> Either PandocError Html
markdownToHtml  = markdownToHtmlWithExt yesodDefaultExtensions

Release version that supports GHC 8.4

A missing Semigroup instance makes the version on hackage not build with GHC 8.4+. A new release would be nice. It may also be worthwhile to retroactively add an upper bound on base to the most recent hackage releases.

yesod-markdown-0.8.4 causes compilation error with ghc-7.8.2

ghc-7.8.x has new GND+role inference.
Here is new GND+role in detail.
It seems to be new GND+role inference causes compilation error.

Compilation log with ghc-7.8.2 is as follows:

% cabal build
Building yesod-markdown-0.8.4...
Preprocessing library yesod-markdown-0.8.4...
[1 of 1] Compiling Yesod.Markdown   ( Yesod/Markdown.hs, dist/build/Yesod/Markdown.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package bytestring-0.10.4.0 ... linking ... done.
Loading package containers-0.5.5.1 ... linking ... done.
Loading package text-1.1.0.1 ... linking ... done.
Loading package hashable-1.2.1.0 ... linking ... done.
Loading package scientific-0.2.0.2 ... linking ... done.
Loading package attoparsec-0.11.2.1 ... linking ... done.
Loading package dlist-0.7.0.1 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.3.1 ... linking ... done.
Loading package old-locale-1.0.0.6 ... linking ... done.
Loading package syb-0.4.1 ... linking ... done.
Loading package pretty-1.1.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package time-1.4.2 ... linking ... done.
Loading package unordered-containers-0.2.4.0 ... linking ... done.
Loading package primitive-0.5.2.1 ... linking ... done.
Loading package vector-0.10.9.1 ... linking ... done.
Loading package aeson-0.7.0.3 ... linking ... done.
Loading package blaze-builder-0.3.3.2 ... linking ... done.
Loading package blaze-markup-0.6.0.0 ... linking ... done.
Loading package blaze-html-0.7.0.1 ... linking ... done.
Loading package byteable-0.1.1 ... linking ... done.
Loading package data-default-class-0.0.1 ... linking ... done.
Loading package data-default-instances-base-0.0.1 ... linking ... done.
Loading package data-default-instances-containers-0.0.1 ... linking ... done.
Loading package data-default-instances-dlist-0.0.1 ... linking ... done.
Loading package data-default-instances-old-locale-0.0.1 ... linking ... done.
Loading package data-default-0.5.3 ... linking ... done.
Loading package email-validate-2.0.1 ... linking ... done.
Loading package failure-0.2.0.2 ... linking ... done.
Loading package parsec-3.1.5 ... linking ... done.
Loading package filepath-1.3.0.2 ... linking ... done.
Loading package unix-2.7.0.1 ... linking ... done.
Loading package directory-1.2.1.0 ... linking ... done.
Loading package process-1.2.0.0 ... linking ... done.
Loading package system-filepath-0.4.10 ... linking ... done.
Loading package system-fileio-0.3.12 ... linking ... done.
Loading package shakespeare-1.2.1.1 ... linking ... done.
Loading package hamlet-1.1.9.2 ... linking ... done.
Loading package network-2.4.2.2 ... linking ... done.
Loading package base64-bytestring-1.0.0.1 ... linking ... done.
Loading package exceptions-0.5 ... linking ... done.
Loading package base-unicode-symbols-0.2.2.4 ... linking ... done.
Loading package transformers-base-0.4.1 ... linking ... done.
Loading package monad-control-0.3.2.3 ... linking ... done.
Loading package lifted-base-0.2.2.1 ... linking ... done.
Loading package mmorph-1.0.2 ... linking ... done.
Loading package resourcet-1.1.1 ... linking ... done.
Loading package text-stream-decode-0.1.0.5 ... linking ... done.
Loading package nats-0.1.2 ... linking ... done.
Loading package semigroups-0.13.0.1 ... linking ... done.
Loading package void-0.6.1 ... linking ... done.
Loading package conduit-1.1.0 ... linking ... done.
Loading package zlib-0.5.4.1 ... linking ... done.
Loading package streaming-commons-0.1.1 ... linking ... done.
Loading package conduit-extra-1.1.0 ... linking ... done.
Loading package fast-logger-2.1.5 ... linking ... done.
Loading package monad-loops-0.4.2 ... linking ... done.
Loading package stm-2.4.3 ... linking ... done.
Loading package stm-chans-3.0.0.2 ... linking ... done.
Loading package monad-logger-0.3.6 ... linking ... done.
Loading package path-pieces-0.1.3.1 ... linking ... done.
Loading package resource-pool-0.2.1.1 ... linking ... done.
Loading package silently-1.2.4.1 ... linking ... done.
Loading package persistent-1.3.0.6 ... linking ... done.
Loading package shakespeare-css-1.0.7.4 ... linking ... done.
Loading package shakespeare-js-1.2.0.4 ... linking ... done.
Loading package case-insensitive-1.2.0.0 ... linking ... done.
Loading package http-types-0.8.4 ... linking ... done.
Loading package vault-0.3.0.3 ... linking ... done.
Loading package wai-2.1.0.2 ... linking ... done.
Loading package css-text-0.1.2.1 ... linking ... done.
Loading package tagsoup-0.13.1 ... linking ... done.
Loading package utf8-string-0.3.7 ... linking ... done.
Loading package xss-sanitize-0.3.5.2 ... linking ... done.
Loading package attoparsec-conduit-1.1.0 ... linking ... done.
Loading package cereal-0.4.0.1 ... linking ... done.
Loading package securemem-0.1.3 ... linking ... done.
Loading package crypto-cipher-types-0.0.9 ... linking ... done.
Loading package cipher-aes-0.2.7 ... linking ... done.
Loading package crypto-random-0.0.7 ... linking ... done.
Loading package random-1.0.1.1 ... linking ... done.
Loading package cprng-aes-0.5.2 ... linking ... done.
Loading package entropy-0.2.2.4 ... linking ... done.
Loading package tagged-0.7.1 ... linking ... done.
Loading package crypto-api-0.13 ... linking ... done.
Loading package skein-1.0.9 ... linking ... done.
Loading package clientsession-0.9.0.3 ... linking ... done.
Loading package cookie-0.4.0.1 ... linking ... done.
Loading package safe-0.3.4 ... linking ... done.
Loading package shakespeare-i18n-1.0.0.5 ... linking ... done.
Loading package unix-compat-0.4.1.1 ... linking ... done.
Loading package ansi-terminal-0.6.1.1 ... linking ... done.
Loading package blaze-builder-conduit-1.1.0 ... linking ... done.
Loading package stringsearch-0.3.6.5 ... linking ... done.
Loading package byteorder-1.0.4 ... linking ... done.
Loading package old-time-1.1.0.2 ... linking ... done.
Loading package unix-time-0.2.2 ... linking ... done.
Loading package wai-logger-2.1.1 ... linking ... done.
Loading package word8-0.0.4 ... linking ... done.
Loading package zlib-conduit-1.1.0 ... linking ... done.
Loading package wai-extra-2.1.1.1 ... linking ... done.
Loading package http-date-0.0.4 ... linking ... done.
Loading package network-conduit-1.1.0 ... linking ... done.
Loading package simple-sendfile-0.2.13 ... linking ... done.
Loading package warp-2.1.4 ... linking ... done.
Loading package yesod-routes-1.2.0.6 ... linking ... done.
Loading package yesod-core-1.2.12 ... linking ... done.
Loading package persistent-template-1.3.1.3 ... linking ... done.
Loading package yesod-persistent-1.2.2.3 ... linking ... done.
Loading package yesod-form-1.3.8.2 ... linking ... done.
Loading package HTTP-4000.2.12 ... linking ... done.
Loading package binary-0.7.1.0 ... linking ... done.
Loading package extensible-exceptions-0.1.1.4 ... linking ... done.
Loading package regex-base-0.93.2 ... linking ... done.
Loading package regex-pcre-builtin-0.94.4.8.8.34 ... linking ... done.
Loading package highlighting-kate-0.5.6.1 ... linking ... done.
Loading package hslua-0.3.10 ... linking ... done.
Loading package pandoc-types-1.12.3.2 ... linking ... done.
Loading package temporary-1.2.0.2 ... linking ... done.
Loading package xml-1.3.13 ... linking ... done.
Loading package texmath-0.6.6.1 ... linking ... done.
Loading package yaml-0.8.8.1 ... linking ... done.
Loading package digest-0.0.1.2 ... linking ... done.
Loading package zip-archive-0.2.2 ... linking ... done.
Loading package pandoc-1.12.3.3 ... linking ... done.

Yesod/Markdown.hs:59:50:
    Could not coerce from ‘m Text’ to ‘m Markdown’
      because ‘m Text’ and ‘m Markdown’ are different types.
      arising from the coercion of the method
                   ‘persistent-1.3.0.6:Database.Persist.Sql.Class.sqlType’ from type
                   ‘forall (m :: * -> *).
                    Monad m =>
                    m Text -> persistent-1.3.0.6:Database.Persist.Types.Base.SqlType’
                   to type
                   ‘forall (m :: * -> *).
                    Monad m =>
                    m Markdown
                    -> persistent-1.3.0.6:Database.Persist.Types.Base.SqlType’
    Possible fix:
      use a standalone 'deriving instance' declaration,
        so you can specify the instance context yourself
    When deriving the instance for (PersistFieldSql Markdown)

convert markdown data (from DB) to html

Hi,
I'll already save my markdown data on my DB (PostGreSQL).
now once i retrieve it, i want my markdown to converted first to HTML before to render in my hamlet.

hope you help me, thank you.

Allow persistent 2.11

I need persistent 2.11 to get a bugfix for a persistent-template regression. At present yesod-markdown has persistent >= 0.9 && <2.11.

update to work with pandoc 1.16

So, with Stackage LTS-5 and the pandoc update otherwise, it would be nice for yesod-markdown to support/allow pandoc 1.16. This is a breaking issue for those of us wanting to move to LTS-5 otherwise.

Incidentally, it would also be nice to get yesod-markdown into Stackage.

testsuite failed in the Stackage Nightly build

Test suite failure for package yesod-markdown-0.12.6.12                                                                            
    test:  exited with: ExitFailure 1                            
Full log available at /var/stackage/work/unpack-dir/.stack-work/logs/yesod-markdown-0.12.6.12-test.log                             
                                                                 

     
    Yesod.Markdown
      converts Markdown to sanitized HTML FAILED [1]
      converts Markdown to unsanitized HTML FAILED [2]
     
    Failures:
     
      test/Spec.hs:42:18: 
      1) Yesod.Markdown converts Markdown to sanitized HTML
           predicate failed on: "<h1 id=\"title\">Title</h1>\n<ul>\n<li>one</li>\n<li>two</li>\n<li>three</li>\n</ul>\n"
     
      To rerun use: --match "/Yesod.Markdown/converts Markdown to sanitized HTML/"
     
      test/Spec.hs:61:25: 
      2) Yesod.Markdown converts Markdown to unsanitized HTML
           expected: "<h1 id=\"title\">Title</h1><ul><li>one</li><li>two</li><li>three</li></ul><script>\n  alert('xxs');\n</script
>"
            but got: "<h1 id=\"title\">Title</h1>\n<ul>\n<li>one</li>\n<li>two</li>\n<li>three</li>\n</ul>\n<script>\n  alert('xxs'
);\n</script>"
     
      To rerun use: --match "/Yesod.Markdown/converts Markdown to unsanitized HTML/"
     
    Randomized with seed 1708079621
     
    Finished in 0.0089 seconds
    2 examples, 2 failures

Relax blaze-html upper bound

I have this package as build dependency in my project. Yesterday I switched to GHC 7.8.4 and cabal-1.22, Stackage LTS 2.1. Now, when I try to install yesod-markdown cabal tries install version 0.2.1, because of blaze-html < 0.8 constraint: LTS 2.1 Stackage snapshot have blaze-html ==0.8.0.2 constraint, thus cabal could pick version 0.2.1, since it is highest version which have no blaze-html dependency at all. All next versions are rejected. But this version is too old, and unsurprisingly fails to install:

Preprocessing library yesod-markdown-0.2.1...

Yesod/Markdown.hs:21:8:
    Could not find module ‘Yesod.Form.Core’
    Perhaps you meant
      Yesod.Form.Types (needs flag -package yesod-form-1.4.4.1)
      Yesod.Form.Nic (needs flag -package yesod-form-1.4.4.1)
    Use -v to see a list of the files searched for.

Relaxing upper bound of blaze-html to < 0.9 makes package buildable, however I still can't install it, the error message is quite confusing to me:

> cabal install
Resolving dependencies...
Configuring yesod-markdown-0.9.3.1...
Building yesod-markdown-0.9.3.1...
Failed to install yesod-markdown-0.9.3.1
Build log ( /Users/arthurfayzrakhmanov/.cabal/logs/yesod-markdown-0.9.3.1.log ):
Configuring yesod-markdown-0.9.3.1...
Building yesod-markdown-0.9.3.1...
setup-Simple-Cabal-1.18.1.5-x86_64-osx-ghc-7.8.4: dist/package.conf.inplace:
inappropriate type
cabal: Error: some packages failed to install:
yesod-markdown-0.9.3.1 failed during the building phase. The exception was:
ExitFailure 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.