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

HTML Table of Contents #1018

Closed
szymczdm opened this issue Sep 25, 2018 · 7 comments · Fixed by #2684
Closed

HTML Table of Contents #1018

szymczdm opened this issue Sep 25, 2018 · 7 comments · Fixed by #2684
Assignees

Comments

@szymczdm
Copy link
Collaborator

I noticed that the HTML versions of the SRS don't include a table of contents. It'd probably be a useful feature for anyone that wants to review the documents.

I don't think it would be a very difficult feature to add, particularly since we can traverse the DocDesc and know exactly which sections are included.

@szymczdm szymczdm self-assigned this Sep 25, 2018
@JacquesCarette
Copy link
Owner

@szymczdm you are right that this would be useful, but how likely is it that you'll implement it?

@szymczdm
Copy link
Collaborator Author

As of now, probably not very likely.

@Nathaniel-Hu Nathaniel-Hu mentioned this issue May 7, 2020
2 tasks
@Nathaniel-Hu Nathaniel-Hu self-assigned this May 25, 2020
Nathaniel-Hu added a commit that referenced this issue Jul 14, 2020
- 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
@Nathaniel-Hu
Copy link
Collaborator

@JacquesCarette and @smiths,
I have modified/updated the stable files to include a basic hyperlinked Table of Contents section (see link below for the GlassBR_SRS.html file, for example). Are there any specific changes/improvements to the current formatting of the Table of Contents section that you would like me to make?

Sample HTML file with basic hyperlinked ToC section: GlassBR_SRS

@smiths
Copy link
Collaborator

smiths commented Jul 18, 2020

Nice! @JacquesCarette will have to comment on how you did it, but as far as the result goes, the ToC looks great to me. This is a really nice improvement for the html version of the SRS. I frequently consult our html examples, so I'll directly benefit from the time saving hyperlinks. :-)

Nathaniel-Hu referenced this issue Jul 20, 2020
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
@Nathaniel-Hu
Copy link
Collaborator

The work done so far that contributes to this issue can be found in branch Issue#1018_HTMLToC.

@Ant13731 Ant13731 self-assigned this Jul 12, 2021
@Ant13731
Copy link
Collaborator

Putting this comment here as a note. I'm not sure how Multiplates work in Drasil, but I'll probably take a go at it once this issue is merged/completed.

@smiths, for this comment, when we choose to generate the table of contents, should it use its own LaTeX table of contents, or should it be generated from drasil as in Nathaniel's commit.

I currently have a working version (except for the LaTeX table of contents stuff), so I'll push it and link it below. Let me know what you think (it's not implemented for all examples yet either).

@smiths
Copy link
Collaborator

smiths commented Jul 16, 2021

@Ant13731, it makes sense to me to use the LaTeX commands for generating a table of contents, instead of generating our own LaTeX code for this. Using LaTeX is the "LaTeX" way of doing this. Moreover, it is likely to look better. 😄

I've looked at a few of your generated html SRS tables of contents. They look great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants