Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: source-academy/sicp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: js-1.0
Choose a base ref
...
head repository: source-academy/sicp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 7,095 additions and 3,938 deletions.
  1. +25 −0 .github/workflows/ci.yml
  2. +1 −1 .github/workflows/codeql-analysis.yml
  3. +6 −16 .github/workflows/deploy-pages.yml
  4. +1 −0 .node-version
  5. +9 −7 README.md
  6. +891 −0 javascript/generateSearchData.js
  7. +12 −12 javascript/generateTocHtml.js
  8. +50 −6 javascript/generateTocJson.js
  9. +13 −18 javascript/index.js
  10. +1 −39 javascript/latexContent.js
  11. +11 −28 javascript/parseXmlHtml.js
  12. +95 −14 javascript/parseXmlJson.js
  13. +1 −47 javascript/parseXmlLatex.js
  14. +0 −6 javascript/processingFunctions/index.js
  15. +9 −6 javascript/processingFunctions/processEpigraphJson.js
  16. +0 −32 javascript/processingFunctions/processExerciseEpub.js
  17. +21 −2 javascript/processingFunctions/processExerciseJson.js
  18. +0 −39 javascript/processingFunctions/processFigureEpub.js
  19. +9 −7 javascript/processingFunctions/processReferenceHtml.js
  20. +6 −5 javascript/processingFunctions/processReferenceJson.js
  21. +0 −206 javascript/processingFunctions/processSnippetEpub.js
  22. +8 −8 javascript/processingFunctions/processSnippetPdf.js
  23. +6 −3 javascript/processingFunctions/replaceTagWithSymbol.js
  24. +325 −0 javascript/searchRewrite.js
  25. +272 −0 javascript/searchRewriteTest.js
  26. +17 −17 package.json
  27. +5 −11 scripts/do.sh
  28. BIN sicpjs_backup.pdf
  29. BIN static/img_javascript/ex-3-13-sol.png
  30. BIN static/img_javascript/ex-3-14-sol-1.png
  31. BIN static/img_javascript/ex-3-14-sol-2.png
  32. BIN static/img_javascript/ex5-1-solution-1.png
  33. BIN static/img_javascript/ex5-1-solution-2.png
  34. +2 −0 static/robots.txt
  35. BIN static/sicpjs.png
  36. +1,645 −1,300 test_node_env/package-lock.json
  37. +1 −1 xml/chapter1/chapter1.xml
  38. +2 −2 xml/chapter1/section1/subsection2.xml
  39. +8 −2 xml/chapter1/section1/subsection3.xml
  40. +2 −2 xml/chapter1/section1/subsection5.xml
  41. +29 −4 xml/chapter1/section1/subsection6.xml
  42. +6 −8 xml/chapter1/section1/subsection7.xml
  43. +1 −1 xml/chapter1/section1/subsection8.xml
  44. +0 −1 xml/chapter1/section2/section2.xml
  45. +5 −4 xml/chapter1/section2/subsection1.xml
  46. +3 −1 xml/chapter1/section2/subsection2.xml
  47. +2 −0 xml/chapter1/section2/subsection3.xml
  48. +1 −0 xml/chapter1/section2/subsection4.xml
  49. +1 −1 xml/chapter1/section2/subsection5.xml
  50. +7 −5 xml/chapter1/section2/subsection6.xml
  51. +3 −1 xml/chapter1/section3/subsection1.xml
  52. +12 −7 xml/chapter1/section3/subsection2.xml
  53. +3 −0 xml/chapter1/section3/subsection3.xml
  54. +5 −1 xml/chapter1/section3/subsection4.xml
  55. +5 −5 xml/chapter2/chapter2.xml
  56. +1 −0 xml/chapter2/section1/subsection1.xml
  57. +5 −4 xml/chapter2/section1/subsection3.xml
  58. +6 −1 xml/chapter2/section1/subsection4.xml
  59. +1 −1 xml/chapter2/section2/section2.xml
  60. +3 −1 xml/chapter2/section2/subsection1.xml
  61. +5 −0 xml/chapter2/section2/subsection2.xml
  62. +7 −2 xml/chapter2/section2/subsection3.xml
  63. +3 −0 xml/chapter2/section2/subsection4.xml
  64. +4 −4 xml/chapter2/section3/subsection1.xml
  65. +25 −12 xml/chapter2/section3/subsection2.xml
  66. +5 −0 xml/chapter2/section3/subsection3.xml
  67. +16 −27 xml/chapter2/section3/subsection4.xml
  68. +2 −2 xml/chapter2/section4/subsection2.xml
  69. +10 −8 xml/chapter2/section4/subsection3.xml
  70. +97 −1 xml/chapter2/section5/subsection1.xml
  71. +9 −7 xml/chapter2/section5/subsection2.xml
  72. +38 −4 xml/chapter2/section5/subsection3.xml
  73. +1 −1 xml/chapter3/chapter3.xml
  74. +1 −0 xml/chapter3/section1/subsection1.xml
  75. +1 −1 xml/chapter3/section1/subsection2.xml
  76. +25 −0 xml/chapter3/section1/subsection3.xml
  77. +4 −1 xml/chapter3/section2/section2.xml
  78. +1 −1 xml/chapter3/section2/subsection1.xml
  79. +1 −1 xml/chapter3/section2/subsection2.xml
  80. +2 −2 xml/chapter3/section2/subsection3.xml
  81. +1 −1 xml/chapter3/section2/subsection4.xml
  82. +52 −0 xml/chapter3/section2/subsection5.xml
  83. +3 −3 xml/chapter3/section3/section3.xml
  84. +208 −2 xml/chapter3/section3/subsection1.xml
  85. +192 −0 xml/chapter3/section3/subsection2.xml
  86. +272 −3 xml/chapter3/section3/subsection3.xml
  87. +55 −24 xml/chapter3/section3/subsection4.xml
  88. +118 −0 xml/chapter3/section3/subsection5.xml
  89. +5 −1 xml/chapter3/section4/subsection2.xml
  90. +4 −4 xml/chapter3/section5/subsection1.xml
  91. +45 −2 xml/chapter3/section5/subsection2.xml
  92. +4 −0 xml/chapter3/section5/subsection3.xml
  93. +1 −0 xml/chapter3/section5/subsection4.xml
  94. +2 −0 xml/chapter3/section5/subsection5.xml
  95. +2 −2 xml/chapter4/chapter4.xml
  96. +1 −1 xml/chapter4/section1/section1.xml
  97. +1 −1 xml/chapter4/section1/subsection1.xml
  98. +51 −1 xml/chapter4/section1/subsection2.xml
  99. +1 −0 xml/chapter4/section1/subsection3.xml
  100. +24 −20 xml/chapter4/section1/subsection4.xml
  101. +1 −1 xml/chapter4/section1/subsection5.xml
  102. +41 −1 xml/chapter4/section1/subsection6.xml
  103. +1 −1 xml/chapter4/section1/subsection7.xml
  104. +6 −1 xml/chapter4/section2/subsection1.xml
  105. +4 −4 xml/chapter4/section2/subsection2.xml
  106. +2 −2 xml/chapter4/section2/subsection3.xml
  107. +2 −2 xml/chapter4/section3/section3.xml
  108. +12 −0 xml/chapter4/section3/subsection1.xml
  109. +2 −2 xml/chapter4/section4/section4.xml
  110. +148 −140 xml/chapter4/section4/subsection1.xml
  111. +2 −2 xml/chapter4/section4/subsection2.xml
  112. +2 −0 xml/chapter4/section4/subsection3.xml
  113. +39 −18 xml/chapter4/section4/subsection4.xml
  114. +3 −3 xml/chapter5/chapter5.xml
  115. +42 −0 xml/chapter5/section1/section1.xml
  116. +1 −1 xml/chapter5/section1/subsection1.xml
  117. +1 −0 xml/chapter5/section1/subsection4.xml
  118. +2 −2 xml/chapter5/section2/subsection1.xml
  119. +3 −2 xml/chapter5/section2/subsection2.xml
  120. +2 −0 xml/chapter5/section2/subsection3.xml
  121. +4 −1 xml/chapter5/section2/subsection4.xml
  122. +3 −1 xml/chapter5/section3/subsection1.xml
  123. +5 −4 xml/chapter5/section4/subsection2.xml
  124. +1 −0 xml/chapter5/section4/subsection3.xml
  125. +5 −4 xml/chapter5/section4/subsection4.xml
  126. +12 −2 xml/chapter5/section5/subsection1.xml
  127. +3 −0 xml/chapter5/section5/subsection5.xml
  128. +1 −0 xml/chapter5/section5/subsection6.xml
  129. +2 −0 xml/chapter5/section5/subsection7.xml
  130. +9 −10 xml/others/03prefaces03.xml
  131. +2 −2 xml/others/04acknowledgements04.xml
  132. +4 −16 xml/others/99making99.xml
  133. +1,876 −1,694 yarn.lock
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run CI
on:
pull_request:
branches:
- master
push:

jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
# TODO: Reenable once no longer broken
# - name: Test
# run: yarn test
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
22 changes: 6 additions & 16 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -12,11 +12,12 @@ jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v2-beta
uses: actions/setup-node@v4
with:
node-version: '12'
node-version: 20
cache: yarn
- name: Install pandoc
run: |
URL="https://github.com/jgm/pandoc/releases/download/2.14.0.1/pandoc-2.14.0.1-1-amd64.deb"
@@ -27,19 +28,8 @@ jobs:
run: |
sudo apt-get update -y
sudo apt-get install -y texlive texlive-fonts-extra latexmk
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Fetch Yarn dependencies
run: |
yarn install
run: yarn install
- name: Build
run: |
set -euxo pipefail
@@ -52,7 +42,7 @@ jobs:
yarn run prepare
find docs_out -name .gitignore -delete -print
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs_out
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.11.0
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,8 @@

This repository contains processing scripts and sources for the textbook SICP JS: *Structure and Interpretation of Computer Programs, JavaScript Edition* (SICP JS). See [Preface](https://sourceacademy.org/sicpjs/prefaces03) for background.

Available versions:
Available versions:

* [Print version](https://mitpress.mit.edu/books/structure-and-interpretation-computer-programs-1) and the [ebook version](https://www.amazon.com/Structure-Interpretation-Computer-Programs-Engineering-ebook-dp-B094X8316F/dp/B094X8316F/ref=mt_other?_encoding=UTF8&me=&qid=) are scheduled for publication in 2022
* [Interactive SICP JS](https://sourceacademy.org/sicpjs)
* [Comparison version](http://sicp.sourceacademy.org) Scheme vs JavaScript
@@ -13,14 +14,17 @@ Check out our [Resources for Learners, Educators and Researchers](https://about.

## Licenses

[![CC BY-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]
The [print version of SICP JS](https://mitpress.mit.edu/books/structure-and-interpretation-computer-programs-1) and the [ebook version](https://www.amazon.com/Structure-Interpretation-Computer-Programs-Engineering-ebook-dp-B094X8316F/dp/B094X8316F/ref=mt_other?_encoding=UTF8&me=&qid=) will be published in 2022 by The MIT Press under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](cc-by-nc-sa) (CC BY-NC-SA).
[![CC BY-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]

The [print version of SICP JS](https://mitpress.mit.edu/books/structure-and-interpretation-computer-programs-1) and the [ebook version](https://www.amazon.com/Structure-Interpretation-Computer-Programs-Engineering-ebook-dp-B094X8316F/dp/B094X8316F/ref=mt_other?_encoding=UTF8&me=&qid=) will be published in 2022 by The MIT Press under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](cc-by-nc-sa) (CC BY-NC-SA).

[![CC BY-SA 4.0][cc-by-sa-image]][cc-by-sa]

[![CC BY-SA 4.0][cc-by-sa-image]][cc-by-sa]
The text of SICP JS is derived from the book *Structure and Interpretation of Computer Programs*, Second Edition, 1996, (SICP) by Harold Abelson and Gerald Jay Sussman, and is licensed by these original authors and by the adapters Martin Henz and Tobias Wrigstad under a [Creative Commons Attribution-ShareAlike 4.0 International License](cc-by-sa) (CC BY-SA). A [comparison edition](http://sicp.sourceacademy.org) indicates the changes that were made to SICP for the JavaScript edition. [Interactive SICP JS](https://sourceacademy.org/sicpjs) is licensed by Martin Henz, Tobias Wrigstad, and Samuel Fang under CC BY-SA. The figures in all versions are derived from figures created by Andres Raba in 2015, and are licensed by Martin Henz and Tobias Wrigstad under CC BY-SA.

[![GPL 3][gpl3-image]][gpl3]
The JavaScript programs in SICP JS are derived from the Scheme programs in SICP and are licensed by Martin Henz and Tobias Wrigstad under the [GNU General Public License v3.0](gpl3).

The JavaScript programs in SICP JS are derived from the Scheme programs in SICP and are licensed by Martin Henz and Tobias Wrigstad under the [GNU General Public License v3.0](gpl3).

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
All JavaScript and TypeScript programs that generate the SICP (JS) versions are licensed by the contributors under the [Apache License Version 2][apache2].
@@ -32,5 +36,3 @@ All JavaScript and TypeScript programs that generate the SICP (JS) versions are
[gpl3]: https://www.gnu.org/licenses/gpl-3.0.en.html
[gpl3-image]: https://upload.wikimedia.org/wikipedia/commons/thumb/7/79/License_icon-gpl.svg/50px-License_icon-gpl.svg.png
[apache2]: https://www.apache.org/licenses/LICENSE-2.0.txt


Loading