Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Table of Contents #2684

Merged
merged 13 commits into from
Jul 19, 2021
Merged

Adding Table of Contents #2684

merged 13 commits into from
Jul 19, 2021

Conversation

Ant13731
Copy link
Collaborator

Closes #1018
Summary of changes:

  • Add Table of Contents Section to SRS
  • Modified TeX printers to only print Table of Contents if the section is present in the SRS
  • Rearranged SRS.hs functions to be in the same order as they appear on a SRS document
  • Table of contents will not generate unless the section is included in the SRSDecl

Nathaniel-Hu and others added 12 commits July 14, 2020 18:42
- warning: relatively large commit
- 24 changes files in total; 9 general scripts, 7 Body.hs scripts, 7 HTML SRS and 1 TeX SRS files

Documentation.hs
- created new tOfCont named chunk for Table of Contents section generation; exported

DocDecl.hs
- implemented new TableOfContents DocSection value for DocSection data type
- updated function mkDocDesc to include new application for new TableOfContents DocSection data value

SRS.hs
- imported new tOfCont named chunk item for use in creation of new tOfCont section item
- created new tOfContLabel (section) reference item for use in creation of new tOfCont section

DocumentLanguage.hs
- imported new tOfCont section item
- updated sub-function doit to include new application for TableOfContents DocSection data value
- implemented new function mkToC to use DocDesc to create the Table of Contents section's contents; implemented new sub-function toToC to assist in creating section contents
- implemented new helper functions to assist in creating the various entries in the new Table of Contents section (mkToCSec, mktToCSec, mktRefSec, mktIntroSec, mktStkhldrSec, mktGSDSec, mktSSDSec, mktReqrmntSec, mktLCsSec, mktUCsSec, mktTraceabilitySec, mktAuxConsSec, mktBib, mktAppndxSec, mktOffShelfSolnSec) with sub-functions as needed (mktSubRef, mktSubIntro, mktSub, mktSubSSD, mktSubPD, mktSubSCS, mktSubs)
- added new accompanying comment for helper function mkIntroSec

Core.hs
- added new DocSection data value TableOfContents
- added new instance of DLPlate of Multiplate for new TableOfContents DocSection data value

Body.hs (for /GamePhysics, /GlassBR, /HGHC, /NoPCM, /Projectile, /SSP, /SWHS)
- added new TableOfContents DocSection data value to SRSDecl in function mkSRS
- added new import for DocSection data value TableOfContents as needed (for /HGHC, /Projectile)

Drasil.hs
- added new functions senToStr. getDTle, getDAtr, getDSec, getDDoc, mkUnOrdList, mkTEList and mkTE2List (to assist in reading through the DocDesc and create the ToC section contents)

Document.hs
- added new functions to assist in reading through the DocDesc and creating the ToC section contents
- new functions include getDTle, getDAtr, getDSec, getDDoc, mkUnOrdList, mkUnOrdList_, mkUnOrdList2_, mkTEList and mkTE2List

Sentence.hs
- implemented/exported new function senToStr to revert Sentence back to String type (applicable only in a few cases)
- used to determine if TableOfContents section is in DocDesc; temporary function, likely will be replaced with more robust function

Print.hs
- imported (new) functions tle (from Section data type). getDTle, getDAtr, getDSec, getDDoc and senToStr
- updated implementation of function genTeX to only include Table of Contents generation iff the TableOfContents section was in the Document's contents
- implemented new duplicate function buildStd_ to omit the ToC generation (may combine with function buildStd later); added new accompanying comments to differentiate duplicate functions

GamePhysics_SRS.html, GlassBR_SRS.html, HGHC_SRS.html, NoPCM_SRS.html, Projectile_SRS.html, SSP_SRS.html, SWHS_SRS.html
- updated _SRS.html stable files to include the new (basic) Table of Contents section (unlinked)

Template_SRS.tex
- updated template SRS stable file to remove automatic inclusion of the Table of Contents section
- should the template have the TableOfContents sections included by default? @JacquesCarette @smiths

- contributes to Issue #1018
DocumentLanguage.hs
- used record patterns "{}" in place of groups of 3+ blanks ("_ _ _" and longer)

Document.hs
- added new language option TupleSections to top of file
- reduced function getDDoc, removing unneeded explicit parameters
- used tuple-section to streamline/reduce definition for tl (under function mkUnOrdList2_)
- reduced uses of map with function composition

Sentence.hs
- removed redundant brackets

Print.hs
- removed redundant brackets, moved brackets around to avoid use of $
DocumentLanguage.hs
- removed redundant brackets from input parameters in several sub-functions as needed
drasil-docLang.cabal
- addded new (hidden) module Drasil.Sections.TableOfContents

DocumentLanguage.hs
- imported new module Dasil.Sections.TableOfContents (to get references/hyperlinking for each section entry in the ToC)
- replaced all (S String) Sentences for all ToC entries with (Ref Reference) Sentences for all ToC entries
- used imported References from new imported module

TableOfContents.hs
- created new module Dasil.Sections.TableOfContents
- to create references for hyperlinking each section/subsection entry in the ToC

Drasil.hs
- exports new function makeToCRef (imported from module Language.Drasil.Document)

Document.hs
- created new function makeToCRef to convert two Strings into a Reference, ideally formatted for the ToC section/subsection entries

GamePhysics_SRS.html, GlassBR_SRS.html, HGHC_SRS.html, NoPCM_SRS.html, Projectile_SRS.html, SSP_SRS.html, SWHS_SRS.html
- updated stable files to include updated Table of Contents with hyperlinked section/subsection entries
@JacquesCarette
Copy link
Owner

Needs a master merge, but is otherwise good to go.

@JacquesCarette JacquesCarette merged commit 163a458 into master Jul 19, 2021
@JacquesCarette JacquesCarette deleted the Issue#1018_HTMLToC branch July 19, 2021 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTML Table of Contents
5 participants