-
Couldn't load subscription status.
- Fork 132
Web Edition
For development & deployment:
- node.js
The generated web pages are static and can be hosted on any standard web servers.
The original text is stored as xml files in the xml folder.
The html pages are generated in three steps.
-
Generate Table of Content, containing information on
chapterIndexandchapterTitleof different chapters/sections/subsections. -
Process all
xmlfiles and set upSnippets andReferencessetupSnippetsHtmlfunction in processSnippetHtml.js file process all the<SNIPPET>tags found in the xml files and store their respectivename,codeStrandrequireNamein an objectsnippetStorefor later reference.setupReferencesHtmlfunction in processReferenceHtml.js file found all<LABEL>tags in the xml files. Depend on their parent being<SECTION>,<FIGURE>,<EXERCISE>or<FOOTNOTE>, their respectivereferenceName,displayName,hrefandchapterIndexof the chapter they belong to are stored in an objectreferenceStorefor later reference. -
Translate
xmlcontent tohtmland write into the generatedhtmlfiles insidehtml_jsfoldersee
parseXmlHtml.jsfile for further details on the translation process of eachxmltags.
Run yarn install to install dependencies.
yarn web
The generated html pages are saved in sicpjs_html folder.
The entire program is located at nodejs. To test any changes made to the nodejs project, cd html_js && http-server --port=8080 to view the textbook on a local server, by visiting localhost:8080 with your browser.
For future developers, start with index.js and parseXmlHtml.js. Most of the remaining functions (helper functions) can be found being references from these two files.