mirror of
https://github.com/github/semantic.git
synced 2024-11-27 12:57:49 +03:00
Rename markup to markdown
This commit is contained in:
parent
4361d05715
commit
5f482fbb4f
@ -52,7 +52,7 @@ import Syntax as S
|
||||
import Data.Syntax.Algebra (RAlgebra)
|
||||
import qualified Data.Syntax as Syntax
|
||||
import qualified Data.Syntax.Declaration as Declaration
|
||||
import qualified Language.Markdown.Syntax as Markup
|
||||
import qualified Language.Markdown.Syntax as Markdown
|
||||
|
||||
data Summaries = Summaries { changes, errors :: !(Map.Map T.Text [Value]) }
|
||||
deriving (Eq, Show)
|
||||
@ -130,9 +130,9 @@ class CustomHasDeclaration syntax where
|
||||
customToDeclaration :: (Foldable whole, HasField fields Range, HasField fields Span) => Blob -> Record fields -> RAlgebra syntax (Term whole (Record fields)) (Maybe Declaration)
|
||||
|
||||
|
||||
-- | Produce a 'SectionDeclaration' from the first line of the heading of a 'Markup.Section' node.
|
||||
instance CustomHasDeclaration Markup.Section where
|
||||
customToDeclaration Blob{..} _ (Markup.Section level (Term (In headingAnn headingF), _) _)
|
||||
-- | Produce a 'SectionDeclaration' from the first line of the heading of a 'Markdown.Section' node.
|
||||
instance CustomHasDeclaration Markdown.Section where
|
||||
customToDeclaration Blob{..} _ (Markdown.Section level (Term (In headingAnn headingF), _) _)
|
||||
= Just $ SectionDeclaration (maybe (getSource (byteRange headingAnn)) (getSource . sconcat) (nonEmpty (byteRange . termAnnotation . unTerm <$> toList headingF))) level
|
||||
where getSource = firstLine . toText . flip Source.slice blobSource
|
||||
firstLine = T.takeWhile (/= '\n')
|
||||
@ -185,7 +185,7 @@ class HasDeclarationWithStrategy (strategy :: Strategy) syntax where
|
||||
type family DeclarationStrategy syntax where
|
||||
DeclarationStrategy Declaration.Function = 'Custom
|
||||
DeclarationStrategy Declaration.Method = 'Custom
|
||||
DeclarationStrategy Markup.Section = 'Custom
|
||||
DeclarationStrategy Markdown.Section = 'Custom
|
||||
DeclarationStrategy Syntax.Error = 'Custom
|
||||
DeclarationStrategy (Union fs) = 'Custom
|
||||
DeclarationStrategy a = 'Default
|
||||
|
Loading…
Reference in New Issue
Block a user