├── .github ├── auto-assign-config.yml └── workflows │ ├── auto-assign.yml │ ├── build_and_publish.yml │ ├── jekyll-gh-pages.yml │ └── update_algorithms.yml ├── .gitignore ├── ALGORITHMS.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── package-lock.json ├── package.json ├── public ├── css │ └── fonts.css ├── fonts │ ├── APL387.ttf │ ├── Apl385.ttf │ ├── BQN386.ttf │ ├── JetBrainsMono-Regular.ttf │ ├── TinyAPL386.ttf │ └── Uiua386.ttf ├── index.html └── media │ ├── code_report_circle.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon-48x48.png │ ├── favicon.svg │ └── logos │ ├── LISP_logo.png │ ├── ada.png │ ├── agda.svg │ ├── apl_logo.png │ ├── asp.net.jpg │ ├── assembly_logo.png │ ├── bash_logo.png │ ├── bqn_logo.svg │ ├── c_logo.png │ ├── chapel.png │ ├── clojure_logo.png │ ├── cobol.png │ ├── common_lisp.png │ ├── cpp_logo.png │ ├── crystal_logo.svg │ ├── csharp_logo.png │ ├── css_logo.png │ ├── cuda.jpg │ ├── d_logo.png │ ├── dart_logo.png │ ├── delphi.png │ ├── dyalog_logo.png │ ├── elixir_logo.png │ ├── elm_logo.png │ ├── emacs_lisp.png │ ├── erlang_logo.png │ ├── excel_logo.png │ ├── fortran_logo.png │ ├── foxpro.png │ ├── fsharp_logo.png │ ├── futhark.png │ ├── gleam.png │ ├── gleam.svg │ ├── go_logo.png │ ├── go_logo_thin.png │ ├── groovy_logo.jpeg │ ├── haskell_logo.svg │ ├── html_logo.svg │ ├── j_logo.png │ ├── java_logo.png │ ├── javascript_logo.png │ ├── jq.jpg │ ├── julia_logo.png │ ├── julia_logo.svg │ ├── julia_logo_darkmode.png │ ├── jupyter_logo.png │ ├── k.png │ ├── kap.png │ ├── kotlin-2.svg │ ├── kotlin_logo.png │ ├── kx-logo.png │ ├── lfe.png │ ├── lua_logo.png │ ├── markdown_logo.png │ ├── mathematica.png │ ├── matlab_logo.png │ ├── moon.svg │ ├── newlisp.jpg │ ├── nim_logo.png │ ├── objc_logo.png │ ├── ocaml_logo.jpg │ ├── pandas-logo.png │ ├── pandas-logo2.png │ ├── pandas-logo3.png │ ├── pascal.png │ ├── perl.png │ ├── pharo_logo.png │ ├── php_circle.png │ ├── php_logo.png │ ├── pico_lisp.png │ ├── plgpsql.png │ ├── powershell_logo.png │ ├── purescript.png │ ├── python_logo.png │ ├── r_logo.png │ ├── racket_logo.png │ ├── rapids_logo.png │ ├── reason.jpg │ ├── ruby_logo.png │ ├── rust_logo.png │ ├── rust_logo_darkmode.png │ ├── sas_logo.png │ ├── sass.png │ ├── scala_logo.svg │ ├── scala_logo2.png │ ├── scheme.svg │ ├── scratch.png │ ├── sml.png │ ├── solidity_logo.svg │ ├── sql_logo.png │ ├── swift_logo.png │ ├── thrust_logo.jfif │ ├── thrust_logo.png │ ├── tinyapl.svg │ ├── ts.png │ ├── uiua.png │ ├── vb.jpg │ ├── vba.png │ ├── vim.png │ ├── vue.png │ └── zig_logo.svg ├── scripts ├── algo_file_sort.py ├── counts.py ├── first_free_id.py ├── gen.py ├── language_counts.png └── ruff.toml ├── shadow-cljs.edn └── src ├── core.cljs ├── data.cljs ├── imgs.cljs └── styles.cljs /.github/auto-assign-config.yml: -------------------------------------------------------------------------------- 1 | # Set to true to assign PR author as assignee 2 | addAssignees: author 3 | 4 | # Set to true to add reviewers to the PR 5 | addReviewers: true 6 | 7 | # Set reviewers 8 | reviewers: 9 | - codereport 10 | 11 | # A number of reviewers added to the PR 12 | # numberOfReviewers: 0 means all reviewers from the list will be added. 13 | numberOfReviewers: 1 14 | -------------------------------------------------------------------------------- /.github/workflows/auto-assign.yml: -------------------------------------------------------------------------------- 1 | name: Auto Assign 2 | on: 3 | issues: 4 | types: [opened] 5 | pull_request: 6 | types: [opened] 7 | pull_request_target: 8 | types: [opened] 9 | 10 | permissions: 11 | issues: write 12 | pull-requests: write 13 | contents: read 14 | 15 | jobs: 16 | assign: 17 | runs-on: ubuntu-latest 18 | steps: 19 | # Handle Issues 20 | - if: github.event_name == 'issues' 21 | uses: pozil/auto-assign-issue@v2 22 | with: 23 | assignees: codereport 24 | numOfAssignee: 1 25 | 26 | # Handle PRs - use one action that can handle both assignments and reviews 27 | - if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' 28 | uses: kentaro-m/auto-assign-action@v1.2.5 29 | with: 30 | configuration-path: .github/auto-assign-config.yml 31 | -------------------------------------------------------------------------------- /.github/workflows/build_and_publish.yml: -------------------------------------------------------------------------------- 1 | name: ClojureScript Build and Deploy 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | paths: 7 | - 'src/**' 8 | - 'shadow-cljs.edn' 9 | # Add manual trigger option 10 | workflow_dispatch: 11 | 12 | jobs: 13 | build-and-deploy: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout 17 | uses: actions/checkout@v3 18 | with: 19 | persist-credentials: false 20 | 21 | - name: Set up Java 21 22 | uses: actions/setup-java@v3 23 | with: 24 | distribution: 'temurin' 25 | java-version: '21' 26 | 27 | - name: Get yarn cache directory path 28 | id: yarn-cache-dir-path 29 | run: echo "::set-output name=dir::$(yarn cache dir)" 30 | - name: Cache yarn 31 | uses: actions/cache@v3 32 | id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) 33 | with: 34 | path: ${{ steps.yarn-cache-dir-path.outputs.dir }} 35 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 36 | restore-keys: | 37 | ${{ runner.os }}-yarn- 38 | - name: Cache local Maven repository 39 | uses: actions/cache@v3 40 | with: 41 | path: ~/.m2/repository 42 | key: ${{ runner.os }}-maven-${{ hashFiles('**/shadow-cljs.edn') }} 43 | restore-keys: | 44 | ${{ runner.os }}-maven- 45 | 46 | - name: Install yarn deps 47 | run: yarn install 48 | 49 | - name: Install shadow-cljs 50 | run: yarn add --dev shadow-cljs 51 | 52 | - name: Build for production 53 | run: yarn shadow-cljs release dev 54 | 55 | - name: Create .nojekyll file 56 | run: touch public/.nojekyll 57 | 58 | - name: Ensure js directory exists 59 | run: mkdir -p public/js 60 | 61 | - name: Deploy 62 | uses: JamesIves/github-pages-deploy-action@3.7.1 63 | with: 64 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 65 | BRANCH: gh-pages 66 | FOLDER: public 67 | CLEAN: true 68 | -------------------------------------------------------------------------------- /.github/workflows/jekyll-gh-pages.yml: -------------------------------------------------------------------------------- 1 | # Empty workflow file to disable the default GitHub Pages build process 2 | name: No Jekyll 3 | 4 | on: 5 | push: 6 | branches: [ "main" ] 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: No Jekyll build 13 | run: echo "Preventing default Jekyll build" -------------------------------------------------------------------------------- /.github/workflows/update_algorithms.yml: -------------------------------------------------------------------------------- 1 | name: Update Algorithms Data 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | paths: 7 | - 'ALGORITHMS.md' 8 | workflow_dispatch: # Allow manual trigger 9 | 10 | jobs: 11 | update-and-deploy: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout repository 15 | uses: actions/checkout@v3 16 | with: 17 | persist-credentials: false 18 | 19 | - name: Set up Python 20 | uses: actions/setup-python@v4 21 | with: 22 | python-version: '3.x' 23 | 24 | - name: Run gen.py script 25 | run: python scripts/gen.py 26 | 27 | - name: Commit updated data file 28 | run: | 29 | git config --local user.email "action@github.com" 30 | git config --local user.name "GitHub Action" 31 | git add src/data.cljs 32 | git diff --quiet && git diff --staged --quiet || git commit -m "🤖 Update data.cljs from ALGORITHMS.md changes" 33 | 34 | - name: Push changes 35 | uses: ad-m/github-push-action@master 36 | with: 37 | github_token: ${{ secrets.GITHUB_TOKEN }} 38 | branch: main 39 | 40 | - name: Trigger Build and Deploy Workflow 41 | uses: actions/github-script@v6 42 | with: 43 | github-token: ${{ secrets.GITHUB_TOKEN }} 44 | script: | 45 | await github.rest.actions.createWorkflowDispatch({ 46 | owner: context.repo.owner, 47 | repo: context.repo.repo, 48 | workflow_id: 'build_and_publish.yml', 49 | ref: 'main' 50 | }) 51 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /node_modules 3 | .shadow-cljs 4 | public/js 5 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## How to Add A Missing Algorithm / Language 2 | 3 | ### Step 1: Add the algorithm to the `ALGORITHMS.md` 4 | 5 | Modify [`ALGORITHMS.md`](https://github.com/codereport/hoogle-translate/blob/main/ALGORITHMS.md) by adding a row with the relevant information. For example: 6 | 7 | | Language | Algorithm Name | AlgoId | Lib | Expr | Doc Link | 8 | | :------: | :------------: | :----: | :---------: | :---: | :-----------------------------------------------------------: | 9 | | C++ | `accumulate` | 1 | `` | | [doc](https://en.cppreference.com/w/cpp/algorithm/accumulate) | 10 | 11 | Information to be included: 12 | 13 | 1. **Language** 14 | 2. **Algorithm Name** 15 | 3. **AlgoId:** this is a unique id that links algorithms to a category - check to see if it already exists 16 | 4. **Lib:** this is the name of the library that the algorithm belongs to 17 | 5. **Expr:** mark as `Y` if this is not a single function but an expression or combination of functions 18 | 6. **Doc Link:** this is the link to the documentation of the algorithm 19 | 20 | ### Step 2: Check if programming language logo exists 21 | 22 | Check that the language logo for the image is in `public/media/logos/`. If it isn't please add one, and update the `src/imgs.cljs` accordingly. 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023-2025 Conor Hoekstra 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #

Hoogle Translate (Website)

2 | 3 |

4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

17 | 18 | 19 | ![image](https://github.com/user-attachments/assets/346449ed-77ad-4651-bae3-f0982fcd2694) 20 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cljs-starter", 3 | "version": "1.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "cljs-starter", 9 | "version": "1.0.0", 10 | "license": "MIT", 11 | "dependencies": { 12 | "create-react-class": "^15.7.0", 13 | "react": "^16.13.0", 14 | "react-dom": "16.13.0", 15 | "react-social-icons": "^6.22.0" 16 | } 17 | }, 18 | "node_modules/@babel/runtime": { 19 | "version": "7.27.0", 20 | "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.0.tgz", 21 | "integrity": "sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw==", 22 | "dependencies": { 23 | "regenerator-runtime": "^0.14.0" 24 | }, 25 | "engines": { 26 | "node": ">=6.9.0" 27 | } 28 | }, 29 | "node_modules/create-react-class": { 30 | "version": "15.7.0", 31 | "resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.7.0.tgz", 32 | "integrity": "sha512-QZv4sFWG9S5RUvkTYWbflxeZX+JG7Cz0Tn33rQBJ+WFQTqTfUTjMjiv9tnfXazjsO5r0KhPs+AqCjyrQX6h2ng==", 33 | "dependencies": { 34 | "loose-envify": "^1.3.1", 35 | "object-assign": "^4.1.1" 36 | } 37 | }, 38 | "node_modules/js-tokens": { 39 | "version": "4.0.0", 40 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 41 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" 42 | }, 43 | "node_modules/loose-envify": { 44 | "version": "1.4.0", 45 | "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", 46 | "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", 47 | "dependencies": { 48 | "js-tokens": "^3.0.0 || ^4.0.0" 49 | }, 50 | "bin": { 51 | "loose-envify": "cli.js" 52 | } 53 | }, 54 | "node_modules/object-assign": { 55 | "version": "4.1.1", 56 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 57 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", 58 | "engines": { 59 | "node": ">=0.10.0" 60 | } 61 | }, 62 | "node_modules/prop-types": { 63 | "version": "15.7.2", 64 | "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", 65 | "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", 66 | "dependencies": { 67 | "loose-envify": "^1.4.0", 68 | "object-assign": "^4.1.1", 69 | "react-is": "^16.8.1" 70 | } 71 | }, 72 | "node_modules/react": { 73 | "version": "16.14.0", 74 | "resolved": "https://registry.npmjs.org/react/-/react-16.14.0.tgz", 75 | "integrity": "sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==", 76 | "dependencies": { 77 | "loose-envify": "^1.1.0", 78 | "object-assign": "^4.1.1", 79 | "prop-types": "^15.6.2" 80 | }, 81 | "engines": { 82 | "node": ">=0.10.0" 83 | } 84 | }, 85 | "node_modules/react-dom": { 86 | "version": "16.13.0", 87 | "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.13.0.tgz", 88 | "integrity": "sha512-y09d2c4cG220DzdlFkPTnVvGTszVvNpC73v+AaLGLHbkpy3SSgvYq8x0rNwPJ/Rk/CicTNgk0hbHNw1gMEZAXg==", 89 | "dependencies": { 90 | "loose-envify": "^1.1.0", 91 | "object-assign": "^4.1.1", 92 | "prop-types": "^15.6.2", 93 | "scheduler": "^0.19.0" 94 | }, 95 | "peerDependencies": { 96 | "react": "^16.0.0" 97 | } 98 | }, 99 | "node_modules/react-is": { 100 | "version": "16.13.1", 101 | "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", 102 | "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" 103 | }, 104 | "node_modules/react-social-icons": { 105 | "version": "6.22.0", 106 | "resolved": "https://registry.npmjs.org/react-social-icons/-/react-social-icons-6.22.0.tgz", 107 | "integrity": "sha512-+KN3yL61+oPR9BqHvMRin7gwfYnzLPFsiyHTTJ6g+AwO5v8rfJ/qWUv3TZqeqInfGmKWobpnLOp4pm48HHaK+A==", 108 | "dependencies": { 109 | "@babel/runtime": "^7.24.8", 110 | "react": "^18.3.1", 111 | "react-dom": "^18.3.1" 112 | }, 113 | "peerDependencies": { 114 | "react": "15.x.x || 16.x.x || 17.x.x || 18.x.x", 115 | "react-dom": "15.x.x || 16.x.x || 17.x.x || 18.x.x" 116 | } 117 | }, 118 | "node_modules/react-social-icons/node_modules/react": { 119 | "version": "18.3.1", 120 | "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", 121 | "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", 122 | "dependencies": { 123 | "loose-envify": "^1.1.0" 124 | }, 125 | "engines": { 126 | "node": ">=0.10.0" 127 | } 128 | }, 129 | "node_modules/react-social-icons/node_modules/react-dom": { 130 | "version": "18.3.1", 131 | "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", 132 | "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", 133 | "dependencies": { 134 | "loose-envify": "^1.1.0", 135 | "scheduler": "^0.23.2" 136 | }, 137 | "peerDependencies": { 138 | "react": "^18.3.1" 139 | } 140 | }, 141 | "node_modules/react-social-icons/node_modules/scheduler": { 142 | "version": "0.23.2", 143 | "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", 144 | "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", 145 | "dependencies": { 146 | "loose-envify": "^1.1.0" 147 | } 148 | }, 149 | "node_modules/regenerator-runtime": { 150 | "version": "0.14.1", 151 | "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", 152 | "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" 153 | }, 154 | "node_modules/scheduler": { 155 | "version": "0.19.1", 156 | "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.19.1.tgz", 157 | "integrity": "sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==", 158 | "dependencies": { 159 | "loose-envify": "^1.1.0", 160 | "object-assign": "^4.1.1" 161 | } 162 | } 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cljs-starter", 3 | "version": "1.0.0", 4 | "description": "A minimal ClojureScript + Reagent project", 5 | "dependencies": { 6 | "create-react-class": "^15.7.0", 7 | "react": "^16.13.0", 8 | "react-dom": "16.13.0", 9 | "react-social-icons": "^6.22.0" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/clojurecraft/cljs-starter.git" 14 | }, 15 | "author": "Rafal Dittwald", 16 | "license": "MIT", 17 | "bugs": { 18 | "url": "https://github.com/clojurecraft/cljs-starter/issues" 19 | }, 20 | "homepage": "https://github.com/clojurecraft/cljs-starter#readme" 21 | } 22 | -------------------------------------------------------------------------------- /public/css/fonts.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'JetBrains Mono'; 3 | src: url('/fonts/JetBrainsMono-Regular.ttf') format('truetype'); 4 | font-weight: normal; 5 | font-display: swap; 6 | } 7 | 8 | @font-face { 9 | font-family: 'APL387'; 10 | src: url('/fonts/APL387.ttf') format('truetype'); 11 | font-weight: normal; 12 | font-display: swap; 13 | } 14 | 15 | @font-face { 16 | font-family: 'BQN386'; 17 | src: url('/fonts/BQN386.ttf') format('truetype'); 18 | font-weight: normal; 19 | font-display: swap; 20 | } 21 | 22 | @font-face { 23 | font-family: 'Uiua386'; 24 | src: url('/fonts/Uiua386.ttf') format('truetype'); 25 | font-weight: normal; 26 | font-display: swap; 27 | } 28 | 29 | @font-face { 30 | font-family: 'TinyAPL386'; 31 | src: url('/fonts/TinyAPL386.ttf') format('truetype'); 32 | font-weight: normal; 33 | font-display: swap; 34 | } -------------------------------------------------------------------------------- /public/fonts/APL387.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/fonts/APL387.ttf -------------------------------------------------------------------------------- /public/fonts/Apl385.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/fonts/Apl385.ttf -------------------------------------------------------------------------------- /public/fonts/BQN386.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/fonts/BQN386.ttf -------------------------------------------------------------------------------- /public/fonts/JetBrainsMono-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/fonts/JetBrainsMono-Regular.ttf -------------------------------------------------------------------------------- /public/fonts/TinyAPL386.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/fonts/TinyAPL386.ttf -------------------------------------------------------------------------------- /public/fonts/Uiua386.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/fonts/Uiua386.ttf -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hoogle Translate 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /public/media/code_report_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/code_report_circle.png -------------------------------------------------------------------------------- /public/media/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/favicon-16x16.png -------------------------------------------------------------------------------- /public/media/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/favicon-32x32.png -------------------------------------------------------------------------------- /public/media/favicon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/favicon-48x48.png -------------------------------------------------------------------------------- /public/media/favicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ϕλ 55 | -------------------------------------------------------------------------------- /public/media/logos/LISP_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/LISP_logo.png -------------------------------------------------------------------------------- /public/media/logos/ada.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/ada.png -------------------------------------------------------------------------------- /public/media/logos/agda.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 15 | 16 | logotype 18 | Created with Sketch. 20 | 27 | 30 | 37 | 40 | 97 | 102 | 105 | 110 | 113 | 114 | 117 | 122 | 127 | 128 | 131 | 136 | 141 | 142 | 145 | 150 | 155 | 156 | 157 | 158 | 159 | 160 | 162 | 163 | 165 | logotype 166 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /public/media/logos/apl_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/apl_logo.png -------------------------------------------------------------------------------- /public/media/logos/asp.net.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/asp.net.jpg -------------------------------------------------------------------------------- /public/media/logos/assembly_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/assembly_logo.png -------------------------------------------------------------------------------- /public/media/logos/bash_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/bash_logo.png -------------------------------------------------------------------------------- /public/media/logos/bqn_logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /public/media/logos/c_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/c_logo.png -------------------------------------------------------------------------------- /public/media/logos/chapel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/chapel.png -------------------------------------------------------------------------------- /public/media/logos/clojure_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/clojure_logo.png -------------------------------------------------------------------------------- /public/media/logos/cobol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/cobol.png -------------------------------------------------------------------------------- /public/media/logos/common_lisp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/common_lisp.png -------------------------------------------------------------------------------- /public/media/logos/cpp_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/cpp_logo.png -------------------------------------------------------------------------------- /public/media/logos/crystal_logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/media/logos/csharp_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/csharp_logo.png -------------------------------------------------------------------------------- /public/media/logos/css_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/css_logo.png -------------------------------------------------------------------------------- /public/media/logos/cuda.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/cuda.jpg -------------------------------------------------------------------------------- /public/media/logos/d_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/d_logo.png -------------------------------------------------------------------------------- /public/media/logos/dart_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/dart_logo.png -------------------------------------------------------------------------------- /public/media/logos/delphi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/delphi.png -------------------------------------------------------------------------------- /public/media/logos/dyalog_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/dyalog_logo.png -------------------------------------------------------------------------------- /public/media/logos/elixir_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/elixir_logo.png -------------------------------------------------------------------------------- /public/media/logos/elm_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/elm_logo.png -------------------------------------------------------------------------------- /public/media/logos/emacs_lisp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/emacs_lisp.png -------------------------------------------------------------------------------- /public/media/logos/erlang_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/erlang_logo.png -------------------------------------------------------------------------------- /public/media/logos/excel_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/excel_logo.png -------------------------------------------------------------------------------- /public/media/logos/fortran_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/fortran_logo.png -------------------------------------------------------------------------------- /public/media/logos/foxpro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/foxpro.png -------------------------------------------------------------------------------- /public/media/logos/fsharp_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/fsharp_logo.png -------------------------------------------------------------------------------- /public/media/logos/futhark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/futhark.png -------------------------------------------------------------------------------- /public/media/logos/gleam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/gleam.png -------------------------------------------------------------------------------- /public/media/logos/gleam.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /public/media/logos/go_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/go_logo.png -------------------------------------------------------------------------------- /public/media/logos/go_logo_thin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/go_logo_thin.png -------------------------------------------------------------------------------- /public/media/logos/groovy_logo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/groovy_logo.jpeg -------------------------------------------------------------------------------- /public/media/logos/haskell_logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | haskell 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /public/media/logos/html_logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/media/logos/j_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/j_logo.png -------------------------------------------------------------------------------- /public/media/logos/java_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/java_logo.png -------------------------------------------------------------------------------- /public/media/logos/javascript_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/javascript_logo.png -------------------------------------------------------------------------------- /public/media/logos/jq.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/jq.jpg -------------------------------------------------------------------------------- /public/media/logos/julia_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/julia_logo.png -------------------------------------------------------------------------------- /public/media/logos/julia_logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /public/media/logos/julia_logo_darkmode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/julia_logo_darkmode.png -------------------------------------------------------------------------------- /public/media/logos/jupyter_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/jupyter_logo.png -------------------------------------------------------------------------------- /public/media/logos/k.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/k.png -------------------------------------------------------------------------------- /public/media/logos/kap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/kap.png -------------------------------------------------------------------------------- /public/media/logos/kotlin-2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/media/logos/kotlin_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/kotlin_logo.png -------------------------------------------------------------------------------- /public/media/logos/kx-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/kx-logo.png -------------------------------------------------------------------------------- /public/media/logos/lfe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/lfe.png -------------------------------------------------------------------------------- /public/media/logos/lua_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/lua_logo.png -------------------------------------------------------------------------------- /public/media/logos/markdown_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/markdown_logo.png -------------------------------------------------------------------------------- /public/media/logos/mathematica.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/mathematica.png -------------------------------------------------------------------------------- /public/media/logos/matlab_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/matlab_logo.png -------------------------------------------------------------------------------- /public/media/logos/moon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /public/media/logos/newlisp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/newlisp.jpg -------------------------------------------------------------------------------- /public/media/logos/nim_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/nim_logo.png -------------------------------------------------------------------------------- /public/media/logos/objc_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/objc_logo.png -------------------------------------------------------------------------------- /public/media/logos/ocaml_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/ocaml_logo.jpg -------------------------------------------------------------------------------- /public/media/logos/pandas-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/pandas-logo.png -------------------------------------------------------------------------------- /public/media/logos/pandas-logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/pandas-logo2.png -------------------------------------------------------------------------------- /public/media/logos/pandas-logo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/pandas-logo3.png -------------------------------------------------------------------------------- /public/media/logos/pascal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/pascal.png -------------------------------------------------------------------------------- /public/media/logos/perl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/perl.png -------------------------------------------------------------------------------- /public/media/logos/pharo_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/pharo_logo.png -------------------------------------------------------------------------------- /public/media/logos/php_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/php_circle.png -------------------------------------------------------------------------------- /public/media/logos/php_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/php_logo.png -------------------------------------------------------------------------------- /public/media/logos/pico_lisp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/pico_lisp.png -------------------------------------------------------------------------------- /public/media/logos/plgpsql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/plgpsql.png -------------------------------------------------------------------------------- /public/media/logos/powershell_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/powershell_logo.png -------------------------------------------------------------------------------- /public/media/logos/purescript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/purescript.png -------------------------------------------------------------------------------- /public/media/logos/python_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/python_logo.png -------------------------------------------------------------------------------- /public/media/logos/r_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/r_logo.png -------------------------------------------------------------------------------- /public/media/logos/racket_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/racket_logo.png -------------------------------------------------------------------------------- /public/media/logos/rapids_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/rapids_logo.png -------------------------------------------------------------------------------- /public/media/logos/reason.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/reason.jpg -------------------------------------------------------------------------------- /public/media/logos/ruby_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/ruby_logo.png -------------------------------------------------------------------------------- /public/media/logos/rust_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/rust_logo.png -------------------------------------------------------------------------------- /public/media/logos/rust_logo_darkmode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/rust_logo_darkmode.png -------------------------------------------------------------------------------- /public/media/logos/sas_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/sas_logo.png -------------------------------------------------------------------------------- /public/media/logos/sass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/sass.png -------------------------------------------------------------------------------- /public/media/logos/scala_logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/media/logos/scala_logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/scala_logo2.png -------------------------------------------------------------------------------- /public/media/logos/scheme.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 23 | 25 | 27 | 31 | 35 | 36 | 38 | 42 | 46 | 47 | 49 | 53 | 57 | 58 | 60 | 64 | 68 | 69 | 71 | 75 | 79 | 80 | 82 | 86 | 90 | 91 | 93 | 97 | 101 | 102 | 104 | 108 | 112 | 113 | 122 | 124 | 128 | 132 | 133 | 143 | 145 | 149 | 153 | 154 | 161 | 172 | 183 | 194 | 195 | 215 | 217 | 218 | 220 | image/svg+xml 221 | 223 | 224 | 225 | 226 | 230 | 235 | 243 | 259 | 264 | 265 | 266 | -------------------------------------------------------------------------------- /public/media/logos/scratch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/scratch.png -------------------------------------------------------------------------------- /public/media/logos/sml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/sml.png -------------------------------------------------------------------------------- /public/media/logos/solidity_logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | Vector 1 8 | Created with Sketch. 9 | 10 | 11 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /public/media/logos/sql_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/sql_logo.png -------------------------------------------------------------------------------- /public/media/logos/swift_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/swift_logo.png -------------------------------------------------------------------------------- /public/media/logos/thrust_logo.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/thrust_logo.jfif -------------------------------------------------------------------------------- /public/media/logos/thrust_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/thrust_logo.png -------------------------------------------------------------------------------- /public/media/logos/tinyapl.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /public/media/logos/ts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/ts.png -------------------------------------------------------------------------------- /public/media/logos/uiua.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/uiua.png -------------------------------------------------------------------------------- /public/media/logos/vb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/vb.jpg -------------------------------------------------------------------------------- /public/media/logos/vba.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/vba.png -------------------------------------------------------------------------------- /public/media/logos/vim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/vim.png -------------------------------------------------------------------------------- /public/media/logos/vue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/public/media/logos/vue.png -------------------------------------------------------------------------------- /public/media/logos/zig_logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /scripts/algo_file_sort.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | 4 | def sort_file(filename): 5 | 6 | try: 7 | with open(filename, 'r', encoding='utf-8') as f: 8 | lines = f.readlines() 9 | header = lines[:2] 10 | 11 | parsed_rows = [line.split('|') for line in lines[2:]] 12 | stripped_rows = [[s.strip() for s in x] for x in parsed_rows] 13 | cleaned_rows = [] 14 | for row in stripped_rows: 15 | if len(row) == 8: 16 | cleaned_rows.append(row) 17 | elif len(row) == 9: 18 | cleaned_rows.append([row[0], row[1], (row[2][:-1] + '|' + row[3]), row[4], row[5], row[6], row[7], row[8]]) 19 | else: 20 | print(f"Parsing error: {row}") 21 | 22 | formatted_rows = [] 23 | for row in cleaned_rows: 24 | formatted_rows.append(['', f'{row[1]:^13}', f'{row[2]:^30}', f'{row[3]:^8}', f'{row[4]:^25}', f'{row[5]:^7}', f'{row[6]:^144}', '\n']) 25 | 26 | sorted_by_algo_id = sorted(formatted_rows, key=lambda x: (int(x[3]), x[1])) 27 | #assert(len(lines[2:]) == len(sorted_by_algo_id), "Something went wrong and the number of algorithms old vs. new doesn't match") 28 | sorted_by_language = sorted(formatted_rows, key=lambda x: (x[1], int(x[3]))) 29 | #assert(len(lines[2:]) == len(sorted_by_language), "Something went wrong and the number of algorithms old vs. new doesn't match") 30 | if len(lines[2:]) != len(sorted_by_language): 31 | print(f"Something went wrong and the number of algorithms old {len(lines[2:])} vs. new {len(sorted_by_language)} doesn't match") 32 | 33 | 34 | except FileNotFoundError: 35 | print(f"Error: File '{filename}' not found.") 36 | return 37 | 38 | try: 39 | with open('ALGORITHMS_SORTED_BY_ALGO_ID.md', 'w', encoding='utf-8') as f: # create new file sorted by AlgoId then by Language 40 | f.writelines(header) 41 | for i,x in enumerate(sorted_by_algo_id): 42 | f.write('|'.join(x)) 43 | 44 | with open('ALGORITHMS_SORTED_BY_LANGUAGE.md', 'w', encoding='utf-8') as f: # create new file sorted by Language then by AlgoId 45 | f.writelines(header) 46 | for i,x in enumerate(sorted_by_language): 47 | f.write('|'.join(x)) 48 | 49 | except Exception as e: 50 | print(f"Error writing to file: {e}") 51 | 52 | if __name__ == "__main__": 53 | if len(sys.argv) != 2: 54 | print("Usage: python algo_file_sort.py ") 55 | else: 56 | filename = sys.argv[1] 57 | sort_file(filename) 58 | print(f"File '{filename}' sorted successfully.") 59 | -------------------------------------------------------------------------------- /scripts/counts.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | 3 | import io 4 | import os 5 | from collections import Counter 6 | 7 | import cairosvg # Install with: pip install cairosvg 8 | import matplotlib.pyplot as plt 9 | import numpy as np 10 | from matplotlib.offsetbox import AnnotationBbox, OffsetImage 11 | from PIL import Image 12 | 13 | 14 | def count_languages(): 15 | # Get the root directory of the project (parent of scripts directory) 16 | root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) 17 | algorithms_path = os.path.join(root_dir, "ALGORITHMS.md") 18 | 19 | with open(algorithms_path, encoding="utf-8") as file: 20 | content = file.read() 21 | 22 | # Skip the header row and extract table rows 23 | rows = content.split("\n")[2:] # Skip header and separator rows 24 | 25 | languages = [] 26 | for row in rows: 27 | # Check if this is a table row (starts with |) 28 | if row.strip().startswith("|"): 29 | columns = row.split("|") 30 | if len(columns) > 1: 31 | # Get the language name from the first column and strip whitespace 32 | language = columns[1].strip() 33 | if language: # Skip empty lines 34 | languages.append(language) 35 | 36 | # Count occurrences using Counter 37 | counts = Counter(languages) 38 | 39 | # Print the results in descending order of frequency 40 | for language, count in counts.most_common(): 41 | print(f"{language}: {count}") 42 | 43 | # Create a bar chart with logos 44 | create_bar_chart_with_logos(counts, root_dir) 45 | 46 | 47 | def find_logo(language, root_dir): 48 | """Find a logo file for the given language in public/media/logos directory""" 49 | # Define special case mappings for language names with special characters 50 | special_cases = { 51 | "C++": [ 52 | "c++", 53 | "cplusplus", 54 | "cplus", 55 | "cpp", 56 | "c-plus-plus", 57 | ], # Added more variations 58 | "C#": ["c#", "csharp"], 59 | "F#": ["f#", "fsharp"], 60 | "RAPIDS (Python)": ["rapids", "rapids_python"], 61 | "RAPIDS (C++)": ["rapids", "rapids_cpp", "rapids_cplusplus"], 62 | "JavaScript": ["javascript", "js"], 63 | "TypeScript": ["typescript", "ts"], 64 | "pandas": ["pandas", "python_pandas"], 65 | "q": ["kx-logo"], 66 | } 67 | 68 | # Special debug for C++ 69 | is_cpp = language == "C++" 70 | if is_cpp: 71 | print("Searching for C++ logo specifically...") 72 | 73 | # Get normalized variations of the language name 74 | name_variations = [] 75 | base_name = language.lower() 76 | 77 | # Add special case variations if applicable 78 | if language in special_cases: 79 | name_variations.extend(special_cases[language]) 80 | else: 81 | # Remove any parentheses and content within 82 | cleaned_name = base_name.split("(")[0].strip() 83 | name_variations.append(cleaned_name) 84 | 85 | # Add standard variations 86 | name_variations.extend( 87 | [ 88 | base_name, 89 | base_name.replace(" ", ""), 90 | base_name.replace(" ", "_"), 91 | base_name.replace(" ", "-"), 92 | base_name.replace("+", "plus"), 93 | base_name.replace("#", "sharp"), 94 | ] 95 | ) 96 | 97 | # Remove duplicates 98 | name_variations = list(set(name_variations)) 99 | 100 | if is_cpp: 101 | print(f"C++ variations to try: {name_variations}") 102 | 103 | # List all files in the logos directory 104 | logo_dir = os.path.join(root_dir, "public/media/logos/") 105 | try: 106 | all_logo_files = os.listdir(logo_dir) 107 | if is_cpp: 108 | print(f"Available logo files: {all_logo_files}") 109 | except Exception as e: 110 | print(f"Error listing logo directory: {e}") 111 | all_logo_files = [] 112 | 113 | # Search for exact matches first 114 | for variation in name_variations: 115 | for file in all_logo_files: 116 | file_lower = file.lower() 117 | # Try exact match or with _logo suffix 118 | if ( 119 | file_lower == f"{variation}.png" 120 | or file_lower == f"{variation}.svg" 121 | or file_lower == f"{variation}_logo.png" 122 | or file_lower == f"{variation}_logo.svg" 123 | ): 124 | if is_cpp: 125 | print(f"Found C++ logo match: {file}") 126 | return os.path.join(logo_dir, file) 127 | 128 | # If no exact match, try substring matches 129 | for variation in name_variations: 130 | for file in all_logo_files: 131 | file_lower = file.lower() 132 | if variation in file_lower: 133 | if is_cpp: 134 | print(f"Found C++ logo via substring: {file}") 135 | return os.path.join(logo_dir, file) 136 | 137 | # Last resort for C++: try with any file that has cpp, c++, or cplusplus anywhere in the name 138 | if is_cpp: 139 | for file in all_logo_files: 140 | file_lower = file.lower() 141 | if "cpp" in file_lower or "c++" in file_lower or "cplusplus" in file_lower: 142 | print(f"Found C++ logo via last resort: {file}") 143 | return os.path.join(logo_dir, file) 144 | 145 | print( 146 | f"No logo found for {language} (tried variations: {', '.join(name_variations)})" 147 | ) 148 | return None 149 | 150 | 151 | def resize_image_to_20x20(img_path): 152 | """Resize an image to exactly 20x20 pixels, handling both PNG and SVG formats""" 153 | try: 154 | if img_path.lower().endswith(".svg"): 155 | # For SVG files, convert to PNG first using cairosvg 156 | png_data = cairosvg.svg2png(url=img_path, output_width=20, output_height=20) 157 | img = Image.open(io.BytesIO(png_data)) 158 | return np.array(img) 159 | 160 | # For other image formats (PNG, JPG, etc.) 161 | with Image.open(img_path) as img: 162 | # Convert to RGBA to handle transparency properly 163 | if img.mode != "RGBA": 164 | img = img.convert("RGBA") 165 | 166 | # Create a white background 167 | background = Image.new("RGBA", img.size, (255, 255, 255, 255)) 168 | 169 | # Paste the image on the background using alpha composite 170 | background.paste(img, (0, 0), img) 171 | 172 | # Convert back to RGB (remove alpha channel) 173 | img = background.convert("RGB") 174 | 175 | # Resize to 20x20 with antialiasing 176 | img_resized = img.resize((20, 20), Image.LANCZOS) 177 | 178 | # Convert PIL image to numpy array for matplotlib 179 | return np.array(img_resized) 180 | except Exception as e: 181 | print(f"Error processing image {img_path}: {e}") 182 | return None 183 | 184 | 185 | def create_bar_chart_with_logos(counts, root_dir): 186 | # Get data sorted by count (descending) 187 | languages, counts_values = zip(*counts.most_common()) 188 | 189 | # Create the bar chart with a clean, borderless style 190 | _, ax = plt.subplots(figsize=(16, 10)) 191 | 192 | # Remove the plot frame/border 193 | ax.spines["top"].set_visible(False) 194 | ax.spines["right"].set_visible(False) 195 | ax.spines["bottom"].set_visible(False) 196 | ax.spines["left"].set_visible(False) 197 | 198 | # Create the bars 199 | bars = ax.bar(languages, counts_values, color="skyblue") 200 | 201 | # Count found logos 202 | found_logos = 0 203 | 204 | # Add logos to the top of each bar 205 | for i, (language, bar) in enumerate(zip(languages, bars)): 206 | logo_path = find_logo(language, root_dir) 207 | if logo_path: 208 | try: 209 | # Process the image based on its type (SVG or other) 210 | img_resized = resize_image_to_20x20(logo_path) 211 | 212 | if img_resized is not None: 213 | # Create an OffsetImage with the resized logo 214 | imagebox = OffsetImage(img_resized, zoom=1.0) 215 | 216 | # Position the logo above the bar 217 | xy = ( 218 | i, 219 | bar.get_height() + max(counts_values) * 0.03, 220 | ) 221 | 222 | # Add the logo to the plot 223 | ab = AnnotationBbox(imagebox, xy, frameon=False) 224 | ax.add_artist(ab) 225 | 226 | found_logos += 1 227 | print(f"Added logo for {language} from {logo_path}") 228 | except Exception as e: 229 | print(f"Error adding logo for {language}: {e}") 230 | 231 | print(f"Successfully added {found_logos} logos out of {len(languages)} languages") 232 | 233 | # Set chart labels and properties 234 | plt.xlabel("Programming Languages") 235 | plt.ylabel("Frequency") 236 | plt.title("Programming Language Frequency in ALGORITHMS.md") 237 | plt.xticks(rotation=90) # Rotate language names for readability 238 | 239 | # Remove top and right ticks, keep only bottom and left 240 | ax.tick_params(top=False, right=False) 241 | 242 | # Tight layout to adjust spacing 243 | plt.tight_layout() 244 | 245 | # Reduce padding above title (smaller top margin) 246 | plt.subplots_adjust(top=0.95) # Increased from 0.85 to 0.95 to reduce space 247 | 248 | # Save the chart 249 | output_path = os.path.join(root_dir, "scripts", "language_counts.png") 250 | plt.savefig(output_path, dpi=300) 251 | print(f"Bar chart saved as '{output_path}'") 252 | 253 | 254 | if __name__ == "__main__": 255 | count_languages() 256 | -------------------------------------------------------------------------------- /scripts/first_free_id.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | 5 | 6 | def first_free_id(content): 7 | lines = content.strip().split("\n") 8 | 9 | ids = set() 10 | for line in lines: 11 | col = line.split("|")[3].strip() 12 | ids.add(int(col) if col.isdigit() else 0) 13 | 14 | return min(set(range(1, 1000)) - ids) 15 | 16 | 17 | def main(): 18 | root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) 19 | algorithms_path = os.path.join(root_dir, "ALGORITHMS.md") 20 | 21 | with open(algorithms_path, encoding="utf-8") as file: 22 | content = file.read() 23 | print(first_free_id(content)) 24 | 25 | 26 | if __name__ == "__main__": 27 | main() 28 | -------------------------------------------------------------------------------- /scripts/gen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import re 5 | 6 | 7 | def parse_md_table(content): 8 | """Parse a markdown table and extract data rows.""" 9 | lines = content.strip().split("\n") 10 | # Filter out header lines and separator lines 11 | data_rows = [] 12 | 13 | for line in lines: 14 | line = line.strip() 15 | # Skip header rows, separator rows, and empty lines 16 | if not line or line.startswith("| :") or line.startswith("| Language"): 17 | continue 18 | 19 | # Handle escaped pipe characters 20 | temp_placeholder = "ESCAPED_PIPE_PLACEHOLDER" 21 | line_with_placeholders = line.replace("\\|", temp_placeholder) 22 | raw_columns = line_with_placeholders.split("|")[1:-1] 23 | columns = [col.strip().replace(temp_placeholder, "|") for col in raw_columns] 24 | 25 | if len(columns) >= 5: # Ensure we have enough columns 26 | # Language, Algorithm, ID, Doc Link, Library 27 | language = columns[0] 28 | algo = columns[1].strip("`") # Strip backticks 29 | algo_id = columns[2] 30 | library = columns[3].replace("`", "") 31 | expr = "true" if columns[4] == "Y" else "false" 32 | doc_link = columns[5][6:-1] if len(columns) > 5 else "" 33 | 34 | # Add to data rows 35 | data_rows.append( 36 | { 37 | "language": language, 38 | "algo": algo, 39 | "id": algo_id, 40 | "doc": doc_link, 41 | "lib": library, 42 | "sig": "TODO", 43 | "expr": expr, 44 | } 45 | ) 46 | 47 | return data_rows 48 | 49 | 50 | def generate_clojure_map(data_rows): 51 | """Generate a Clojure map from the parsed data.""" 52 | result = "(ns data)\n\n(def by-key-map\n {\n" 53 | 54 | for row in data_rows: 55 | language = row["language"] 56 | algo = row["algo"] 57 | algo_id = row["id"] 58 | doc_link = row["doc"] 59 | library = row["lib"] 60 | expr = row["expr"] 61 | sig = row["sig"] if row["sig"] and row["sig"] != "TODO" else "-" 62 | 63 | # Format according to the new file pattern with Language@Algorithm@Library 64 | result += f'"{language}@{algo}@{library}@{algo_id}" {{:lang "{language}" :algo "{algo}" :lib "{library}" :id {algo_id} :doc "{doc_link}" :sig "{sig}" :expr {expr}}}\n' 65 | 66 | result += "})\n" 67 | return result 68 | 69 | 70 | def main(): 71 | # Get the root directory of the project (parent of scripts directory) 72 | root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) 73 | algorithms_path = os.path.join(root_dir, "ALGORITHMS.md") 74 | output_path = os.path.join(root_dir, "src", "data.cljs") 75 | 76 | # Read ALGORITHMS.md file from root directory 77 | with open(algorithms_path, encoding="utf-8") as file: 78 | content = file.read() 79 | 80 | # Parse the markdown table 81 | data_rows = parse_md_table(content) 82 | 83 | # Generate the Clojure map 84 | clojure_map = generate_clojure_map(data_rows) 85 | 86 | # Write to data.cljs in src directory 87 | with open(output_path, "w", encoding="utf-8") as outfile: 88 | outfile.write(clojure_map) 89 | 90 | print(f"Successfully generated {output_path} with {len(data_rows)} entries.") 91 | 92 | 93 | if __name__ == "__main__": 94 | main() 95 | -------------------------------------------------------------------------------- /scripts/language_counts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codereport/hoogle-translate/2e8220e4d7605ea6cdb6d5b01955b362ce17e412/scripts/language_counts.png -------------------------------------------------------------------------------- /scripts/ruff.toml: -------------------------------------------------------------------------------- 1 | lint.select = ["E", "F", "B", "W", "ERA", "RET", "UP", "I", "N", "Q"] 2 | 3 | lint.ignore = [ 4 | "E501", # Never enforce `E501` (line length violations). 5 | "E701", # Multiple statements on one line (colon) 6 | "E741", # Ambiguous variable name: `l` 7 | ] 8 | -------------------------------------------------------------------------------- /shadow-cljs.edn: -------------------------------------------------------------------------------- 1 | {:source-paths ["src"] 2 | :dependencies [[reagent "1.2.0"] 3 | [stylefy "3.2.0"]] 4 | :dev-http {8080 "public"} 5 | :builds {:dev {:target :browser 6 | :output-dir "public/js" 7 | :asset-path "/js" 8 | :modules {:main {:init-fn core/render!}} 9 | :devtools {:after-load core/render!} 10 | :release {:output-dir "public/js"}}}} 11 | -------------------------------------------------------------------------------- /src/core.cljs: -------------------------------------------------------------------------------- 1 | (ns core 2 | (:require 3 | [reagent.dom :as rdom] 4 | [reagent.core :as r] 5 | [clojure.string :as str] 6 | [stylefy.core :as stylefy] 7 | [styles :as styles] 8 | [data :as data] 9 | [imgs :as imgs] 10 | ["react-social-icons" :refer [SocialIcon]])) 11 | 12 | (defonce state (r/atom {:top-padding "250px" 13 | :results-table [:tr] 14 | :theme :light 15 | :hidden-langs #{} 16 | :settings-open false 17 | :show-expressions false 18 | :show-libraries false})) 19 | 20 | (defonce debug (r/atom {:info ""})) 21 | 22 | (defonce debounce-timer (r/atom nil)) 23 | 24 | ;; URL query parameter handling 25 | (defn get-query-params [] 26 | (try 27 | (let [search (.. js/window -location -search) 28 | query-string (subs search 1) ;; Remove leading '?' 29 | pairs (when (not (str/blank? query-string)) 30 | (str/split query-string #"&")) 31 | params (reduce (fn [acc pair] 32 | (if (str/includes? pair "=") 33 | (let [[k v] (str/split pair #"=")] 34 | (assoc acc (keyword k) (js/decodeURIComponent v))) 35 | acc)) 36 | {} (or pairs []))] 37 | params) 38 | (catch js/Error e 39 | (.log js/console "Error parsing URL params:" e) 40 | {}))) 41 | 42 | (defn update-url [search-text search-type] 43 | (try 44 | (when (and search-text (not (str/blank? search-text))) 45 | (let [new-url (str (.. js/window -location -pathname) 46 | "?q=" (js/encodeURIComponent search-text) 47 | "&type=" (name search-type))] 48 | (.replaceState js/history #js {} "" new-url))) 49 | (catch js/Error e 50 | (.log js/console "Error updating URL:" e)))) 51 | 52 | ; (defn extract-lang [s] 53 | ; (first (str/split s #"@"))) 54 | 55 | (defn paren-trim [s] 56 | (if (str/includes? s "(") 57 | (let [start (str/index-of s "(") 58 | end (str/index-of s ")")] 59 | (subs s (inc start) end)) 60 | s)) 61 | 62 | (defn normalize-algo [algo] 63 | (->> algo 64 | (paren-trim) 65 | (re-seq #"[a-zA-Z0-9]") 66 | (str/join) 67 | (str/lower-case))) 68 | 69 | (defn normalize-lang [lang] 70 | (->> lang 71 | (str/join) 72 | (str/lower-case))) 73 | 74 | (defn extract-algo [s] ;; TODO this is confusingly named (returns a list) 75 | [(-> s 76 | (str/split #"@") 77 | (second) 78 | (normalize-algo)) s]) 79 | 80 | (defn first-equals [s [a _]] 81 | (= a s)) 82 | 83 | (defn filter-by-algo [algo m] 84 | (map last (filter (partial first-equals (normalize-algo algo)) (map extract-algo (keys m))))) 85 | 86 | (defn get-id [m] (get m :id)) 87 | (defn get-algo [m] (get m :algo)) 88 | (defn get-lang [m] (get m :lang)) 89 | (defn get-lib [m] (get m :lib)) 90 | (defn get-sig [m] (get m :sig)) 91 | 92 | (defn filter-by-algo-id [id m] 93 | ;; Log for debugging 94 | (.log js/console "filter-by-algo-id called with id:" id "type:" (type id)) 95 | ;; Convert the ID to string for consistent comparison 96 | (let [id-str (if (number? id) (str id) id)] 97 | ;; Return the same format as the original function - map last (keys) 98 | (map last (filter (partial first-equals id-str) 99 | (map vector (map (comp str get-id) (vals m)) (keys m)))))) 100 | 101 | (defn filter-by-algo-id2 [id m] 102 | (keep (fn [[k {elem-id :id}]] (when (= id elem-id) k)) m)) 103 | 104 | (defn filter-by-algo-id3 [id m] 105 | (->> m 106 | (map (fn [[k {elem-id :id}]] (when (= id elem-id) k))) 107 | (remove nil?))) 108 | 109 | (defn filter-by-algo-id4 [id m] 110 | (->> m 111 | (filter (fn [[_ {elem-id :id}]] (= id elem-id))) 112 | (map first))) 113 | 114 | 115 | ;; (keep (fn [[k {elem-id :id}]] (when (= id elemid) k)) m) 116 | 117 | (defn filter-by-lang [lang m] 118 | (map last (filter (partial first-equals (normalize-lang lang)) 119 | (map vector (map (comp normalize-lang get-lang) (vals m)) (keys m))))) 120 | 121 | (defn filter-by-sig [sig m] 122 | (map last (filter (partial first-equals sig) 123 | (map vector (map get-sig (vals m)) (keys m))))) 124 | 125 | (def tr-hover-style {::stylefy/mode {:hover {:background-color "purple"}}}) 126 | 127 | (declare generate-table perform-search) 128 | 129 | (def excel-colors ["#CC99FF" "#99CCFF" "#CCFFCC" ;"#CCFFFF" 130 | "#FFFF99" "#FFCC99" "#FF99CC" "white"]) 131 | 132 | (defn get-algorithm-font [lang] 133 | (case lang 134 | "APL" "'APL387', monospace" 135 | "Kap" "'APL387', monospace" 136 | "BQN" "'BQN386', monospace" 137 | "TinyAPL" "'TinyAPL386', monospace" 138 | "Uiua" "'Uiua386', monospace" 139 | "'JetBrains Mono', monospace")) 140 | 141 | (def third-party-libraries 142 | {"python" ["RAPIDS cuDF" "pandas" "NumPy" "more-itertools"] 143 | "c++" ["range-v3" "boost::hana"] 144 | "rust" ["itertools"] 145 | "clojure" ["core.matrix"]}) 146 | 147 | (defn maybe-filter-third-party-libraries [coll] 148 | (filter (fn [item] 149 | (let [lang (normalize-lang (get-lang item)) 150 | lib (get-lib item)] 151 | (or (:show-libraries @state) 152 | (not (and lib (some #(= lib %) (get third-party-libraries lang))))))) 153 | coll)) 154 | 155 | (defn maybe-filter-expressions [coll] 156 | (filter (fn [item] 157 | (or (:show-expressions @state) 158 | (not (:expr item)))) 159 | coll)) 160 | 161 | (defn format-algorithm-with-fonts [algo-text lang] 162 | (let [special-font (get-algorithm-font lang) 163 | default-font "'JetBrains Mono', monospace" 164 | parts (str/split algo-text #" " 2)] ; Split on first space only 165 | (if (> (count parts) 1) 166 | ;; If there are multiple parts, apply different fonts 167 | [:span 168 | [:span {:style {:font-family special-font :font-weight "normal"}} (first parts)] 169 | [:span {:style {:font-family default-font}} (str " " (second parts))]] 170 | ;; Otherwise use the special font for the entire text 171 | [:span {:style {:font-family special-font}} algo-text]))) 172 | 173 | (defn get-logo-filename [lang theme] 174 | (let [base-filename (get imgs/logo-map lang) 175 | has-dark-variant (contains? imgs/darkmode-logos lang)] 176 | (if (and (= theme :dark) has-dark-variant) 177 | ;; Insert "_darkmode" before the file extension 178 | (let [dot-pos (str/last-index-of base-filename ".")] 179 | (str (subs base-filename 0 dot-pos) "_darkmode" (subs base-filename dot-pos))) 180 | base-filename))) 181 | 182 | (defn generate-row [info-map color-index] 183 | (let [current-theme (@state :theme) 184 | colors (get styles/theme-colors current-theme) 185 | text-color (:text colors) 186 | lang (get info-map :lang)] 187 | [:tr 188 | {:on-click 189 | (fn [e] 190 | (if (.-ctrlKey e) 191 | ;; If Ctrl key is pressed, add language to hidden-langs 192 | (do 193 | (.stopPropagation e) 194 | (swap! state update :hidden-langs conj lang) 195 | ;; Re-generate the whole table with updated frequencies 196 | (let [current-state @state 197 | selection (or (:selection current-state) (:search-text current-state)) 198 | how-to-generate-table (:how-to-generate-table current-state)] 199 | (swap! state assoc :results-table 200 | (generate-table selection how-to-generate-table)))) 201 | ;; Regular click behavior 202 | (let [algo-id (get info-map :id)] 203 | (update-url algo-id :by-algo-id) 204 | (reset! state (merge @state 205 | {:top-padding "20px" 206 | :theme current-theme 207 | :hidden-langs (:hidden-langs @state) 208 | :selection algo-id 209 | :how-to-generate-table :by-algo-id 210 | :results-table (generate-table algo-id :by-algo-id)}))))) 211 | ::stylefy/mode {:on-hover {:background-color (:hover colors)}}} 212 | [:td {:on-click (fn [e] 213 | (.stopPropagation e) 214 | (let [lang-name (get info-map :lang)] 215 | (update-url lang-name :by-lang) 216 | (reset! state (merge @state 217 | {:top-padding "20px" 218 | :theme current-theme 219 | :selection lang-name 220 | :how-to-generate-table :by-lang 221 | :results-table (generate-table lang-name :by-lang)}))))} 222 | [:img {:src (str/join ["/media/logos/" (get-logo-filename (get info-map :lang) current-theme)]) 223 | :width "40px" 224 | :height "40px" 225 | :style {:object-fit "contain"}}]] 226 | 227 | ;; Second cell - language name 228 | [:td {:style {:padding "12px 30px" 229 | :color text-color} 230 | :on-click (fn [e] 231 | (.stopPropagation e) 232 | (let [lang-name (get info-map :lang)] 233 | (update-url lang-name :by-lang) 234 | (reset! state (merge @state 235 | {:top-padding "20px" 236 | :theme current-theme 237 | :selection lang-name 238 | :how-to-generate-table :by-lang 239 | :results-table (generate-table lang-name :by-lang)}))))} 240 | (get info-map :lang)] 241 | 242 | [:td {:style {:padding "12px 30px" 243 | :font-weight "bold" 244 | :background-color (nth excel-colors color-index)}} 245 | (format-algorithm-with-fonts (get info-map :algo) lang)] 246 | [:td {:style {:padding "12px 30px" :color text-color}} (get info-map :lib)] 247 | [:td {:style {:padding "12px 30px"}} [:a {:href (get info-map :doc) 248 | :style {:color (:primary colors)}} "Doc"]]])) 249 | 250 | (defn choose-filter [how-to-generate-table] 251 | (case how-to-generate-table 252 | :by-algo (partial filter-by-algo) 253 | :by-algo-id (partial filter-by-algo-id) 254 | :by-lang (partial filter-by-lang) 255 | :by-sig (partial filter-by-sig))) 256 | 257 | (defn choose-colors [how-to-generate-table rows-info] 258 | (case how-to-generate-table 259 | 260 | :by-algo-id (map vector rows-info 261 | (map (partial 262 | get (->> (map get-algo rows-info) 263 | (map normalize-algo) 264 | (frequencies) 265 | (#(if (contains? % "") (assoc % "" 0) %)) 266 | (into (vector)) 267 | (sort-by last >) 268 | (map-indexed (fn [i [algo _]] [algo (min i 6)])) 269 | (into (hash-map)))) 270 | (->> (map get-algo rows-info) 271 | (map normalize-algo)))) 272 | 273 | :by-algo (map vector rows-info 274 | (map (partial 275 | get (->> (map get-id rows-info) 276 | (frequencies) 277 | (into (vector)) 278 | (sort-by last >) 279 | (map-indexed (fn [i [id _]] [id (min i 6)])) 280 | (into (hash-map)))) (map get-id rows-info))) 281 | 282 | :by-lang (map vector rows-info 283 | (repeat (count rows-info) 0)) 284 | 285 | :by-sig (map vector rows-info 286 | (repeat (count rows-info) 0)))) 287 | 288 | (defn in? 289 | [coll elm] 290 | (some #(= elm %) coll)) 291 | 292 | (defn is-table-mode? [input] 293 | (and (str/includes? input " ") 294 | (str/includes? input ","))) 295 | 296 | (defn parse-table-mode [input] 297 | (let [parts (str/split input #" " 2)] 298 | (if (= (count parts) 2) 299 | {:lang (first parts) 300 | :algos (map str/trim (str/split (second parts) #","))} 301 | nil))) 302 | 303 | (defn get-algorithm-id [algo] 304 | (->> data/by-key-map 305 | (filter-by-algo algo) 306 | (select-keys data/by-key-map) 307 | (vals) 308 | (first) 309 | (get-id))) 310 | 311 | (defn generate-table-mode-row [language-name algo-entries-by-lang algo-ids color-indices] 312 | (let [current-theme (@state :theme) 313 | colors (get styles/theme-colors current-theme) 314 | text-color (:text colors)] 315 | [:tr 316 | {:on-click 317 | (fn [e] 318 | (if (.-ctrlKey e) 319 | ;; If Ctrl key is pressed, add language to hidden-langs 320 | (do 321 | (.stopPropagation e) 322 | (swap! state update :hidden-langs conj language-name) 323 | ;; Re-generate the whole table with updated frequencies 324 | (let [current-state @state 325 | selection (or (:selection current-state) (:search-text current-state)) 326 | how-to-generate-table (:how-to-generate-table current-state)] 327 | (swap! state assoc :results-table 328 | (generate-table selection how-to-generate-table)))) 329 | ;; Regular click behavior 330 | (do 331 | (update-url language-name :by-lang) 332 | (reset! state (merge @state 333 | {:top-padding "20px" 334 | :theme current-theme 335 | :hidden-langs (:hidden-langs @state) 336 | :selection language-name 337 | :how-to-generate-table :by-lang 338 | :results-table (generate-table language-name :by-lang)}))))) 339 | ::stylefy/mode {:on-hover {:background-color (:hover colors)}}} 340 | 341 | ;; Language logo cell 342 | [:td {:on-click (fn [e] 343 | (.stopPropagation e) 344 | (update-url language-name :by-lang) 345 | (reset! state (merge @state 346 | {:top-padding "20px" 347 | :theme current-theme 348 | :selection language-name 349 | :how-to-generate-table :by-lang 350 | :results-table (generate-table language-name :by-lang)})))} 351 | [:img {:src (str/join ["/media/logos/" (get-logo-filename language-name current-theme)]) 352 | :width "40px" 353 | :height "40px" 354 | :style {:object-fit "contain"}}]] 355 | 356 | ;; Language name cell 357 | [:td {:style {:padding "12px 30px" :color text-color} 358 | :on-click (fn [e] 359 | (.stopPropagation e) 360 | (update-url language-name :by-lang) 361 | (reset! state (merge @state 362 | {:top-padding "20px" 363 | :theme current-theme 364 | :selection language-name 365 | :how-to-generate-table :by-lang 366 | :results-table (generate-table language-name :by-lang)})))} 367 | language-name] 368 | 369 | ;; Algorithm cells - one for each algorithm ID 370 | (for [[algo-name algo-id color-index] algo-ids] 371 | (let [matching-entries (filter #(= algo-id (get-id %)) 372 | (get algo-entries-by-lang language-name [])) 373 | algo-name2 (some-> matching-entries first get-algo) 374 | color-index (get color-indices (normalize-algo (or algo-name2 "")) 0)] 375 | (if (seq matching-entries) 376 | ;; Found algorithm for this language 377 | [:td {:style {:padding "12px 30px" 378 | :font-weight "bold" 379 | :background-color (nth excel-colors color-index)} 380 | :on-click (fn [e] 381 | (.stopPropagation e) 382 | (update-url algo-id :by-algo-id) 383 | (reset! state (merge @state 384 | {:top-padding "20px" 385 | :theme current-theme 386 | :selection algo-id 387 | :how-to-generate-table :by-algo-id 388 | :results-table (generate-table algo-id :by-algo-id)})))} 389 | (format-algorithm-with-fonts (get-algo (first matching-entries)) language-name)] 390 | 391 | ;; Algorithm not found for this language 392 | [:td {:style {:padding "12px 30px"}} "😢"])))])) 393 | 394 | (defn generate-table-mode [table-config] 395 | (let [lang (:lang table-config) 396 | algo-names (:algos table-config) 397 | hidden-langs (:hidden-langs @state) 398 | 399 | ;; Get the algorithm IDs for each algorithm name 400 | algo-ids-with-names (map (fn [algo-name] 401 | (let [algo-id (get-algorithm-id algo-name)] 402 | [algo-name algo-id])) 403 | algo-names) 404 | 405 | ;; Get entries for all requested algorithms by ID 406 | all-algo-entries (mapcat (fn [[_ algo-id]] 407 | (when algo-id 408 | (->> data/by-key-map 409 | (filter-by-algo-id algo-id) 410 | (select-keys data/by-key-map) 411 | (vals) 412 | (maybe-filter-third-party-libraries) 413 | (maybe-filter-expressions)))) 414 | algo-ids-with-names) 415 | 416 | ;; Group entries by language 417 | algo-entries-by-lang (group-by get-lang all-algo-entries) 418 | 419 | ;; Get all distinct languages that have at least one of the requested algorithms 420 | all-languages (keys algo-entries-by-lang) 421 | 422 | ;; Filter out hidden languages 423 | filtered-languages (remove #(contains? hidden-langs %) all-languages) 424 | 425 | ;; Filter entries to only include non-hidden languages 426 | filtered-entries (filter #(not (contains? hidden-langs (get-lang %))) all-algo-entries) 427 | 428 | ;; Count algorithm occurrence frequencies by ID using only visible languages 429 | algo-freq (->> filtered-entries 430 | (map get-algo) 431 | (map normalize-algo) 432 | (frequencies) 433 | (#(if (contains? % "") (assoc % "" 0) %))) 434 | 435 | ;; Sort by frequency and assign color indices 436 | color-indices (->> algo-freq 437 | (sort-by second >) 438 | (map first) 439 | (map-indexed (fn [i name] [name (min i 6)])) 440 | (into {})) 441 | 442 | ;; Create algo-ids with colors 443 | algo-ids-with-colors (map (fn [[name id]] 444 | [name id (get color-indices (normalize-algo name))]) 445 | algo-ids-with-names)] 446 | 447 | ;; (swap! debug assoc :info (str "Color indices: " (pr-str color-indices))) 448 | 449 | [:table {:style {:font-family "'JetBrains Mono', monospace" 450 | :padding "12px 12px" 451 | :font-size "20" 452 | :margin-left "auto" 453 | :margin-right "auto" 454 | :text-align "center"}} 455 | 456 | ;; Table body 457 | [:tbody 458 | (->> filtered-languages 459 | ;; Sort by algorithm frequency instead of by language name 460 | (sort-by (fn [lang-name] 461 | (let [entries (get algo-entries-by-lang lang-name []) 462 | ;; Count how many algorithms of each color index the language has 463 | color-counts (for [i (range 7)] ;; 0-6 are our color indices 464 | (count (filter (fn [entry] 465 | (let [algo-name (get-algo entry) 466 | normalized (normalize-algo algo-name) 467 | color (get color-indices normalized 7)] ;; Default to highest value if not found 468 | (= color i))) 469 | entries))) 470 | ;; Create a vector for sorting: [count-of-color-0, count-of-color-1, ...] 471 | ;; Negative values to sort in descending order 472 | sort-key (vec (map #(- %) color-counts))] 473 | ;; Append language name at the end for stable sorting 474 | (conj sort-key lang-name)))) 475 | (map #(generate-table-mode-row % algo-entries-by-lang algo-ids-with-colors color-indices)))]])) 476 | 477 | (defn decide-how [input] 478 | (cond 479 | (is-table-mode? input) :table-mode 480 | (in? (->> imgs/logo-map 481 | (keys) 482 | (map str/lower-case)) 483 | (str/lower-case input)) :by-lang 484 | (str/includes? input "->") :by-sig 485 | (str/includes? input " ") :by-algo-id 486 | :else :by-algo)) 487 | 488 | (defn generate-table [selection how-to-generate-table] 489 | (if (= how-to-generate-table :table-mode) 490 | (generate-table-mode (parse-table-mode selection)) 491 | (do 492 | ;; Add debugging for algorithm ID searches 493 | (when (= how-to-generate-table :by-algo-id) 494 | (.log js/console "Generate table for algo ID:" selection) 495 | (let [matches (->> data/by-key-map 496 | ((choose-filter how-to-generate-table) selection))] 497 | (.log js/console "Found" (count matches) "matches for selection"))) 498 | 499 | [:table {:style {:font-family "'JetBrains Mono', monospace" 500 | :padding "12px 12px" 501 | :font-size "20" ; this is for the rows 502 | :margin-left "auto" 503 | :margin-right "auto" 504 | :text-align "center"}} 505 | 506 | (->> data/by-key-map 507 | ((choose-filter how-to-generate-table) selection) 508 | (select-keys data/by-key-map) 509 | (vals) 510 | (remove #(contains? (:hidden-langs @state) (get-lang %))) 511 | (maybe-filter-third-party-libraries) 512 | (maybe-filter-expressions) 513 | (choose-colors how-to-generate-table) 514 | (sort-by last) 515 | (map (partial apply generate-row)))]))) 516 | 517 | (defn social-icon [props] 518 | [:> SocialIcon (merge {:style (styles/social-icon-style)} 519 | {:onMouseOver (fn [e] 520 | (-> e .-currentTarget .-style .-transform (set! "scale(1.25)"))) 521 | :onMouseOut (fn [e] 522 | (-> e .-currentTarget .-style .-transform (set! "scale(1)")))} 523 | props)]) 524 | 525 | (defn social-links [] 526 | [:div (styles/social-links-container) 527 | [social-icon {:url "https://bsky.app/profile/codereport.bsky.social"}] 528 | [social-icon {:url "https://mastodon.social/@code_report" :network "mastodon"}] 529 | [social-icon {:url "https://www.twitter.com/code_report"}] 530 | [social-icon {:url "https://www.youtube.com/c/codereport"}] 531 | [social-icon {:url "https://www.github.com/codereport"}]]) 532 | 533 | (def footnote {:style {:font-size 12}}) 534 | 535 | (defn footnotes [] 536 | [:div {:style {:font-size 12 :font-family "'JetBrains Mono', monospace"}} 537 | [:br] 538 | [:label "If you would like to contribute a missing language or algorithm, "] 539 | [:a {:href "https://github.com/codereport/hoogle-translate/blob/main/CONTRIBUTING.md"} [:label "file a PR"]] 540 | [:label "."]]) 541 | 542 | (defn save-theme-to-storage [theme] 543 | (.setItem js/localStorage "ht-theme" (name theme))) 544 | 545 | (defn load-theme-from-storage [] 546 | (if-let [saved-theme (.getItem js/localStorage "ht-theme")] 547 | (keyword saved-theme) 548 | (:theme @state))) ; default to current state if no saved theme 549 | 550 | (defn update-body-styles [theme] 551 | (let [colors (get styles/theme-colors theme) 552 | style-element (or (.getElementById js/document "theme-styles") 553 | (let [el (.createElement js/document "style")] 554 | (set! (.-id el) "theme-styles") 555 | (.appendChild (.-head js/document) el) 556 | el))] 557 | (set! (.-innerHTML style-element) 558 | (str "body { background-color: " (:background colors) "; margin: 0; padding: 0; }")))) 559 | 560 | (defn theme-toggle [] 561 | [:button 562 | {:style (styles/theme-toggle-style (@state :theme)) 563 | :on-click #(let [new-theme (if (= (@state :theme) :light) :dark :light) 564 | current-state @state 565 | top-padding (:top-padding current-state)] 566 | ;; Save theme to localStorage 567 | (save-theme-to-storage new-theme) 568 | ;; Update body styles with new theme 569 | (update-body-styles new-theme) 570 | ;; If there are search results showing, regenerate the table 571 | (if (= top-padding "20px") 572 | (let [search-text (:search-text current-state) 573 | selection (:selection current-state) 574 | how-to-generate-table (:how-to-generate-table current-state)] 575 | ;; Force a complete re-render of the table with the new theme 576 | (reset! state (merge @state 577 | {:search-text search-text 578 | :top-padding top-padding 579 | :theme new-theme 580 | :selection selection 581 | :hidden-langs (:hidden-langs current-state) 582 | :settings-open (:settings-open current-state) 583 | :show-expressions (:show-expressions current-state) 584 | :show-libraries (:show-libraries current-state) 585 | :how-to-generate-table how-to-generate-table})) 586 | ;; Update the results table after the state has been updated with the new theme 587 | (when (and selection how-to-generate-table) 588 | (swap! state assoc :results-table 589 | (generate-table selection how-to-generate-table)))) 590 | ;; Otherwise just update the theme 591 | (reset! state (assoc current-state :theme new-theme))))} 592 | (if (= (@state :theme) :light) "🌙 Dark" "☀️ Light")]) 593 | 594 | (defn settings-toggle [] 595 | [:button 596 | {:style (merge (styles/theme-toggle-style (@state :theme)) 597 | {:margin-top "50px" 598 | :display "block" 599 | :clear "both"}) 600 | :on-click #(swap! state update :settings-open not)} 601 | "⚙️"]) 602 | 603 | (defn settings-panel [] 604 | (when (@state :settings-open) 605 | (let [current-theme (@state :theme) 606 | colors (get styles/theme-colors current-theme)] 607 | [:div {:style {:position "absolute" 608 | :left "50px" 609 | :top "130px" 610 | :background-color (:background colors) 611 | :border (str "1px solid " (:border colors)) 612 | :border-radius "5px" 613 | :padding "10px" 614 | :z-index 100 615 | :box-shadow "0 2px 10px rgba(0,0,0,0.2)"}} 616 | [:div {:style {:margin "5px 0" 617 | :text-align "left"}} 618 | [:label {:style {:font-family "'JetBrains Mono', monospace" 619 | :color (:text colors) 620 | :margin-left "5px" 621 | :user-select "none"}} 622 | [:input {:type "checkbox" 623 | :checked (@state :show-expressions) 624 | :on-change (fn [_] 625 | (swap! state update :show-expressions not) 626 | ;; Then immediately refresh table if results are showing 627 | (when (= (@state :top-padding) "20px") 628 | (let [selection (or (:selection @state) (:search-text @state)) 629 | how-to-generate-table (:how-to-generate-table @state)] 630 | (when (and selection how-to-generate-table) 631 | (swap! state assoc :results-table 632 | (generate-table selection how-to-generate-table))))))}] 633 | " Show Expressions"]] 634 | [:div {:style {:margin "5px 0" 635 | :text-align "left"}} 636 | [:label {:style {:font-family "'JetBrains Mono', monospace" 637 | :color (:text colors) 638 | :margin-left "5px" 639 | :user-select "none"}} 640 | [:input {:type "checkbox" 641 | :checked (@state :show-libraries) 642 | :on-change (fn [_] 643 | (swap! state update :show-libraries not) 644 | ;; Then immediately refresh table if results are showing 645 | (when (= (@state :top-padding) "20px") 646 | (let [selection (or (:selection @state) (:search-text @state)) 647 | how-to-generate-table (:how-to-generate-table @state)] 648 | (when (and selection how-to-generate-table) 649 | (swap! state assoc :results-table 650 | (generate-table selection how-to-generate-table))))))}] 651 | " Show Third Party Libraries"]]]))) 652 | 653 | (defn perform-search 654 | ([search-text current-theme] 655 | (perform-search search-text current-theme false)) 656 | ([search-text current-theme reset-hidden?] 657 | (let [how-to-generate-table (decide-how search-text) 658 | selection (cond 659 | (= how-to-generate-table :table-mode) search-text 660 | (and (str/includes? search-text " ") 661 | (not (str/includes? search-text "->"))) 662 | (let [lang-algo (str/split search-text #" ") 663 | lang (first lang-algo) 664 | algo (second lang-algo) 665 | ;; Find the matching entry by prefix matching on language and algorithm 666 | matching-keys (filter #(and 667 | (str/starts-with? % (str lang "@")) 668 | (str/includes? % (str "@" algo "@"))) 669 | (keys data/by-key-map)) 670 | matching-key (first matching-keys)] 671 | (if matching-key 672 | (->> matching-key 673 | (get data/by-key-map) 674 | (get-id)) 675 | search-text)) 676 | :else search-text) 677 | ;; Use parameter to determine whether to reset hidden languages 678 | existing-hidden-langs (if reset-hidden? #{} (:hidden-langs @state))] 679 | ;; Update URL with search parameters 680 | (update-url search-text how-to-generate-table) 681 | (swap! state assoc 682 | :search-text search-text 683 | :top-padding "20px" 684 | :theme current-theme 685 | :selection selection 686 | :hidden-langs existing-hidden-langs 687 | :how-to-generate-table how-to-generate-table 688 | :results-table (generate-table selection how-to-generate-table))))) 689 | 690 | (defn debounced-search [search-text current-theme delay-ms] 691 | (when @debounce-timer 692 | (js/clearTimeout @debounce-timer)) 693 | (reset! debounce-timer 694 | (js/setTimeout #(perform-search search-text current-theme) delay-ms))) 695 | 696 | (defn app-view [] 697 | (let [current-theme (@state :theme) 698 | colors (get styles/theme-colors current-theme)] 699 | [:div {:style (styles/app-container-style current-theme (@state :top-padding))} 700 | [theme-toggle] 701 | [settings-toggle] 702 | [settings-panel] 703 | [:a {:href "https://www.youtube.com/c/codereport" 704 | :style (styles/logo-link)} 705 | [:img {:src "/media/code_report_circle.png" 706 | :style (styles/logo-image) 707 | :on-mouse-over (fn [e] 708 | (-> e .-target .-style .-transform (set! "scale(1.25)"))) 709 | :on-mouse-out (fn [e] 710 | (-> e .-target .-style .-transform (set! "scale(1)")))}]] 711 | 712 | [:label {:style (styles/heading-style current-theme)} "Hoogle Translate"] 713 | [:br] 714 | [:label (@debug :info)] 715 | [:br] 716 | [:input 717 | {:spellcheck "false" 718 | :focus true 719 | :style (styles/input-style current-theme) 720 | :on-change 721 | (fn [e] 722 | (let [value (.. e -target -value)] 723 | (when (not= value "") 724 | (debounced-search value current-theme 300)))) 725 | :on-key-press 726 | (fn [e] 727 | (if (= (.-key e) "Enter") 728 | (perform-search (.. e -target -value) current-theme true) 729 | (.log js/console "Not Enter")))}] 730 | [:br] 731 | [:br] 732 | 733 | (@state :results-table) 734 | 735 | ;; Only show attribution and social links when no results are showing 736 | (when (= (@state :top-padding) "250px") 737 | [:div 738 | [:label (styles/font 25) "by code_report"] 739 | [social-links]]) 740 | 741 | ;; Only show footnotes when results are showing 742 | (when (not= (@state :top-padding) "250px") 743 | [footnotes]) 744 | ])) 745 | 746 | (defn init-theme [] 747 | (let [saved-theme (load-theme-from-storage)] 748 | ;; Update state with saved theme if available 749 | (when (not= saved-theme (:theme @state)) 750 | (swap! state assoc :theme saved-theme)) 751 | (update-body-styles saved-theme)) 752 | nil) 753 | 754 | (defn init-from-url [] 755 | (let [params (get-query-params) 756 | q (:q params) 757 | type-str (:type params) 758 | search-type (when type-str (keyword type-str)) 759 | theme (:theme @state)] 760 | (when (and q (not (str/blank? q))) 761 | (js/console.log "Initializing search from URL:" q "type:" (or search-type "default")) 762 | 763 | ;; For all search types, set the state directly instead of using perform-search 764 | (let [how-to-generate-table (or search-type (decide-how q)) 765 | selection q] 766 | (js/console.log "Setting up search with selection:" selection "type:" how-to-generate-table) 767 | (reset! state (merge @state 768 | {:top-padding "20px" 769 | :theme theme 770 | :search-text q 771 | :selection selection 772 | :how-to-generate-table how-to-generate-table 773 | :results-table (generate-table selection how-to-generate-table)})))))) 774 | 775 | (defn render! [] 776 | (init-theme) 777 | (rdom/render 778 | [app-view] 779 | (js/document.getElementById "app")) 780 | ;; Initialize from URL parameters if present 781 | (js/setTimeout init-from-url 300)) 782 | -------------------------------------------------------------------------------- /src/imgs.cljs: -------------------------------------------------------------------------------- 1 | (ns imgs) 2 | 3 | (def logo-map 4 | {"Ada" "ada.png" 5 | "Agda" "agda.svg" 6 | "APL" "apl_logo.png" 7 | "Assembly" "assembly_logo.png" 8 | "ASP.NET" "asp.net.jpg" 9 | "Shell" "bash_logo.png" 10 | "BQN" "bqn_logo.svg" 11 | "C" "c_logo.png" 12 | "C++" "cpp_logo.png" 13 | "C#" "csharp_logo.png" 14 | "Chapel" "chapel.png" 15 | "Classic Visual Basic" "vb.jpg" 16 | "Clojure" "clojure_logo.png" 17 | "COBOL" "cobol.png" 18 | "Common Lisp" "common_lisp.png" 19 | "Crystal" "crystal_logo.svg" 20 | "CSS" "css_logo.png" 21 | "CUDA" "thrust_logo.png" 22 | "Thrust" "thrust_logo.jfif" 23 | "D" "d_logo.png" 24 | "Dart" "dart_logo.png" 25 | "Delphi" "delphi.png" 26 | "Elixir" "elixir_logo.png" 27 | "Elm" "elm_logo.png" 28 | "Emacs Lisp" "emacs_lisp.png" 29 | "Erlang" "erlang_logo.png" 30 | "Excel" "excel_logo.png" 31 | "F#" "fsharp_logo.png" 32 | "Fortran" "fortran_logo.png" 33 | "FoxPro" "foxpro.png" 34 | "Futhark" "futhark.png" 35 | "Gleam" "gleam.svg" 36 | "Go" "go_logo_thin.png" 37 | "Groovy" "groovy_logo.jpeg" 38 | "Haskell" "haskell_logo.svg" 39 | "HTML" "html_logo.svg" 40 | "J" "j_logo.png" 41 | "Java" "java_logo.png" 42 | "JavaScript" "javascript_logo.png" 43 | "jq" "jq.jpg" 44 | "Julia" "julia_logo.png" 45 | "Jupyter Notebook" "jupyter_logo.png" 46 | "k" "k.png" 47 | "Kap" "kap.png" 48 | "Kotlin" "kotlin-2.svg" 49 | "LFE" "lfe.png" 50 | "Lisp" "LISP_logo.png" 51 | "Lua" "lua_logo.png" 52 | "Markdown" "markdown_logo.png" 53 | "Mathematica" "mathematica.png" 54 | "MATLAB" "matlab_logo.png" 55 | "NewLisp" "newlisp.jpg" 56 | "Nim" "nim_logo.png" 57 | "Objective-C" "objc_logo.png" 58 | "OCaml" "ocaml_logo.jpg" 59 | "Pascal" "pascal.png" 60 | "Perl" "perl.png" 61 | "PicoLisp" "pico_lisp.png" 62 | "PLgpSQL" "plgpsql.png" 63 | "Pharo" "pharo_logo.png" 64 | "PHP" "php_circle.png" 65 | "pandas" "pandas-logo2.png" 66 | "PowerShell" "powershell_logo.png" 67 | "PureScript" "purescript.png" 68 | "Python" "python_logo.png" 69 | "q" "kx-logo.png" 70 | "R" "r_logo.png" 71 | "Racket" "racket_logo.png" 72 | "RAPIDS (C++)" "rapids_logo.png" 73 | "RAPIDS (Python)" "rapids_logo.png" 74 | "Reason" "reason.jpg" 75 | "Ruby" "ruby_logo.png" 76 | "Rust" "rust_logo.png" 77 | "SAS" "sas_logo.png" 78 | "Sass/SCSS" "sass.png" 79 | "Scala" "scala_logo2.png" 80 | "Scheme" "scheme.svg" 81 | "Scratch" "scratch.png" 82 | "Solidity" "solidity_logo.svg" 83 | "SQL" "sql_logo.png" 84 | "Standard ML" "sml.png" 85 | "Swift" "swift_logo.png" 86 | "TinyAPL" "tinyapl.svg" 87 | "TypeScript" "ts.png" 88 | "Uiua" "uiua.png" 89 | "VBA" "vba.png" 90 | "Visual Basic" "vb.jpg" 91 | "Visual Basic .NET" "vb.jpg" 92 | "Vim Script" "vim.png" 93 | "Vue" "vue.png" 94 | "Zig" "zig_logo.svg" 95 | "☾" "moon.svg"}) 96 | 97 | ;; List of languages that have dark mode logo variants 98 | (def darkmode-logos #{"Rust" "Julia"}) 99 | -------------------------------------------------------------------------------- /src/styles.cljs: -------------------------------------------------------------------------------- 1 | (ns styles) 2 | 3 | (defn font [font-size] 4 | {:style {:font-family "JetBrains Mono, monospace" 5 | :font-size (str font-size) 6 | :font-weight "bold"}}) 7 | 8 | (defn social-icon-style [] 9 | {:height 40 10 | :width 40 11 | :transition "all 0.2s ease-in-out" 12 | :transform "scale(1)"}) 13 | 14 | (defn social-links-container [] 15 | {:style {:display "flex" 16 | :gap "10px" 17 | :justify-content "center" 18 | :margin-top "10px"}}) 19 | 20 | (defn logo-link [] 21 | {:position "absolute" 22 | :right "30px" 23 | :top "30px" 24 | :cursor "pointer"}) 25 | 26 | (defn logo-image [] 27 | {:height "60px" 28 | :width "60px" 29 | :transition "all 0.2s ease-in-out" 30 | :transform "scale(1)"}) 31 | 32 | (def theme-colors 33 | {:light {:background "white" 34 | :text "black" 35 | :primary "darkviolet" 36 | :border "grey" 37 | :hover "purple"} 38 | :dark {:background "#121212" 39 | :text "white" 40 | :primary "#bb86fc" 41 | :border "#757575" 42 | :hover "#bb86fc"}}) 43 | 44 | (defn theme-toggle-style [theme] 45 | {:position "absolute" 46 | :left "30px" 47 | :top "30px" 48 | :background "transparent" 49 | :border (str "2px solid " (get-in theme-colors [theme :border])) 50 | :border-radius "25px" 51 | :padding "8px 16px" 52 | :color (get-in theme-colors [theme :primary]) 53 | :cursor "pointer" 54 | :font-family "'JetBrains Mono', monospace" 55 | :font-weight "bold" 56 | :transition "all 0.2s ease-in-out"}) 57 | 58 | (defn input-style [theme] 59 | (let [colors (get theme-colors theme)] 60 | {:padding "12px 20px" 61 | :margin "8px 0" 62 | :width "600px" 63 | :font-size "30" 64 | :font-family "'JetBrains Mono', monospace" 65 | :border-radius "25px" 66 | :border (str "2px solid " (:border colors)) 67 | :background-color (:background colors) 68 | :color (:text colors) 69 | :outline-width "0" 70 | :text-align "center" 71 | :spellcheck "false"})) 72 | 73 | (defn app-container-style [theme padding] 74 | (let [colors (get theme-colors theme)] 75 | {:search-text "" 76 | :text-align "center" 77 | :padding padding 78 | :background-color (:background colors) 79 | :color (:text colors) 80 | :min-height "100vh"})) 81 | 82 | (defn heading-style [theme] 83 | (let [colors (get theme-colors theme)] 84 | {:color (:primary colors) 85 | :font-family "'JetBrains Mono', monospace" 86 | :font-size "50" 87 | :font-weight "bold"})) 88 | --------------------------------------------------------------------------------