Git Product home page Git Product logo

catala-website's Introduction

The Catala language website

Generating assets

The assets folder of the website is generated partially from the Catala compiler. To generate these assets, please refer to the dedicated section of the Catala compiler INSTALL.md.

Run Project

yarn
yarn start
# this may fail because tailwind.css is not yet generated, so you have to do it again
yarn start
# In another tab, launch the local dev server
yarn server

View the app in the browser at http://localhost:8000. Running in this environment provides hot reloading and support for routing; just edit and save the file and the browser will automatically refresh.

To use a port other than 8000 set the PORT environment variable (PORT=8080 npm run server).

Build for Production

yarn clean
yarn build
# this may fail because tailwind.css is not yet generated, so you have to do it again
yarn build
yarn webpack:production

This will replace the development artifact build/Index.js for an optimized version as well as copy src/index.html into build/. You can then deploy the contents of the build directory (index.html and Index.js).

To enable dead code elimination, change bsconfig.json's package-specs module from "commonjs" to "es6". Then re-run the above 2 commands. This will allow Webpack to remove unused code.

Current deployment

The website is currently served from catala-lang.paris.inria.fr, whose underlying IP is also pointed to by catala-lang.org. The site contents are stored in the home directory of Denis Merigoux, so to update the contents of the website you would just need to issue a command like this:

rsync -ah --delete --info=progress2 build/ [email protected]:/home/ROCQ/prosecco/demerigo/

catala-website's People

Contributors

adelaett avatar altgr avatar armavica avatar denismerigoux avatar dependabot[bot] avatar emilerolley avatar rmonat avatar samestep avatar shindere avatar smorimoto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

catala-website's Issues

To fix

TODOs

  • Add a FrenchLaw module.
  • Clean the FrenchHousingBenefitsExample.
  • Better error handling from the french_law.
  • Visualization page in small screen.
  • Center text in the presentation page for very small screen.
  • Fix code highlighting with the new fixed navbar

Bug: white page on Brave / (Chromium)?

Currently the website isn't working on Brave -- and I assume on Chromium as Brave is based on it.

According to the error messages, it seems related to MathJax:

Uncaught TypeError: Cannot read properties of undefined (reading 'typeset')
    at typesetMathJax (CatalaCode.bs.js:9:1)
    at app (curry.js:14:1)
    at Object._1 (curry.js:62:1)
    at CatalaCode.bs.js:15:1
    at commitHookEffectListMount (react-dom.development.js:23150:1)
    at commitPassiveMountOnFiber (react-dom.development.js:24926:1)
    at commitPassiveMountEffects_complete (react-dom.development.js:24891:1)
    at commitPassiveMountEffects_begin (react-dom.development.js:24878:1)
    at commitPassiveMountEffects (react-dom.development.js:24866:1)
    at flushPassiveEffectsImpl (react-dom.development.js:27039:1)

Cannot run website

~/Documents/git
❯ git clone https://github.com/CatalaLang/catala-website.git
Cloning into 'catala-website'...
remote: Enumerating objects: 264, done.
remote: Counting objects: 100% (264/264), done.
remote: Compressing objects: 100% (137/137), done.
remote: Total 264 (delta 164), reused 219 (delta 119), pack-reused 0
Receiving objects: 100% (264/264), 258.72 KiB | 1.04 MiB/s, done.
Resolving deltas: 100% (164/164), done.
~/Documents/git
❯ cd catala-website/
~/Documents/git/catala-website master
❯ npm install
~/Documents/git/catala-website master
❯ npm start

> [email protected] start /mnt/c/Users/Nadim/Documents/git/catala-website
> bsb -make-world -w -ws _

bsb: no work to do.
>>>> Start compiling
bsb: no work to do.
>>>> Finish compiling 17 mseconds

...and, in another terminal:

~/Documents/git/catala-website master
❯ npm run server

> [email protected] server /mnt/c/Users/Nadim/Documents/git/catala-website
> webpack-dev-server

ℹ 「wds」: Project is running at http://localhost:8000/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /mnt/c/Users/Nadim/Documents/git/catala-website/build/
ℹ 「wds」: 404s will fallback to /index.html
✖ 「wdm」: Hash: 3661af7e5bb5b2f0cba8
Version: webpack 4.43.0
Time: 1567ms
Built at: 05/13/2020 10:04:53 AM
       Asset       Size  Chunks                   Chunk Names
    Index.js   3.56 MiB    main  [emitted]        main
Index.js.map    4.4 MiB    main  [emitted] [dev]  main
  index.html  454 bytes          [emitted]
Entrypoint main = Index.js Index.js.map
[0] multi (webpack)-dev-server/client?http://localhost:8000 ./src/Index.bs.js 40 bytes {main} [built]
[./node_modules/react/index.js] 190 bytes {main} [built]
[./node_modules/reason-react/src/ReactDOMRe.js] 2.6 KiB {main} [built]
[./node_modules/strip-ansi/index.js] 161 bytes {main} [built]
[./node_modules/webpack-dev-server/client/index.js?http://localhost:8000] (webpack)-dev-server/client?http://localhost:8000 4.29 KiB {main} [built]
[./node_modules/webpack-dev-server/client/overlay.js] (webpack)-dev-server/client/overlay.js 3.51 KiB {main} [built]
[./node_modules/webpack-dev-server/client/socket.js] (webpack)-dev-server/client/socket.js 1.53 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/createSocketUrl.js] (webpack)-dev-server/client/utils/createSocketUrl.js 2.91 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/log.js] (webpack)-dev-server/client/utils/log.js 964 bytes {main} [built]
[./node_modules/webpack-dev-server/client/utils/reloadApp.js] (webpack)-dev-server/client/utils/reloadApp.js 1.59 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/sendMessage.js] (webpack)-dev-server/client/utils/sendMessage.js 402 bytes {main} [built]
[./node_modules/webpack/hot sync ^\.\/log$] (webpack)/hot sync nonrecursive ^\.\/log$ 170 bytes {main} [built]
[./src/Footer.bs.js] 1.14 KiB {main} [built]
[./src/Index.bs.js] 638 bytes {main} [built]
[./src/Nav.bs.js] 2.27 KiB {main} [built]
    + 57 hidden modules

ERROR in ./src/Examples.bs.js
Module not found: Error: Can't resolve '../assets/allocations_familiales.html' in '/mnt/c/Users/Nadim/Documents/git/catala-website/src'
 @ ./src/Examples.bs.js 11:23-71 73:25-73
 @ ./src/Router.bs.js
 @ ./src/Index.bs.js

ERROR in ./src/Doc.bs.js
Module not found: Error: Can't resolve '../assets/catala.html' in '/mnt/c/Users/Nadim/Documents/git/catala-website/src'
 @ ./src/Doc.bs.js 30:12-44 74:18-50
 @ ./src/Router.bs.js
 @ ./src/Index.bs.js

ERROR in ./src/Examples.bs.js
Module not found: Error: Can't resolve '../assets/english.html' in '/mnt/c/Users/Nadim/Documents/git/catala-website/src'
 @ ./src/Examples.bs.js 43:15-48
 @ ./src/Router.bs.js
 @ ./src/Index.bs.js

ERROR in ./src/Formalization.bs.js
Module not found: Error: Can't resolve '../assets/grammar.html' in '/mnt/c/Users/Nadim/Documents/git/catala-website/src'
 @ ./src/Formalization.bs.js 6:15-48
 @ ./src/Router.bs.js
 @ ./src/Index.bs.js

ERROR in ./src/Doc.bs.js
Module not found: Error: Can't resolve '../assets/legifrance_catala.html' in '/mnt/c/Users/Nadim/Documents/git/catala-website/src'
 @ ./src/Doc.bs.js 53:14-57 76:29-72
 @ ./src/Router.bs.js
 @ ./src/Index.bs.js
Child html-webpack-plugin for "index.html":
     1 asset
    Entrypoint undefined = index.html
    [./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html] 550 bytes {0} [built]
ℹ 「wdm」: Failed to compile.

Seminar is shown as past beforehand

Hi Catala team,

a quick comment to note that on seminar page (https://catala-lang.org/en/seminar) and its French equivalent, the seminar of the day is filled in the "past" section already in the morning. I thought it would be more intuitive to keep it in "upcoming" for the day. Or even create a "today" section appropriately enabled only on a seminar day.

Best wishes from DGFiP.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.