Skip to content

Commit

Permalink
Merge pull request #82 from LCOGT/feat/proposal-cover-latex
Browse files Browse the repository at this point in the history
feat: render math/limited latex in proposal abstract
  • Loading branch information
jashan-lco authored Mar 27, 2023
2 parents 4c21940 + 459aedc commit 6891bc3
Show file tree
Hide file tree
Showing 14 changed files with 276 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_url "https://raw.githubusercontent.com/cachix/devenv/d1f7b48e35e6dee421cfd0f51481d17f77586997/direnvrc" "sha256-YBzqskFZxmNb3kYVoKD9ZixoPXJh1C9ZvTLGFRkauZ0="

use devenv
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ pnpm-debug.log*
*.njsproj
*.sln
*.sw?

# Devenv
.devenv*
devenv.local.nix

138 changes: 138 additions & 0 deletions devenv.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1679514134,
"narHash": "sha256-x6wKyiOuJJW2phDbCpmSYjRlCe4Yva4r2nkqc7aNFsI=",
"owner": "cachix",
"repo": "devenv",
"rev": "a02418232d775e99ca349e1c8f71400aa1dd903c",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1660459072,
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1679410443,
"narHash": "sha256-xDHO/jixWD+y5pmW5+2q4Z4O/I/nA4MAa30svnZKK+M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c9ece0059f42e0ab53ac870104ca4049df41b133",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1678872516,
"narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-22.11",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1678976941,
"narHash": "sha256-skNr08frCwN9NO+7I77MjOHHAw+L410/37JknNld+W4=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "32b1dbedfd77892a6e375737ef04d8efba634e9e",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}
}
},
"root": "root",
"version": 7
}
13 changes: 13 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{ pkgs, ... }:

{
# https://devenv.sh/packages/
packages = [
pkgs.git
pkgs.nodejs-16_x
];

# https://devenv.sh/languages/
# languages.nix.enable = true;

}
3 changes: 3 additions & 0 deletions devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
72 changes: 70 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "observation-portal-frontend",
"version": "1.7.4",
"version": "1.8.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand All @@ -22,6 +22,7 @@
"html2pdf.js": "^0.9.2",
"jquery": "^3.5.0",
"jquery-file-download": "^1.4.6",
"katex": "^0.12.0",
"lodash": "^4.17.13",
"moment": "^2.22.1",
"ocs-component-lib": "^0.13.1",
Expand All @@ -30,6 +31,7 @@
"vis": "4.19.1",
"vue": "^2.6.11",
"vue-ctk-date-time-picker": "^2.0.9",
"vue-katex": "^0.5.0",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
},
Expand Down
6 changes: 6 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,9 @@ export default {
font-size: 0.6rem;
}
</style>

<style>
.abstract {
white-space: pre-wrap;
}
</style>
2 changes: 1 addition & 1 deletion src/components/SciApplicationDetailTemplate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<template v-if="sciApp.abstract">
<!-- TODO: Translate this -->
<h2>Abstract</h2>
<p>{{ sciApp.abstract }}</p>
<p class="abstract" v-katex:auto>{{ sciApp.abstract }}</p>
</template>
<template v-if="timeRequests.length > 0">
<!-- TODO: Translate this -->
Expand Down
18 changes: 18 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,30 @@ import { getCookie, csrfSafeMethod } from '@/utils.js';
import { OCSComponentLib } from 'ocs-component-lib';
import 'ocs-component-lib/dist/ocs-component-lib.css';
import VueCompositionAPI from '@vue/composition-api';
import VueKatex from 'vue-katex';
import 'katex/dist/katex.min.css';

Vue.use(VueCompositionAPI);
Vue.use(BootstrapVue);
Vue.component('BIcon', BIcon);
Vue.component('BIconStickies', BIconStickies);
Vue.use(OCSComponentLib);
Vue.use(VueKatex, {
globalOptions: {
throwOnError: false,
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "$", right: "$", display: false},
{left: "\\(", right: "\\)", display: false},
{left: "\\begin{equation}", right: "\\end{equation}", display: true},
{left: "\\begin{align}", right: "\\end{align}", display: true},
{left: "\\begin{alignat}", right: "\\end{alignat}", display: true},
{left: "\\begin{gather}", right: "\\end{gather}", display: true},
{left: "\\begin{CD}", right: "\\end{CD}", display: true},
{left: "\\[", right: "\\]", display: true},
]
}
});

Vue.config.productionTip = false;

Expand Down
4 changes: 2 additions & 2 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const routes = [
meta: {
title: 'Science Application',
requiresAuth: true,
isPlainPage: true
isPlainPage: false
}
},
{
Expand All @@ -156,7 +156,7 @@ const routes = [
props: true,
meta: {
requiresAuth: true,
isPlainPage: true
isPlainPage: false
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/views/ProposalDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<h3>
{{ data.id }} <small class="text-muted">{{ data.title }}</small>
</h3>
<p>{{ data.abstract }}</p>
<p class="abstract" v-katex:auto>{{ data.abstract }}</p>
<template v-if="principleInvestigators.length === 1">
<span class="font-weight-bolder">
Principal Investigator: {{ principleInvestigators[0].first_name }} {{ principleInvestigators[0].last_name }}
Expand Down
Loading

0 comments on commit 6891bc3

Please sign in to comment.