{"id":13995163,"url":"https://github.com/subscript-publishing/subscript-compiler","last_synced_at":"2025-06-10T17:09:29.616Z","repository":{"id":57668920,"uuid":"370519543","full_name":"subscript-publishing/subscript-compiler","owner":"subscript-publishing","description":"OLD - MOVED TO subscript mono-repo https://github.com/subscript-publishing/subscript","archived":false,"fork":false,"pushed_at":"2022-01-15T19:00:19.000Z","size":358,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-29T12:45:06.359Z","etag":null,"topics":["compiler","html","latex","markup-language","math","publishing","science","typesetting","unicode"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/subscript-publishing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-25T00:28:13.000Z","updated_at":"2023-01-31T03:09:17.000Z","dependencies_parsed_at":"2022-08-27T01:40:56.284Z","dependency_job_id":null,"html_url":"https://github.com/subscript-publishing/subscript-compiler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subscript-publishing%2Fsubscript-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subscript-publishing%2Fsubscript-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subscript-publishing%2Fsubscript-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subscript-publishing%2Fsubscript-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/subscript-publishing","download_url":"https://codeload.github.com/subscript-publishing/subscript-compiler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241102740,"owners_count":19910117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","html","latex","markup-language","math","publishing","science","typesetting","unicode"],"created_at":"2024-08-09T14:03:16.906Z","updated_at":"2025-03-01T06:25:10.066Z","avatar_url":"https://github.com/subscript-publishing.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Work in progress...\n\nNot yet ready for public consumption; please check back in a couple of months. \n\nIdeally this will be usable for school this coming fall. \n\n# NOTE\n\nImplementation wise, there is a lot here that you may not necessarily see.\n\nFor instance this was used in an IOS iPad app experiment, as you can see in the old photo.\n\n![Old Screenshot](assets/old-screenshot.jpg)\n\nAs you can see in the above screenshot, syntax highlighting in Swift was calling out to rust over a C FFI that\ntransmitted source code span offsets that swift would then render. \n\nOverall, most syntax highlighting is based on simple patterns, but in here I was playing with\ncustom syntax highlighting based on parsing the source code into an AST which has much\nmore contextual information and therefore I could -for instance- highlight opening and\nclosing braces based on the indentation level (i.e. see attached image).\n\nAlso the parser implementation [over here](https://github.com/subscript-publishing/subscript-compiler/blob/main/src/frontend/parser.rs) (i.e. `src/frontend/parser`) may be interesting or impressive.\n\n\n\n## Example\n\nThe end result of the following example will be similar to what you see [over here](https://colbyn.github.io/school-notes-spring-2020).\n\n```\n...\n\n\\note[boxed] {\n    \\h3{Symmetric Equation of a Line}\n    Given\n    \\equation {\n        t \u0026= \\frac{x - x_1}{x_2-x_1} = \\frac{x - x_1}{\\Delta_x}\\\\\n        t \u0026= \\frac{y - y_1}{y_2-y_1} = \\frac{y - y_1}{\\Delta_y}\\\\\n        t \u0026= \\frac{z - z_1}{z_2-z_1} = \\frac{z - z_1}{\\Delta_z}\n    }\n    Therefore\n    \\equation {\n        \\frac{x - x_1}{Delta_x}\n            \u0026= \\frac{y - y_1}{\\Delta_y}\n            = \\frac{z - z_1}{\\Delta_z}\\\\\n                \\frac{x - x_1}{x_2-x_1}\n            \u0026= \\frac{y - y_1}{y_2-y_1}\n            =  \\frac{z - z_1}{z_2-z_1}\n    }\n    \\hr\n    \\h4{Rationale}\n    We rewrite \\{r = r_0 + a = r_0 + t v} in terms of \\{t}.\n    That is\n    \\equation{\n        x \u0026= x_1 + t(x_2-x_1) = x_1 + t\\;Delta_x\\\\\n        t\\;Delta_x  \u0026= x - x_1 = t(x_2-x_1)\\\\\n        t \u0026= \\frac{x - x_1}{x_2-x_1} = \\frac{x - x_1}{Delta_x} \\\\\\\\\n        y \u0026= y_1 + t(y_2-y_1) = y_1 + t\\;\\Delta_y\\\\\n        t\\;\\Delta_y  \u0026= y - y_1 = t(y_2-y_1)\\\\\n        t \u0026= \\frac{y - y_1}{y_2-y_1} = \\frac{y - y_1}{\\Delta_y} \\\\\\\\\n        z \u0026= z_1 + t(z_2-z_1) = z_1 + t\\;\\Delta_z\\\\\n        t\\;\\Delta_z \u0026= z - z_1 = t(z_2-z_1) \\\\\n        t \u0026= \\frac{z - z_1}{z_2-z_1} = \\frac{z - z_1}{\\Delta_z}\n    }\n}\n\\!where {\n    {\\Delta_x} =\u003e {\\colorA{\\Delta_x}}\n    {\\Delta_y} =\u003e {\\colorA{\\Delta_y}}\n    {\\Delta_z} =\u003e {\\colorA{\\Delta_z}}\n    {x_1} =\u003e {\\colorB{x_1}}\n    {y_1} =\u003e {\\colorB{y_1}}\n    {z_1} =\u003e {\\colorB{z_1}}\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubscript-publishing%2Fsubscript-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubscript-publishing%2Fsubscript-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubscript-publishing%2Fsubscript-compiler/lists"}