-
Notifications
You must be signed in to change notification settings - Fork 26
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
Comments
@szymczdm you are right that this would be useful, but how likely is it that you'll implement it? |
As of now, probably not very likely. |
- 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
@JacquesCarette and @smiths, Sample HTML file with basic hyperlinked ToC section: GlassBR_SRS |
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. :-) |
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
The work done so far that contributes to this issue can be found in branch Issue#1018_HTMLToC. |
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). |
@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! |
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.
The text was updated successfully, but these errors were encountered: