diff --git a/code/Language/Drasil/Classes.hs b/code/Language/Drasil/Classes.hs index 906f4624b4..74031c5097 100644 --- a/code/Language/Drasil/Classes.hs +++ b/code/Language/Drasil/Classes.hs @@ -28,7 +28,6 @@ import Language.Drasil.Chunk.Attribute.Core (Attributes) import Language.Drasil.Chunk.Constrained.Core (Constraint) import Language.Drasil.Expr (Expr) - import Control.Lens (Lens') type UID = String diff --git a/code/Language/Drasil/Printing/Import.hs b/code/Language/Drasil/Printing/Import.hs index bb9af47f5c..7dc0d6e351 100644 --- a/code/Language/Drasil/Printing/Import.hs +++ b/code/Language/Drasil/Printing/Import.hs @@ -30,7 +30,7 @@ import Language.Drasil.Unicode (Special(Partial)) import Language.Drasil.Spec (Sentence(..)) import Language.Drasil.Misc (unit'2Contents) import Language.Drasil.NounPhrase (phrase, titleize) -import Language.Drasil.Reference +import Language.Drasil.Chunk.Attribute.ShortName import Language.Drasil.Document @@ -262,7 +262,7 @@ createLayout sm = map (sec sm 0) -- | Helper function for creating sections at the appropriate depth sec :: HasSymbolTable ctx => ctx -> Int -> Section -> T.LayoutObj sec sm depth x@(Section title contents _) = - let ref = P.S (refAdd x) in + let ref = P.S (shortname x) in T.HDiv [(concat $ replicate depth "sub") ++ "section"] (T.Header depth (spec sm title) ref : map (layout sm depth) contents) ref @@ -274,22 +274,22 @@ getSN c = maybe (error "missing attribute ShortName") id $ getShortName c -- Called internally by layout. lay :: HasSymbolTable ctx => ctx -> Contents -> T.LayoutObj lay sm x@(Table hdr lls t b _) = T.Table ["table"] - ((map (spec sm) hdr) : (map (map (spec sm)) lls)) (P.S (refAdd x)) b (spec sm t) + ((map (spec sm) hdr) : (map (map (spec sm)) lls)) (P.S (shortname x)) b (spec sm t) lay sm (Paragraph c) = T.Paragraph (spec sm c) lay sm (EqnBlock c _) = T.HDiv ["equation"] [T.EqnBlock (P.E (expr c sm))] P.EmptyS -- FIXME: Make equations referable -lay sm x@(Definition c) = T.Definition c (makePairs sm c) (P.S (refAdd x)) +lay sm x@(Definition c) = T.Definition c (makePairs sm c) (P.S (shortname x)) lay sm (Enumeration cs) = T.List $ makeL sm cs -lay sm x@(Figure c f wp _) = T.Figure (P.S (refAdd x)) (spec sm c) f wp +lay sm x@(Figure c f wp _) = T.Figure (P.S (shortname x)) (spec sm c) f wp lay sm x@(Requirement r) = T.ALUR T.Requirement - (spec sm $ requires r) (P.S $ refAdd x) (spec sm $ getSN r) + (spec sm $ requires r) (P.S $ shortname x) (spec sm $ getSN r) lay sm x@(Assumption a) = T.ALUR T.Assumption - (spec sm (assuming a)) (P.S (refAdd x)) (spec sm $ getSN a) + (spec sm (assuming a)) (P.S (shortname x)) (spec sm $ getSN a) lay sm x@(Change lc) = T.ALUR (if (chngType lc) == Likely then T.LikelyChange else T.UnlikelyChange) - (spec sm (chng lc)) (P.S (refAdd x)) (spec sm $ getSN lc) + (spec sm (chng lc)) (P.S (shortname x)) (spec sm $ getSN lc) lay sm x@(Graph ps w h t _) = T.Graph (map (\(y,z) -> (spec sm y, spec sm z)) ps) - w h (spec sm t) (P.S (refAdd x)) + w h (spec sm t) (P.S (shortname x)) lay sm (Defnt dtyp pairs rn) = T.Definition dtyp (layPairs pairs) (P.S rn) where layPairs = map (\(x,y) -> (x, map (lay sm) y)) lay sm (Bib bib) = T.Bib $ map (layCite sm) bib diff --git a/code/drasil.cabal b/code/drasil.cabal index 0da8185c89..cda565df8f 100644 --- a/code/drasil.cabal +++ b/code/drasil.cabal @@ -85,6 +85,7 @@ library , Language.Drasil.Chunk.Attribute , Language.Drasil.Chunk.Attribute.Core , Language.Drasil.Chunk.Attribute.Derivation + , Language.Drasil.Chunk.Attribute.ShortName , Language.Drasil.Chunk.Change , Language.Drasil.Chunk.Citation , Language.Drasil.Chunk.Code