Skip to content

Commit 4a5d69e

Browse files
samcunliffeCopilot
andauthored
Remove Zenodo badge, patch Doxygen's cookie.js to store in session storage. (#373)
Resolves #370 but might break certain browsers. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent e75bb99 commit 4a5d69e

File tree

4 files changed

+123
-52
lines changed

4 files changed

+123
-52
lines changed

.github/workflows/doxygen-gh-pages.yml

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -18,58 +18,60 @@ jobs:
1818
doxygen:
1919
runs-on: macos-latest
2020
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v5
23+
with:
24+
submodules: "true"
2125

22-
- name: Checkout repository
23-
uses: actions/checkout@v5
24-
with:
25-
submodules: "true"
26+
- name: Install Doxygen
27+
run: brew install doxygen graphviz
28+
shell: bash
2629

27-
- name: Install Doxygen
28-
run: brew install doxygen graphviz
29-
shell: bash
30+
- name: Run Doxygen
31+
run: doxygen doc/Doxyfile
32+
shell: bash
3033

31-
- name: Run Doxygen
32-
run: doxygen doc/Doxyfile
33-
shell: bash
34+
# Disabling jekyll ensures pages with underscores work on gh pages.
35+
- name: Create .nojekyll
36+
run: touch html/.nojekyll
37+
shell: bash
3438

35-
# Disabling jekyll ensures pages with underscores work on gh pages.
36-
- name: Create .nojekyll
37-
run: touch html/.nojekyll
38-
shell: bash
39+
- name: Manually copy over assets
40+
# Preserve the directory structure to keep README's image references!
41+
run: |
42+
mkdir -p html/doc/assets
43+
cp -R doc/assets/*.png html/doc/assets
44+
shell: bash
3945

40-
- name: Manually copy over assets
41-
# Preserve the directory structure to keep README's image references!
42-
run: |
43-
mkdir -p html/doc/assets
44-
cp -R doc/assets/*.png html/doc/assets
45-
shell: bash
46+
- name: Manually patch cookie.js
47+
run: cp doc/js/cookie.js html/cookie.js
48+
shell: bash
4649

47-
- name: Upload the website
48-
uses: actions/upload-artifact@v4
49-
with:
50-
name: tdms_website
51-
path: html/*
52-
retention-days: 1
50+
- name: Upload the website
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: tdms_website
54+
path: html/*
55+
retention-days: 1
5356

5457
publish:
5558
runs-on: ubuntu-latest
5659
needs: doxygen
5760
if: github.event_name == 'push' && github.ref_name == 'main'
5861
steps:
62+
- name: Checkout repository
63+
uses: actions/checkout@v5
5964

60-
- name: Checkout repository
61-
uses: actions/checkout@v5
65+
- name: Download the content for deployment
66+
uses: actions/download-artifact@v5
67+
with:
68+
name: tdms_website
69+
path: html
70+
# Recreate and download to the html directory just for tidiness sake.
6271

63-
- name: Download the content for deployment
64-
uses: actions/download-artifact@v5
65-
with:
66-
name: tdms_website
67-
path: html
68-
# Recreate and download to the html directory just for tidiness sake.
69-
70-
- name: Commit to GitHub Pages
71-
uses: JamesIves/github-pages-deploy-action@v4
72-
with:
73-
token: ${{ secrets.GITHUB_TOKEN }}
74-
branch: gh-pages
75-
folder: html
72+
- name: Commit to GitHub Pages
73+
uses: JamesIves/github-pages-deploy-action@v4
74+
with:
75+
token: ${{ secrets.GITHUB_TOKEN }}
76+
branch: gh-pages
77+
folder: html

README.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
and title at the top of README.md when building the project page (the title
55
would be duplicated) everything else in README.md is also the project homepage. -->
66

7-
# TDMS · [![latest release](https://badgen.net/github/release/UCL/TDMS)](https://github.com/UCL/TDMS/releases) [![license](https://badgen.net/badge/license/GPL-3.0/blue)](https://github.com/UCL/TDMS/blob/main/LICENSE) [![Build and test](https://github.com/UCL/TDMS/actions/workflows/ci.yml/badge.svg)](https://github.com/UCL/TDMS/actions/workflows/ci.yml) [![MATLAB tests](https://github.com/UCL/TDMS/actions/workflows/matlab_tests.yml/badge.svg)](https://github.com/UCL/TDMS/actions/workflows/matlab_tests.yml) [![codecov](https://codecov.io/gh/UCL/TDMS/branch/main/graph/badge.svg?token=3kqP14kslL)](https://codecov.io/gh/UCL/TDMS) [![DOI](https://zenodo.org/badge/448864310.svg)](https://zenodo.org/badge/latestdoi/448864310)
7+
# TDMS · [![latest release](https://badgen.net/github/release/UCL/TDMS)](https://github.com/UCL/TDMS/releases) [![license](https://badgen.net/badge/license/GPL-3.0/blue)](https://github.com/UCL/TDMS/blob/main/LICENSE) [![Build and test](https://github.com/UCL/TDMS/actions/workflows/ci.yml/badge.svg)](https://github.com/UCL/TDMS/actions/workflows/ci.yml) [![MATLAB tests](https://github.com/UCL/TDMS/actions/workflows/matlab_tests.yml/badge.svg)](https://github.com/UCL/TDMS/actions/workflows/matlab_tests.yml) [![codecov](https://codecov.io/gh/UCL/TDMS/branch/main/graph/badge.svg?token=3kqP14kslL)](https://codecov.io/gh/UCL/TDMS) [![DOI:10.5281/zenodo.7950603](doc/assets/doi-badge.svg)](https://zenodo.org/badge/latestdoi/448864310)
88

99
<!-- \endcond -->
1010

@@ -26,6 +26,7 @@ It needs to be built against [FFTW](https://www.fftw.org/) and [MATLAB](https://
2626
Assuming you don't already have them, you'll need a C++ compiler, CMake, OpenMP and FFTW.
2727

2828
For Debian-based distributions this should be as simple as
29+
2930
```{sh}
3031
$ sudo apt install git gcc cmake libfftw3-dev libgomp1
3132
```
@@ -61,10 +62,11 @@ Assuming you don't already have them, you'll need to download and install:
6162
<!-- when updating to version 1.1+, uncomment
6263
6364
* [HDF5](https://portal.hdfgroup.org/display/HDF5/HDF5+CPP+Reference+Manuals) -->
64-
* [MATLAB](https://www.mathworks.com/products/matlab.html),
65-
* [Visual Studio](https://visualstudio.microsoft.com/vs/community/) and **be sure to select the C++ developer kit**,
66-
* [CMake](https://cmake.org/download/),
67-
* and [FFTW](https://www.fftw.org/install/windows.html).
65+
66+
- [MATLAB](https://www.mathworks.com/products/matlab.html),
67+
- [Visual Studio](https://visualstudio.microsoft.com/vs/community/) and **be sure to select the C++ developer kit**,
68+
- [CMake](https://cmake.org/download/),
69+
- and [FFTW](https://www.fftw.org/install/windows.html).
6870

6971
You can check that the Visual Studio compiler was installed with:
7072

@@ -74,7 +76,6 @@ PS> MSBuild.exe -h
7476

7577
Potentially the simplest way to get FFTW is via [conda](https://anaconda.org/conda-forge/fftw):
7678

77-
7879
```{pwsh}
7980
PS> conda install -c conda-forge fftw --yes
8081
```
@@ -84,10 +85,12 @@ PS> conda install -c conda-forge fftw --yes
8485
You'll need to ensure the paths to FFTW and MATLAB (the locations of `fftw3.dll` and `libmex.dll` respectively) are in the `env:Path`.
8586

8687
These can be found, e.g. by
88+
8789
```{pwsh}
8890
PS> conda list fftw # assuming you installed via conda
8991
PS> which.exe MATLAB
9092
```
93+
9194
Which should return something like `C:\Program Files (x86)\MATLAB\R20XXx\bin\matlab` and maybe `C:\ProgramData\envs\base\bin`.
9295
If you downloaded FFTW and created `fftw3.dll` with `lib.exe`, you just need to know where you saved it.
9396

@@ -98,22 +101,23 @@ PS> $env:Path += ";C:\Program Files (x86)\MATLAB\R20XXx\bin\;C:\ < wherever fftw
98101
```
99102

100103
Which will help Windows locate `.dll` files later.
101-
For all following instructions, you'll have to substitute our mentions of ``tdms`` with ``tdms.exe`` and ``$`` is used to denote a command prompt which, in PowerShell, would look like ``PS>``
104+
For all following instructions, you'll have to substitute our mentions of `tdms` with `tdms.exe` and `$` is used to denote a command prompt which, in PowerShell, would look like `PS>`
102105

103106
<details>
104107
<summary>Even more Windows troubleshooting</summary>
105108

106-
We've seen that in a fresh PowerShell window, Windows does not remember the location of the ``.dll`` files, so you may have to re-add them to the path, or copy them into the directory where TDMS was installed.
109+
We've seen that in a fresh PowerShell window, Windows does not remember the location of the `.dll` files, so you may have to re-add them to the path, or copy them into the directory where TDMS was installed.
107110

108-
TDMS typically installs to ``"C:\Program Files (x86)\tdms\bin\tdms.exe"``.
111+
TDMS typically installs to `"C:\Program Files (x86)\tdms\bin\tdms.exe"`.
109112

110113
</details>
111114

112115
</details>
113116

114-
------
117+
---
115118

116119
You'll need to download and install [MATLAB](https://www.mathworks.com/products/matlab.html), and take note where the headers are installed.
120+
117121
</details>
118122

119123
## Installation
@@ -137,10 +141,12 @@ If CMake cannot find MATLAB, FFTW, or install to the default installation prefix
137141
<!-- TODO: add HDF5 when updating to v1.1+ -->
138142

139143
You can check that `tdms` was installed correctly and is in your `PATH` by running:
144+
140145
```{sh}
141146
$ tdms --help
142147
$ tdms --version
143148
```
149+
144150
in a new terminal.
145151

146152
## How to run
@@ -177,7 +183,7 @@ In a terminal run
177183
$ which tdms
178184
```
179185

180-
Copy the full path (something like `/usr/local/bin/tdms`) into [`run_pstd_bscan.m`](https://github.com/UCL/TDMS/blob/main/examples/arc_01/run_pstd_bscan.m), replacing the ` 'tdms' ` text in the calls to the ``system()`` function.
186+
Copy the full path (something like `/usr/local/bin/tdms`) into [`run_pstd_bscan.m`](https://github.com/UCL/TDMS/blob/main/examples/arc_01/run_pstd_bscan.m), replacing the `'tdms'` text in the calls to the `system()` function.
181187

182188
</details>
183189

@@ -205,6 +211,7 @@ These options can be selected by setting the corresponding flag variables in the
205211
When `tdms` reads the input, it will verify if the input file contains a dataset that matches the names of these flags.
206212

207213
There are two flags available for configuration in the input file.
214+
208215
<details>
209216
<summary> `use_pstd` </summary>
210217
- If not provided, or provided as `false`, then the default timestepping method of finite-differences (FDTD) will be used.
@@ -217,10 +224,12 @@ There are two flags available for configuration in the input file.
217224

218225
\note Typically bandlimited interpolation is superior to cubic interpolation when the extent of the Yee cell is of approximately the same order as, but slightly less than, one-sixth of the shortest wavelength of interest.
219226
Otherwise, cubic interpolation typically enjoys superior accuracy.
227+
220228
</details>
221229

222230
TDMS is parallelised with [OpenMP](https://en.wikipedia.org/wiki/OpenMP).
223231
You can set the maximum number of threads using the `OMP_NUM_THREADS` environment variable before calling the TDMS executable.
232+
224233
```{sh}
225234
$ export OMP_NUM_THREADS=4 # for example
226235
```

doc/assets/doi-badge.svg

Lines changed: 35 additions & 0 deletions
Loading

doc/js/cookie.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*!
2+
This is a patched 'Cookie helper functions' from Doxygen that overrides all
3+
cookie setting and places everything in sessionStorage. It might break some browsers but works in Firefox and Chrome.
4+
5+
Original header:
6+
Copyright (c) 2023 Dimitri van Heesch
7+
Released under MIT license.
8+
*/
9+
let Cookie = {
10+
cookie_namespace: 'doxygen_',
11+
12+
readSetting(cookie,defVal) {
13+
const val = sessionStorage.getItem(this.cookie_namespace+cookie);
14+
if (val) return val;
15+
return defVal;
16+
},
17+
18+
writeSetting(cookie,val,days=0) { // default days='session', 0=session cookie, -1=delete
19+
sessionStorage.setItem(this.cookie_namespace+cookie,val);
20+
},
21+
22+
eraseSetting(cookie) {
23+
sessionStorage.removeItem(this.cookie_namespace+cookie);
24+
},
25+
}

0 commit comments

Comments
 (0)