Skip to content

Commit

Permalink
Merge pull request #2696 from JacquesCarette/fixingWebsite3
Browse files Browse the repository at this point in the history
Website fix
  • Loading branch information
JacquesCarette authored Jul 19, 2021
2 parents 62810b9 + 9784610 commit fb9d573
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/Test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ jobs:
run: make analysis
- name: "Graphs"
run: make graphs
- name: "Website"
run: make website
4 changes: 3 additions & 1 deletion code/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ BC_EXAMPLES = $(addsuffix $(BC_E_SUFFIX), $(EXAMPLES))

EXAMPLE_GEN_TARGET = GEN TEST TEX CODE DCP

GENNED_FOLDERS = $(ANALYSIS_FOLDER_NAME) $(BUILD_FOLDER_NAME) $(DEPLOY_FOLDER_NAME) $(DOCS_FOLDER_NAME) $(GRAPH_FOLDER_NAME) $(LOG_FOLDER_NAME) $(TRACEY_GRAPHS_FOLDER_NAME)
GENNED_FOLDERS = $(ANALYSIS_FOLDER_NAME) $(BUILD_FOLDER_NAME) $(DEPLOY_FOLDER_NAME) $(DOCS_FOLDER_NAME) $(GRAPH_FOLDER_NAME) $(LOG_FOLDER_NAME) $(TRACEY_GRAPHS_FOLDER_NAME) $(WEBSITE_FOLDER_PATH)
CLEAN_GF_PREFIX = clean_
CLEAN_FOLDERS = $(addprefix $(CLEAN_GF_PREFIX), $(GENNED_FOLDERS))

Expand Down Expand Up @@ -113,6 +113,8 @@ TRACEY_GRAPH_FOLDER = $(TRACEY_GRAPH_FOLDER_NAME)/
TRACEY_GRAPHS_FOLDER_NAME = traceygraphs
TRACEY_GRAPHS_FOLDER = $(TRACEY_GRAPHS_FOLDER_NAME)/
TRACEY_GRAPH_NAMES = allvsall allvsr avsa avsall refvsref
WEBSITE_FOLDER_NAME = Website
WEBSITE_FOLDER_PATH = drasil-website/$(WEBSITE_FOLDER_NAME)
# make command line options
# GHC debug options
PROFALL = --executable-profiling --library-profiling
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ traceyGraphPath :: String -> String -> String
traceGFiles = ["avsa", "avsall", "refvsref", "allvsr", "allvsall"]
traceGUIDs = ["TraceGraphAvsA", "TraceGraphAvsAll", "TraceGraphRefvsRef", "TraceGraphAllvsR", "TraceGraphAllvsAll"]
traceyGraphPaths ex = map (\x -> resourcePath ++ concat (words ex) ++ "/" ++ x ++ ".svg") traceGFiles
traceyGraphGetRefs ex = map makeFigRef traceGUIDs ++ zipWith (\x y -> Reference (x ++ "Link") (URI y) (shortname' $ S x) None) traceGUIDs (traceyGraphPaths $ concat $ words ex)
traceyGraphGetRefs ex = map makeFigRef traceGUIDs ++ zipWith (\x y -> Reference (x ++ "Link") (URI y) (shortname' $ S x)) traceGUIDs (traceyGraphPaths $ concat $ words ex)
-- for actual use in creating the graph figures
traceyGraphPath ex f = resourcePath ++ concat (words ex) ++ "/" ++ f ++ ".svg"

Expand Down
4 changes: 2 additions & 2 deletions code/drasil-website/Drasil/Website/Analysis.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ drasilDataTableTitle = S "Drasil Data Table"
dataTableDesc path = S "Here is the updated" +:+ namedRef (dataTableHTMLRef path) (S "Data Table") +:+ S "for the Drasil framework. There is also a" +:+ namedRef (dataTableCSVRef path) (S "downloadable version") +:+ S "(csv format)."
dataTableHTMLPath = "DataTable/DataTable.html"
dataTableCSVPath = "DataTable/DataTable.csv"
dataTableHTMLRef path = Reference "dataTableHTML" (URI (path ++ dataTableHTMLPath)) (shortname' $ S "dataTableHTML") None
dataTableCSVRef path = Reference "dataTableCSV" (URI (path ++ dataTableCSVPath)) (shortname' $ S "dataTableCSV") None
dataTableHTMLRef path = Reference "dataTableHTML" (URI (path ++ dataTableHTMLPath)) (shortname' $ S "dataTableHTML")
dataTableCSVRef path = Reference "dataTableCSV" (URI (path ++ dataTableCSVPath)) (shortname' $ S "dataTableCSV")

analysisSecRef :: Reference
analysisSecRef = makeSecRef "Analysis" $ S "Analysis"
Expand Down
6 changes: 3 additions & 3 deletions code/drasil-website/Drasil/Website/Body.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ printSetting fl = PI (symbMap fl) Equational defaultConfiguration
-- Instead of being an SRSDecl, this takes the folder locations and generates the document from there.
mkWebsite :: FolderLocation -> Document
mkWebsite fl =
--Document Title author (hack for now to show up in proper spot) [Section]
Document (S websiteTitle) (namedRef gitHubRef (S "Link to GitHub Repository")) $ sections fl
--Document -- Title -- author (hack for now to show up in proper spot) -- no table of contents -- [Section]
Document (S websiteTitle) (namedRef gitHubRef (S "Link to GitHub Repository")) NoToC $ sections fl

-- Folder locations based on environment variables (using getEnv on Main.hs)
data FolderLocation = Folder {
Expand Down Expand Up @@ -110,7 +110,7 @@ imageRef = makeFigRef "Drasil"

-- Used for the repository link.
gitHubRef :: Reference
gitHubRef = Reference "gitHubRepo" (URI gitHubInfoURL) (shortname' $ S "gitHubRepo") None
gitHubRef = Reference "gitHubRepo" (URI gitHubInfoURL) (shortname' $ S "gitHubRepo")

-- Hardcoded info for the title, URL, and image path.
websiteTitle :: String
Expand Down
4 changes: 2 additions & 2 deletions code/drasil-website/Drasil/Website/Documentation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ haddockDocsTitle = S "Haddock Documentation"
haddockDocsDesc path = S "The current" +:+ namedRef (docsRef path) (S "Haddock documentation") +:+ S "for the Drasil framework. A variant with" +:+ namedRef (fullDocsRef path) (S "fully exposed modules") +:+ S "is also available."
docsPath = "index.html"
fullDocsPath = "full/index.html"
docsRef path = Reference "haddockDocs" (URI (path ++ docsPath)) (shortname' $ S "HaddockDocs") None
fullDocsRef path = Reference "fullHaddockDocs" (URI (path ++ fullDocsPath)) (shortname' $ S "fullHaddockDocs") None
docsRef path = Reference "haddockDocs" (URI (path ++ docsPath)) (shortname' $ S "HaddockDocs")
fullDocsRef path = Reference "fullHaddockDocs" (URI (path ++ fullDocsPath)) (shortname' $ S "fullHaddockDocs")

docsSecRef :: Reference
docsSecRef = makeSecRef "Documentation" $ S "Documentation"
Expand Down
8 changes: 4 additions & 4 deletions code/drasil-website/Drasil/Website/Example.hs
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,21 @@ projectileCase5Dox = ["cpp", "csharp", "java", "python"]

-- Make references for each of the generated SRS files
getHTMLRef, getPDFRef :: FilePath -> String -> Reference
getHTMLRef path ex = Reference ("htmlRef" ++ ex) (URI (getHTMLPath path ex)) (shortname' $ S ("htmlRef" ++ ex)) None
getPDFRef path ex = Reference ("pdfRef" ++ ex) (URI (getPDFPath path ex)) (shortname' $ S ("pdfRef" ++ ex)) None
getHTMLRef path ex = Reference ("htmlRef" ++ ex) (URI (getHTMLPath path ex)) (shortname' $ S ("htmlRef" ++ ex))
getPDFRef path ex = Reference ("pdfRef" ++ ex) (URI (getPDFPath path ex)) (shortname' $ S ("pdfRef" ++ ex))
getHTMLPath, getPDFPath :: FilePath -> String -> FilePath
getHTMLPath path ex = path ++ ex ++ "/srs/" ++ ex ++ "_SRS.html"
getPDFPath path ex = path ++ ex ++ "/srs/" ++ ex ++ "_SRS.pdf"

-- Make display names and references for generated code and docs
getCodeRef, getDoxRef :: FilePath -> String -> String -> (Sentence, Reference)
getCodeRef path ex lang = (S ("[" ++ convertlang ++ "]"), Reference ("codeRef" ++ ex ++ lang) (URI (getCodePath path ex lang)) (shortname' $ S ("codeRef" ++ ex ++ lang)) None)
getCodeRef path ex lang = (S ("[" ++ convertlang ++ "]"), Reference ("codeRef" ++ ex ++ lang) (URI (getCodePath path ex lang)) (shortname' $ S ("codeRef" ++ ex ++ lang)))
where
convertlang
| lang == "cpp" = "C++"
| lang == "csharp" = "C Sharp" -- Drasil printers dont like the # symbol, so we use the full word.
| otherwise = (toUpper.head) lang : tail lang
getDoxRef path ex lang = (S ("[" ++ convertlang lang ++ "]"), Reference ("doxRef" ++ ex ++ lang) (URI (getDoxPath path ex lang)) (shortname' $ S ("doxRef" ++ ex ++ lang)) None)
getDoxRef path ex lang = (S ("[" ++ convertlang lang ++ "]"), Reference ("doxRef" ++ ex ++ lang) (URI (getDoxPath path ex lang)) (shortname' $ S ("doxRef" ++ ex ++ lang)))
where
convertlang l
| l == "cpp" = "C++"
Expand Down
2 changes: 1 addition & 1 deletion code/drasil-website/Drasil/Website/Graphs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ drasilDepGraphRefs :: FilePath -> [Reference]
packDepGraphTitle = S "Package Dependency Graphs"
drasilFolders = ["drasil-build", "drasil-code", "drasil-data", "drasil-database", "drasil-docLang", "drasil-example", "drasil-gen", "drasil-gool", "drasil-lang", "drasil-printers", "drasil-theory", "drasil-utils"]
drasilDepGraphPaths path = map (\x -> path ++ x ++ ".pdf") drasilFolders
drasilDepGraphRefs path = zipWith (\x y -> Reference x (URI y) (shortname' $ S x) None) drasilFolders $ drasilDepGraphPaths path
drasilDepGraphRefs path = zipWith (\x y -> Reference x (URI y) $ shortname' $ S x) drasilFolders $ drasilDepGraphPaths path

folderList :: FilePath -> RawContent
folderList path= Enumeration $ Bullet $ zip (folderList' path) $ repeat Nothing
Expand Down

0 comments on commit fb9d573

Please sign in to comment.